first let me thanks everybody for the interresting answers. This call for another question: Do you know a good and CHEAP programmer for the ATMEL series of MCU ?? one that support the whole series but more certainly the mid-range including the AT89C55WD ?? Many thanks again André
No sane person would move from one brain-dead cpu, the PIC, to another brain-dead cpu, the 8051. The only possible reason why anyone would want to buy an AT89xxx or any other 8051-based CPU is because they are stuck with two decades of legacy 8051 code, and already have invested in Keil tools (which are vastly expensive, but much better than anything else for the 8051).
Atmel's AVRs are a different family, and a far better choice in every way.
Atmel's AVRISP programmers are simple and reliable, and fairly cheap, but they are only for programming the chips - they don't do debugging. The AVR JTAG debuggers cost a bit more, but are also fine. I don't know the current prices of these things. Olimex used to make cheaper clones of the JTAG debuggers, but I don't think they do so now.
I have mixed opinions on Atmel Studio. Up to version 4, it used Atmel's own IDE, which okay as an editor, but not as powerful as Eclipse, Notepad2, or any good programmers' editor. The debugger worked well enough, as did the simulator and programmer. Versions 5 and 6, however, are based on MS Visual Studio. In my opinion, MSVS is pure bloatware - it is /huge/, even compared to Eclipse, and installs all sorts of bits and pieces that can mess up your system (MS software always does). It is inconsistent with the current trend from most tool vendors (which is to move to Eclipse), stuck in a old-fashioned windows-only world, and generally a bad idea.
Having said that, people do seem to be able to use AS6 as an IDE for development. I have even heard of people who think MSVS is a good IDE. I guess there is no accounting for taste.
Atmel Studio comes with a full gcc toolchain. You can also download command-line versions for the toolchain for Windows or Linux - which is great for people like me with a mixed development environment.
I have no experiences regarding the 8051 architeture in fact I learned electronics about 40 years ago, worked on computer all the rest of my actve live, repairing them at begining, programing communication ( X25, SNA, ..) after, and finaly adminitsrating Unix servers. And BTW electronic changes a lot since last I touch it. But now as retaired.. André
If you are already familiar with PIC and running into code size limitation.= I suggest you go directly into PIC32. The development environment is a b= it more consistent across PIC, than to AVR, MSP or ARM. PIC32 with 512K fl= ash should have plenty of speed and memory to ignore optimizations.
OT - what kind of hideous newsreader did you use to make such a mess of the quoting in that post, " snipped-for-privacy@linnix.info-for.us" ? You've added lots of extra lines, breaking automatic re-formatting.
Anyway, André - if you have never used an 8051, then don't go there now. Make sure you only look at AVR chips from Atmel and not their 8051 series.
I don't think I would look at the PIC32. Yes, it is a Microchip family with a solid CPU (being a MIPS cpu rather than one of their own designs). But it is totally different from the PIC, and there is little to be gained here from the slight similarities in the design environment. The AVR is going to be a lot easier to learn and work with, being a small microcontroller with a lot lower "getting started" barrier.
I think this is good advice, broadly speaking. The 8051 was incredible in its day. Seriously - a nice chip. But it is seriously hampered in accessing external memory as data. Just take a look at what is involved in something as basic as a memcpy() for example.
It is very powerful in bit manipulation, though. So if you don't need much memory for the application and you will be mostly doing single-bit stuff in memory AND on the port pins, then it's not so bad a chip. But in general it has fallen behind what is now readily available.
The ONLY reason I used it was that the Cygnal (oh, yes, SiLabs) C8051F061 provided the only 1Msps 16-bit ADC choice. And the cost of the chip was less than a separate ADC would be for any other processor. And it met my needs. But what a pain pulling the rest of the chip along with that data rate!
While I agree that Atmel's AVRs are the go-to chips for 8-bitters with a nice deep register set and all (no more single #%!$& WREG!), the OP should be aware that they do use a Harvard architecture (separate address spaces for code and data). Not a huge hurdle, and the compilers make it mostly transparent, but something for him to keep in mind.
Yes, it was powerful in its day - but its day was some 30 years ago! For the last 15 years at least, it has only existed because it is popular, and it is only popular because it is popular, not because it is a technically or economically good choice (somewhat like the x86 architecture, or most MS software).
It has a few powerful bit manipulation instructions - that's true enough. But how often do you /really/ need single-instruction bit manipulation? Most alternatives can do the same function in a maximum of three instructions - and they run at least 3 times as quickly. So in its day, features like the bit manipulation instructions were special - but they have long since ceased to be exciting.
Yes, that is the one good reason for using an 8051 - there are some manufacturers who want to take a good chip (typically an analogue chip or a wireless chip) and add a processor core. In those cases, 8051 cores are an easy and cheap solution for the manufacturer - despite the frustration it causes for potential customers - because it is "industry standard". The lowest possible common denominator.
Fortunately, many manufacturers are moving on to the new "industry standard", Cortex-M cores, which are vastly better in every way.
Of course, in 30 years time I'll be complaining about manufacturers that are still using ancient brain-dead Cortex-M3 cores :-)
Yes indeed - the AVR core has a few serious design flaws that make it more annoying that it need be. The separate address spaces is one of them, and the limited pointer registers is another (though that is completely hidden by the compiler). Like any 8-bit or 16-bit device, you run into inconveniences whenever you have to deal with greater than
64K address spaces. All these points you can avoid by jumping to 32-bit Cortex cores.
However, in comparison to a PIC (or 8051), the limitations of the AVR core are very minor - and they are otherwise nice chips.
There are dozens and dozens of cheap eval/demo boards for both of the above. [Don't bother with the MSP430 'X' parts which try to be 20-bit processors -- if you want more than 64K of address space, jump to an ARM part.]
Do not, under any conditions, touch a PIC part the CPU architecture is _amazingly_ awful. 8051 is slightly less painful, but it's still bad compared to an AVR or MSP430. Personally, I think the MSP430 is easier to use than the AVR (especially if you end up doing any assembly language stuff), but the AVR is still good.
ARM Cortex-M for cheap 32-bit.
There are about a half-dozen uC vendors to choose from (NXP, TI/Stellaris, Motorola, Samsung, Toshiba, and so on.).
The above are all available as single-chip solutions (on-chip SRAM and flash). If you want to use external flash and SDRAM (e.g. to run Linux), then I'd go with: * ARM9 or Cortex-A (Atmel, TI, Motorla, etc.)
GCC is avaialable for all the above. Once you've learned how to use gcc and gnu binutils, those skills apply to everything from an AVR/MSP with 8K of flash and 256 bytes of RAM to an IBM system Z "mainframe".
--
Grant Edwards grant.b.edwards Yow! My haircut is totally
at traditional!
gmail.com
I've only looked briefly at the AVR, but I've done a dozen designs with various MSP430 variants. I've used some of the larger flash versions, but never had to use more than about 36K of that program memory. I used the larger chips mostly because the later versions have faster clock rates. The one limitation that I think about most is the limited RAM--- about 10K in the versions I've used. If you need a big buffer to accept interrupt-driven input while you handle the vagaries of SD card write timing, that 10K can seem a bit limited.
If you need big buffers (such as for a camera), it's time to move up to a Cortex M3 or M4. You can start at 64K RAM and go up to 160K without much searching.
And ST. I've been pretty happy with the peripherals and supporting libraries for the STM32 chips.
Yup. 160K RAM hardly gets you started on an OS which wants lots of buffers for ethernet stacks, file system, video and USB drivers. Beagleboards and their kin are good place to start here. I worked in that area for half a year----but I'm really happier down in the Cortex and MSP430 environment.
The main annoyance in the AVR is that it's strictly an 8-bit CPU. It can't really do any 16-bit operations. That would be fine if it had an 8 bit address space, but it's got two different 16-bit address spaces. So, if you need to do anything at all with pointers (and C is designed to use pointers quite a bit) the AVR falls down badly compared to the MSP430 -- which has sixteen 16-bit registers, a single
16-bit address space, and a very elegent, orthogonal instructions set (rather reminiscent of the PDP-11) where any register can be used as a pointer, accumulator, index, whatever.
The old "8-bit" 8080/Z80 and 6800/6502 processors had a 1 or 2 16-bit registers and a couple 16-bit operations specifically to deal with the pointer issue. Unfortuantely, the AVR failed to learn from them and is missing those features -- and it hurts.
I should add that there are a _few_ (very few) Cortex-M parts that have external busses and include SDRAM controllers (NXP has one family), so it is possible to do large-memory stuff with Cortex-M. But, it's far more common to move up to the Cortex-A or the slightly older ARM9 families if you need memory measured in MB rather than KB.
--
Grant Edwards grant.b.edwards Yow! I joined scientology
at at a garage sale!!
gmail.com
Strictly speaking, the AVR also has 16-bit registers (X, Y and Z) made from pairs of 8-bit registers, and it has a few 16-bit operations (such as addiw, subiw and movw). But it would have benefited enormously from a forth pointer register, better addressing modes with these registers, and a few extra instructions (such as 16-bit atomic moves between the SP and a pointer register).
Some Freescale Kinetis (Cortex-M4) parts have external memory buses, IIRC.
Grant Edwards was more dramatic than I would have been, but the 8-bit roots show in all the doubled-up instructions below. A lot of potential pointer problems go away because gcc has inlined the heck out of the code, and much of the parameter passing has vanished (less obvious here than in other snippets, I guess):
unsigned char led, i, w; int mask, val, pwm; // randomize time to next interrupt .. for (i=0, w=0; i < (127/32); i++) // randomly pick a number [31/32 .. 1+1/32) scaled into 8 bits w = w * 2 + random_bit(); a2: 33 0f add r19, r19
The 6800 had a couple of 16-bit registers (the stack pointer and index register, plus, of course the PC), and you do some limited operations on X (load, store, compare, increment, decrement).
On the 6502, OTOH, neither the stack pointer*, or either of the index registers, X and Y, were 16 bit. But 6502 had a few very useful zero-page indirect addressing modes, which allowed using most of the first 256 bytes of memory as a collection of 16-bit index registers.
*The 8-bit stack pointer was possibly the single biggest annoyance on the 6502. Or maybe the lack of a zero-page indirect addressing mode that *didn't* also use X or Y?
If you want low cost, easy to use, the new Atmel AT89LP series are supported by Atmel web programmers.
Or, look at SiLabs C8051F5xx series tool sticks, programming AND Debug for around $20-$30. Or the Zilog Z51F series, you can get going for ~$29, again programming AND debug.
The parts above are all wide Supply, which is rather harder to find in 32 bit variants.
And TSX/TXS... whoever has written lots of SWI handlers will remember those well (including the +1/-1 ...). They lived on the HC11, probably on the 12 (whatever they call that today) to this day.
The 6809 was a huge step forward but did not make it into the future, it came too late (although I learned the trade mostly on it), the 68k came out and changed the game entirely.
Yes. But the 65802 and 65816 did have a full complement of 16-bit registers and operations. The 802 was pin compatible with the 6502.
The 802 is no longer available, but the 816 comes in 2 flavors: MPU or SoC. IMO, the MPU version is overpriced, but the SoC version is pretty reasonable for what it does.
While true, it also postdated the 8080/Z80/6800/6502 (which were variously introduced in 1974-1976) by a decade (the 65816 first shipped in 1984). Nor was it particularly successful, certainly not by comparison to the above four devices, or the more contemporary 68K and 8086 families.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.