> David Van Horn wrote: > > > > I cringe at each bank swap, thinking of the four > > AVR instructions that would have gone there, all to do a port > > operation that is much more complicated (the read-mod-write) than on > > the AVR. But then you'd use those four instructions to do a single bit manipulation. Before this degenerates into a flame war for your favourite uC, I'll confess to being a bit of a microcontroller slut. I'll go with whatever fits the particular job. > I guess it's a difference in how we think, but I found the AVR to be > needlessly complicated in how it implements the 32 GPRs to be totally > non-logical. That is pretty restrictive on the low end parts like the 1200 and the 2313. Maybe inconvenient is a better word than restrictive. > > I would expect that C should be more efficient on the AVR, as it > > seems well designed for it > I think this is where the AVR shines That's what I thought too, but I have tried the experiment a few times and haven't had any results that agree. Here are some numbers for a real embedded application that is in production. The original was done on a 8535. This has multiplexed LEDs, keyboard scanning, beeper frequency generation, SPI peripherals, pin bashed clocked serial comms and some setup info stored in EEPROM. A lot of the code is decoding messages, doing boolean operations on the data and acting accordingly. It's a pretty good benchmark for this range of micro. In the 8535 it took 81% of 4k words and 131 bytes of ram. ($4.10) In a 16F874 it took 60% of 4k words and 123 bytes of ram ($5.15) In a 89C52 it took 54% of 8k bytes and 158 bytes of ram. ($2.33) Add $0.50 for external EEPROM for the 89C52. Prices are US$ retail 100 of. The AVR was compiled with AVR-GCC, the PIC with HiTech-C and the 8052 with Keil-C. Clear winner here is 8x51. Not only is it the best bang for buck but it is multi-sourced and the application can grow to 64k in the same footprint. In very broad, general terms, (and IMHO) PIC ranks the best in peripherals per dollar. The interrupts, combined with the execution speed, make the AVR stand out for some applications. For general push-beep-blink applications, the good old 8051 will still put the most $$ in your back pocket. Then there's the EM for low power, the M16C if you want one of everything, the MPC555 if you want several of everything, the HCxx if you want none of anything and anything Intel if you want your batteries to go flat. There's something out there for everyone. :-) Steve. ====================================================== Steve Baldwin Electronic Product Design TLA Microsystems Ltd Microcontroller Specialists PO Box 15-680, New Lynn http://www.tla.co.nz Auckland, New Zealand ph +64 9 820-2221 email: steveb@tla.co.nz fax +64 9 820-1929 ====================================================== -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu