PDA

View Full Version : [Discussion] Chip of choice?



kankatee
12-08-2008, 10:20 AM
So the question is, what is your chip of choice? As in which micro's do you favor and why? What languages are used? How much is a single unit? etc.

I have nearly fully weened myself off of Basic Stamps. The BS2 served as an excellent entry point into simple robotic systems but am now looking to step it up a notch. The wide selection of PICAXE chips I have are great, easy to use, but I fear I will soon run into similar issues. At least they support interrupts.

Perhaps I need a C-based chip.

ScuD
12-08-2008, 11:01 AM
I'm a huge fan of 8051- based micro's, although the basic core is over 25 yrs old, it's still widely used today. If that's not a statement, I don't know what is :)

Pic microcontrollers do work for me as well, they're good all-round chips with enough choices of peripherals to suit your need, but coming from 8051/8052 they tend to get dissapointing after a while. More code needed for the same purpose, no seperate interrupt vectors etc etc.

I've heard good stuff about the Arm Cortex core, but haven't used it yet. It's on my to-do list though

lnxfergy
12-08-2008, 11:30 AM
So the question is, what is your chip of choice? As in which micro's do you favor and why? What languages are used? How much is a single unit? etc.

I have nearly fully weened myself off of Basic Stamps. The BS2 served as an excellent entry point into simple robotic systems but am now looking to step it up a notch. The wide selection of PICAXE chips I have are great, easy to use, but I fear I will soon run into similar issues. At least they support interrupts.

Perhaps I need a C-based chip.

AVR microcontrollers, the ATmega168 is about $4, has 24 I/O, 1 serial port, 3 timer/counter which provide 6 PWM, Interrupts on any channel. The mega324 is about $6 has 32 I/O, all of the above, and 2 serial ports. AVR-GCC is a completely free C compiler. The one tool you will need is a programmer - about $30 - to load code onto the chips. But you only need one programmer for the rest of your life.

If you are scared about the hardware programmer stuff, you could also get an Arduino, which uses an AVR. About $35, is a mega168. Any code you develop for Arduino can run on pretty much any AVR with only a small amount of work.

-Fergs

lnxfergy
12-08-2008, 11:32 AM
I've heard good stuff about the Arm Cortex core, but haven't used it yet. It's on my to-do list though

I wouldn't recommend an ARM for a beginner. Quite a bit more powerful - but way more complicated - than an AVR or PIC.

-Fergs

kankatee
12-08-2008, 01:04 PM
Ferg- What does one need to get started with an AVR? You say a compiler? Got any links to recommended buys?

ScuD
12-08-2008, 01:55 PM
I wouldn't recommend an ARM for a beginner. Quite a bit more powerful - but way more complicated - than an AVR or PIC.

-Fergs

Agreed. Misunderstood the opening post, my bad :happy:

Adrenalynn
12-08-2008, 02:03 PM
I'm with Fergs on this one. You need a programmer and a compiler/development environment. Environment/compiler is free: http://winavr.sourceforge.net/ You'd be programming in ANSI C with libraries.

Programmer - you have some options. You can go all the way to the top-end like I did (STK500) at about $85, or come down from there... The STK500 will let you program ANY AVR, from the smallest <$1.00ATTINY all the way up... You could drop all the way down to an $8 programmer - but you'd need to build your own socket board for programming, realistically: http://robokitsworld.com/index.php?main_page=product_info&products_id=52&zenid=in25sdjggcgheee4mprndredv1

I'd get a good programmer and never think about it again... The range of AVR chips and what they offer is gihugic. I even use the little ATTINY45 quite a bit - 256bytes of EEProm, 4KB of Flash, 256Bytes SRAM, 6 GPIO, 32 GP Register, an 8bit Timer/Counter w/compare, an 8bit high speed timer/counter, serial interface, both internal and external interrupts, a 4 channel 10bit ADC, a programmable watchdog timer, and three different power-saving modes. All that for only $2.00 in a handy little DIP package.

Of course, going up you can move to the 640, with 16 ADC 10bit, and a dozens of lines - about $12 Or a 128 with 53 GPIO, 4K RAM/EEPROM, 32 GP registers, RTC, 4x Timer/Counters with Compare and PWM, 2UARTs for serial, two-wire serial, 8 channel 10bit ADC w/differential stage/programmable gain, JTAG, SPI, six power modes, ... <$15.

