EmbeddedRelated.com
Forums

PIC versus AVR

Started by mc August 3, 2006
On 2006-08-06, Mikael Ejberg Pedersen <mikael@ejberg.NO_SPAM_HERE.dk> wrote:
> On Sun, 06 Aug 2006 14:58:02 -0000, Grant Edwards <grante@visi.com> > wrote: > >>The big problem I see with the AVR is that only one (or is it >>two) register pairs can be used as a pointer. > > It's actually three register pairs.
That's not as bad as I remembered.
> Though only one of them is able to address the program memory, but > I've never had the need to point to more than one place in program > memory at a time.
That would be pretty rare. -- Grant Edwards grante Yow! ... I'm IMAGINING a at sensuous GIRAFFE, CAVORTING visi.com in the BACK ROOMof a KOSHER DELI --
Grant Edwards wrote:

> Start at yet another end again: why pick an 8-bit architecture > if you're using a language or writing an application that needs > to do a lot of 16-bit operations? Something like an MSP430 > (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes > life easier. I particularly like the H8/300 which provides > atomic read/write of 32-bit variables (long integers and > floats): that eliminates the requirements for a lot of mutexes.
Well the H8/300's max out at 2K RAM (8K for AVR's) 60K FLASH (256K AVR's), requires 50% more power, are physically bigger, have no EEPROM, limited selection, there is a price to pay in die size when you move up to a 16 bit processor which can make your life harder it other aspects, I also seem to remember doing a H8/300 16 bit multiply was slower then a AVR's 16 bit multiply and generally slower in all instructions, so it's not so cut and dry as you imply if you dig into the details. The MSP430's are not cheaper then the AVR's.
"steve" <bungalow_steve@yahoo.com> skrev i meddelandet 
news:1154925894.357276.223680@n13g2000cwa.googlegroups.com...
> Grant Edwards wrote: > >> Start at yet another end again: why pick an 8-bit architecture >> if you're using a language or writing an application that needs >> to do a lot of 16-bit operations? Something like an MSP430 >> (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes >> life easier. I particularly like the H8/300 which provides >> atomic read/write of 32-bit variables (long integers and >> floats): that eliminates the requirements for a lot of mutexes. > > Well the H8/300's max out at 2K RAM (8K for AVR's) 60K FLASH (256K > AVR's), requires 50% more power, are physically bigger, have no > EEPROM, limited selection, there is a price to pay in die size when you > move up to a 16 bit processor which can make your life harder it other > aspects, I also seem to remember doing a H8/300 16 bit multiply was > slower then a AVR's 16 bit multiply and generally slower in all > instructions, so it's not so cut and dry as you imply if you dig into > the details. The MSP430's are not cheaper then the AVR's. >
In the end, I think C friendly means that you rather use a C compiler than assembler to get the job done on the MCU, even for cost critical designs. I find regularily that when I get my hands on customers assembly code to fix problems, I can do a better job with the C compiler. -- Best Regards, Ulf Samuelsson This is intended to be my personal opinion which may, or may not be shared by my employer Atmel Nordic AB
Someone wrote:
>>> You are probably saying that an 8 bit architecture is inherently >>> C-unfriendly.
I think another idea lurking in the background here is that C expects a Von Neumann architecture (same instructions to read from program memory as from data memory) and most micros have Harvard architecture (reading from pgm. and data memory are different kinds of operations). The AVR is like the 8051, PIC, etc., in this respect. Among microcontrollers, the 68HC11 and MSP430 have Von Neumann architecture; almost all larger computers do (Pentium, VAX, etc.). This is the source of the C string storage problem (how to avoid filling up data memory with your string data).
On 2006-08-07, steve <bungalow_steve@yahoo.com> wrote:
> Grant Edwards wrote: > >> Start at yet another end again: why pick an 8-bit architecture >> if you're using a language or writing an application that needs >> to do a lot of 16-bit operations? Something like an MSP430 >> (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes >> life easier. I particularly like the H8/300 which provides >> atomic read/write of 32-bit variables (long integers and >> floats): that eliminates the requirements for a lot of mutexes. > > Well the H8/300's max out at 2K RAM (8K for AVR's)
Odd, I'm using one with 4K, and I evaluated models with 10K.
> 60K FLASH (256K AVR's)
I'm using one with 128K, and evaluated models with 512K.
> requires 50% more power, are physically bigger, have no EEPROM
True.
> limited selection
Don't think so.
> there is a price to pay in die size when you move up to a 16 > bit processor which can make your life harder it other > aspects, I also seem to remember doing a H8/300 16 bit > multiply was slower then a AVR's 16 bit multiply and generally > slower in all instructions, so it's not so cut and dry as you > imply if you dig into the details. The MSP430's are not > cheaper then the AVR's.
You must be getting better prices from your distributor. A few months ago I got quotes and MSP430's came in at $1-$3 cheaper than equivalent AVRs which were quoted at $7-$8. -- Grant Edwards grante Yow! If I am elected no at one will ever have to do visi.com their laundry again!
On 2006-08-06, Ulf Samuelsson <ulf@a-t-m-e-l.com> wrote:
>>> If you start in the other end: How do you make an 8 bit >>> architecture which is C-friendly you may come to a different >>> conclusion. >> >> Start at yet another end again: why pick an 8-bit architecture >> if you're using a language or writing an application that needs >> to do a lot of 16-bit operations? > > It all depends on the relations between the amount of 8 and 16 bit > operations.
True. In an application that does any floating point at all, the ability to do 32-bit operations is a huge advantage. -- Grant Edwards grante Yow! -- I love KATRINKA at because she drives a visi.com PONTIAC. We're going awaynow. I fed the cat.
On 2006-08-07, Grant Edwards <grante@visi.com> wrote:

>> there is a price to pay in die size when you move up to a 16 >> bit processor which can make your life harder it other >> aspects, I also seem to remember doing a H8/300 16 bit >> multiply was slower then a AVR's 16 bit multiply and generally >> slower in all instructions, so it's not so cut and dry as you >> imply if you dig into the details. The MSP430's are not >> cheaper then the AVR's. > > You must be getting better prices from your distributor. A few > months ago I got quotes and MSP430's came in at $1-$3 cheaper > than equivalent AVRs which were quoted at $7-$8.
BTW, the 128K/4K H8 that I'm using now is under $4 in 1K quantities. I couldn't find anything comparable in the AVR product line for less than $7. -- Grant Edwards grante Yow! You should all JUMP at UP AND DOWN for TWO HOURS visi.com while I decide on a NEW CAREER!!
On Monday, in article <12dehcm51jiuv86@corp.supernews.com>
     grante@visi.com "Grant Edwards" wrote:

>On 2006-08-07, steve <bungalow_steve@yahoo.com> wrote: >> Grant Edwards wrote: >> >>> Start at yet another end again: why pick an 8-bit architecture >>> if you're using a language or writing an application that needs >>> to do a lot of 16-bit operations? Something like an MSP430 >>> (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes >>> life easier. I particularly like the H8/300 which provides >>> atomic read/write of 32-bit variables (long integers and >>> floats): that eliminates the requirements for a lot of mutexes. >> >> Well the H8/300's max out at 2K RAM (8K for AVR's) > > >Odd, I'm using one with 4K, and I evaluated models with 10K.
Well if you take the _strictest_ interpretation of H8/300 64k addressing then MOST are limited to 2K of RAM, however most H8 users appear to be using H8/300H or H8/300S or H8/300SX cores with 16M addressing and RAM largest I have seen and evaluated is 32Kb (H8S/2329 and H8S/2378).
>> 60K FLASH (256K AVR's) > >I'm using one with 128K, and evaluated models with 512K.
Yep currently using several with 128kB, have used one with 384Kb and will be evaluating one with 512kB of Flash.
>> requires 50% more power, are physically bigger, have no EEPROM > >True. > >> limited selection > >Don't think so.
I agree with that. ... -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
On 2006-08-07, Paul Carpenter <paul$@pcserviceselectronics.co.uk> wrote:
> grante@visi.com "Grant Edwards" wrote: >>On 2006-08-07, steve <bungalow_steve@yahoo.com> wrote: >>> Grant Edwards wrote: >>> >>>> Start at yet another end again: why pick an 8-bit architecture >>>> if you're using a language or writing an application that needs >>>> to do a lot of 16-bit operations? Something like an MSP430 >>>> (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes >>>> life easier. I particularly like the H8/300 which provides >>>> atomic read/write of 32-bit variables (long integers and >>>> floats): that eliminates the requirements for a lot of mutexes. >>> >>> Well the H8/300's max out at 2K RAM (8K for AVR's) >> >> >>Odd, I'm using one with 4K, and I evaluated models with 10K. > > Well if you take the _strictest_ interpretation of H8/300 64k addressing > then MOST are limited to 2K of RAM,
Ah. You're right. If Steve meant "H8/300" to exclude the "H" "S" etc. models, then those are strictly 16-bit address space parts. I guess when I type "H8/300" I mean to include the whole family.
> however most H8 users appear to be using H8/300H or H8/300S or > H8/300SX cores with 16M addressing and RAM largest I have seen > and evaluated is 32Kb (H8S/2329 and H8S/2378). > >>> 60K FLASH (256K AVR's) >> >>I'm using one with 128K, and evaluated models with 512K.
That's one of the H8/300H varieties (H8/3062).
> Yep currently using several with 128kB, have used one with 384Kb and will > be evaluating one with 512kB of Flash.
>>> requires 50% more power, are physically bigger, have no EEPROM >> >>True. >> >>> limited selection >> >>Don't think so. > > I agree with that.
I just wish some of the parts with CAN interfaces were cheaper. For some reason, the H8 parts with CAN and a decent amount of flash (128K+) are awfully expensive (in the $20 range). What I really want is 128K of flash, 16-24K of RAM, and CAN -- but it costs about half as much to glue something together using a 3062, 32K SRAM, and an external CAN controller. :( -- Grant Edwards grante Yow! I just bought at FLATBUSH from MICKEY visi.com MANTLE!
Grant Edwards wrote:
> On 2006-08-07, steve <bungalow_steve@yahoo.com> wrote: > > Grant Edwards wrote: > > > >> Start at yet another end again: why pick an 8-bit architecture > >> if you're using a language or writing an application that needs > >> to do a lot of 16-bit operations? Something like an MSP430 > >> (16-bit) or H8 (16/32 bit) is cheaper than an AVR, and makes > >> life easier. I particularly like the H8/300 which provides > >> atomic read/write of 32-bit variables (long integers and > >> floats): that eliminates the requirements for a lot of mutexes. > > > > Well the H8/300's max out at 2K RAM (8K for AVR's) > > > Odd, I'm using one with 4K, and I evaluated models with 10K. > > > 60K FLASH (256K AVR's) > > I'm using one with 128K, and evaluated models with 512K.
I assumed you are talking about the "super low power" 1.8V H8/300's which are the only ones that I can see are competitive with the Atmel's AVR's and MSP430's (the super low power H8/300s are still twice as much power, but in the ballpark), but maybe I am wrong, are the 10K and 512K versions 1.8V/super low power ? I don't see any on their website, the low power versions seemed to max out 2K/60K (with 4K in development), but the web site is a maze to look thru, so I could of missed them! Soon as you get into the higher power higher voltage H8/300's, then obviously your out of the AVR/MSP430 territory and moving into the ARM arena
> > > requires 50% more power, are physically bigger, have no EEPROM > > True. > > > limited selection > > Don't think so.
1.8V versions , I think so
> > > there is a price to pay in die size when you move up to a 16 > > bit processor which can make your life harder it other > > aspects, I also seem to remember doing a H8/300 16 bit > > multiply was slower then a AVR's 16 bit multiply and generally > > slower in all instructions, so it's not so cut and dry as you > > imply if you dig into the details. The MSP430's are not > > cheaper then the AVR's. > > You must be getting better prices from your distributor. A few > months ago I got quotes and MSP430's came in at $1-$3 cheaper > than equivalent AVRs which were quoted at $7-$8. >
part numbers please?
> -- > Grant Edwards grante Yow! If I am elected no > at one will ever have to do > visi.com their laundry again!