Tons of options, tons of performance, very little money after you drop for a good programmer...

kankatee
12-08-2008, 07:54 PM
Ok wait a minute.

I hear AVR, ATMega, Atmel. Who's who and what's what?

I looked up the STK500: http://media.digikey.com/photos/Atmel%20Photos/ATSTK500.jpg
Now don't laugh, but I don't see a prototyping area. Can you explain the typical process AVR developers use? Or at least yourself..

Thanks!

Adrenalynn
12-08-2008, 08:30 PM
Atmel makes the ATMega and ATTiny AVR series of MCU. :)

An engineer uses that board to program an MCU, then pops it out of the board and moves it over to the circuit, be that a breadboard, perfboard, or printed circuit...

You can also use that board to read/write an MCU in-circuit

kankatee
12-08-2008, 08:45 PM
Yeah, cool.

You'll be happy to know I just sold my BS2s!!

$80 for both of them along with a prototyping board. Deal.

billyzelsnack
12-08-2008, 08:51 PM
Check out this AVR tutorial at sparkfun..

http://www.sparkfun.com/commerce/tutorials.php?tc=1

Adrenalynn
12-08-2008, 09:27 PM
Actually, thinking about it, I'd probably be more accurate to say "Atmel makes the AVR microprocessors which include the ATMega series and the ATTiny series" ...

Grats on unloading some BS and graduating to the AVRs! :)

You are going to be learning ANSI C now though... :) ^ 2

kankatee
12-08-2008, 09:35 PM
Yeah, thanks.

I have worked in various forms of C for 5 years now, little bit of C, a fair amount of C++, and more than my fair share of C#. I know they are different, but I have a baseline understanding. Don't think I won't have more questions though.

So Adren, do you purely work with Atmel?

Adrenalynn
12-09-2008, 12:06 AM
Personally? 95&#37;. Professionally? Naw, all over the board. The Atmel chips are my favs, but I've been doing embedded engineering/design/architecture since long before the Harvard Architecture came to fruition. Professionally I favor the ARM series chips, often paired with FPGAs. But it depends on what I'm designing. I do a lot of PIC work too.

elios
12-09-2008, 12:29 AM
So the question is, what is your chip of choice? As in which micro's do you favor and why? What languages are used? How much is a single unit? etc.

I have nearly fully weened myself off of Basic Stamps. The BS2 served as an excellent entry point into simple robotic systems but am now looking to step it up a notch. The wide selection of PICAXE chips I have are great, easy to use, but I fear I will soon run into similar issues. At least they support interrupts.

Perhaps I need a C-based chip.

PICAXE can run C.

note: there is a difference between PIC and PICAXE chips

Rudolph
12-09-2008, 01:46 AM
PICAXE can run C.

note: there is a difference between PIC and PICAXE chips

Isn't PICAXE just (basically) a pre-programmed PIC, with some kind of development environment? Kinda like Arduino, just with a PIC instead of an AVR.

Adrenalynn
12-09-2008, 01:55 AM
Yeah, but then so's a BASIC Stamp, really. Both just incredibly over-priced PICs.

robot maker
12-16-2008, 12:25 AM
when i look for a microcontroller ,i dont look at what type AVR OR PIC mostly outputs and pins and if another person has a design and code very close to what i need with some code change,then that is the chip i buy,like picaxe circuit for battery monitor complete with code,save me alot of time and cost looking for like a avr circuit,but then i needed avr board for my hand design to control many servos and A-D inputs so AXON board was a good use,god about some board like picaxe is they have a bootloader built in,so no programmer is needed,then looking for other board that needed pic processor with circuit i neede just add I2C code to it,so i bought the protype board and programmer
always look good to find a circuit very close to design you need and buy the processor that design is using plus code ,saves alot of time and learn a new type of coding

Adrenalynn
12-16-2008, 12:47 AM
If you're switching back and forth and all around because you can swipe someone else's code, it just means you don't know how to write code. I think that's the *worst* possible reason for picking a processor. Learn to code and then you can pick what suits the project rather than trying to graft someone else's junk onto your project...

robot maker
12-16-2008, 01:10 AM
no that is not the reason,trying to learn the code from examples and buy using another person circuit and modding the code ,i getting both learning the code and saving time
like battery monitor circuit i made a few changes added more code for a extra input and at the same time learned and save time ,maybe some money,but cost i never care about
this way i learn more into programming because using different processors
why do others post a open source project and circuits,to help others get the project done fairly fast,mostly into building robots ,not to be pro programmer but at the same time learn programming that is hard
using examples is the easy way to program and books


If you're switching back and forth and all around because you can swipe someone else's code, it just means you don't know how to write code. I think that's the *worst* possible reason for picking a processor. Learn to code and then you can pick what suits the project rather than trying to graft someone else's junk onto your project...

Adrenalynn
12-16-2008, 01:13 AM
[edit]

Whatever...

robot maker
12-16-2008, 01:26 AM
i do spend a long time using some else code before i move onto the next project,learn as much about the pic(example) for many months books ,references,examples,learning that program design,then move on to another,mostly only into 2 types AVR and PICS,,they are the only types i like so far and bought many books,started on basic stamp ,now picaxe because of easy to program without a need for programmer and 4 months or more as i learn it and ready for AXON based avr then buy books,get are others examples to design my hand design,but not ready for for about 4-6 months and by that time roborealm will have a module for it
i found out and from advice from the high level programmers at work to learn programming is start with easy designs like first basic stamp,then picaxe,then as i learn go higher
i dont know programming yet still learning,best way is to get others examples from this forum or off the internet and lrearning to code and make changes you learn to make your own code from scratch



[edit]



Whatever...

ScuD
12-16-2008, 06:00 AM
I think there's a big difference between programming and programming.


Embedded programming is 90% knowing what your controller is doing, and 10% knowing what you are doing, imho.

Learning high-level compilers from the get-go is easy, I agree on that. Spitting out a line on a terminal with a pic is like 3 lines in C code.

But say something went wrong. You took the code from some guys example, adapted it, and it doesn't work. Why?

Personally, I hate to get something working without knowing why. Yes, I do reinvent the wheel 99% of the time, but when I get something working I know exactly what my controller is doing, and why.

In no way would I state that I am a good embedded programmer, but -as an exaggerated example- I wouldn't want to fly an airplane without knowing which lever does what.

One could state that I do not need to know aerodynamics nor the actual workings of a jet engine to fly a plane, but hey..


The first thing I do with each chip i get is study the datasheet. Then read some app notes. After that, I might try a simple hello world program. And simulate it. Simulate it some more. See what registers are doing what, and try out the different peripherals on the chip.

Adrenalynn
12-16-2008, 10:01 AM
Pilots are required to learn aerodymaics and the basic workings of the plane. They're also required to do their own walk-arounds even when they have a thousand mechanics that do nothing but repair their model of aircraft maintaining it constantly. So your analogy DOES fly, if you'll excuse the pun.

I would say you're a "good embedded programmer", ScuD. You understand what makes embedded programming work. I'd have to see code before I said you're a "great embedded programmer" ;) but we'll stick with "good" sight-unseen. Any monkey can learn to throw code, understanding ARCHITECTURE is the key to evolution, imho.

robot maker
12-16-2008, 04:12 PM
most projects other make you need to change alot of code,not just a few lines,like the project i got working it took awhile making the code and didnt work till i used the right commands and read more on manual on it,when you buy a protype board they also give you examples.and they are only to help design the code
i seem to like AVR little better now,mostly it looks a little more easy ,like AXON board and adurino/wiring board because mostly of the examples they have to help you learn programming AVR,S and software is free,mostly not into programming mostly it takes alot of time and robot projects i have never get finished,so mostly into designing circuits since that is what i do at work
why sometimes i use opensource projects and never found any to be junk someone said
but only a few projects i use,anything that need a cpu,also to save time is buying off the shelf circuits from trossen and others,unless i can design it cheaper ,like in h-bridge design i made ,same quality as a off self design and fully tested at work,torque,power,heat and less then half the price,same with automatic charging design for gel cells and ni-cads,i just order the circuit board


Pilots are required to learn aerodymaics and the basic workings of the plane. They're also required to do their own walk-arounds even when they have a thousand mechanics that do nothing but repair their model of aircraft maintaining it constantly. So your analogy DOES fly, if you'll excuse the pun.

I would say you're a "good embedded programmer", ScuD. You understand what makes embedded programming work. I'd have to see code before I said you're a "great embedded programmer" ;) but we'll stick with "good" sight-unseen. Any monkey can learn to throw code, understanding ARCHITECTURE is the key to evolution, imho.