Tamas Rudnai escreveu: > (added AVR and PIC tag -- I think it will be more like PIC vs. AVR story = :-)) > > = >> ---------- Forwarded message ---------- >> From: Isaac Marino Bavaresco >> Date: Sat, Oct 31, 2009 at 2:21 PM >> Subject: AVR Xmega >> To: "Microcontroller discussion list - Public." >> >> >> These days I was studying the AVR Xmega MCUs for prospective use in a >> new product. When I learned their capabilities I freaked out! >> >> The facts I found more important: >> a) 8-bit MCU approaching 32MIPS @ 32MHz. >> b) Internal RAM from 2KB up to 32KB and flash from 16KB up to 384KB. >> c) Packages of 44 (34 I/Os), 64 (50 I/Os) and 100 pins (78 I/Os) availab= le. >> d) The 100 pins versions have external memory interface, supporting up >> to 16MB of SRAM and 128MB of SDRAM!!! >> e) 4 DMA channels capable of transferring between any combination of >> RAM/port/peripheral and the most amazing: external DMA requests availabl= e! >> f) Any I/O pin may generate interrupts. >> g) Operation from 1.6V up to 3.6V. >> h) 5, 7 or 8 USARTS; 5, 7 or 8 16-bit TIMERS; 16, 22 or 24 PWMs; 2, 3 or >> 4 SPI; 2 or 4 TWI; 12 or 16 12-bit A/D inputs; 2 or 4 12-bit D/A outputs. >> i) Hardware crypto-engine with DES and AES support. >> j) As all AVRs, every interrupt has its own vector. >> >> Prices from $4.30 up to $9.68 per unit and from $2.40 up to $5.40 per >> unit in lots of 100. >> >> If only they had USB or Ethernet as options they would be perfect! >> >> For a previous project I needed a MCU with external DMA request and the >> only I found was a Samsung ARM9 (very hard to obtain, including >> documentation). I ended up with an Atmel ARM9 without external DMA >> request but with an image sensor interface. >> >> Some time ago someone asked for a MCU with image capture capabilities. >> One of these Xmega with external RAM and this external DMA request may >> be able to capture from a CCD without any support chip. It is a pity >> they are only 8 bits. >> >> Another great thing is that development tools are free: WinAVR (gcc) and >> for programming any JTAG device supported by AVRDUDE will work. The down >> is that debuggers are expensive (around $600). >> >> Isaac >> __________________________________________________ >> >> = > > First of all, as you may know MIPS also known as Meaningless Indicator > of Processor Speed. Meaningless as it does not reflect what can you do > in 1 instruction. For example in AVR architecture you just cannot use > arithmetic or logic instructions on RAM locations. AVR is a register > based architecture, so you first need to load the RAM location to a > register to do something with that and store it afterwards, Secondy > which is even more strange in AVR is that you cannot use all available > registers for all instructions, for bit manipulations for example you > need to load the RAM location and even certain register location into > = Fortunately there are high-level languages to hide such things from the programmer. > a specific register region to do that. As a results AVR sometimes even > slower than PIC (LDS takes 2 cycles, SBR is 1 only, SBS 2 cycles > again, which is 5 cycles -- for PIC the same you need only 1 > instruction that takes 1 cycle which is 4 OSC). This is an extreme > example I know, but the typical speed ration is around 2:1 so the AVR > could be still faster by consuming 4 times more current. > = Although not 4x faster for the same clock as some may think, but it is still faster. After you account for some inefficiency in its instruction set, it is still perhaps 2x faster per MHz. > There are many nice thing in AVR though ,but GCC and WinAVR is not > really one of them. The compiled code is just acceptable, if you want > to achieve better performance you need to use weird attributes and > even then it makes weird stuff like you want to put a variable on a > specific register (to avoid this LDS-STS issue), and for example if > you load it's value from PORTB then it first loads into another > register and then moves that register into yours. > = Idiosyncrasies apart, GCC is free and as you said, its code is acceptable. There are better compilers around if one is willing to spend some $$$. > Honestly I think that for prices $2-$5 / unit you can get the 16bit > PIC (PIC24 or dsPIC) which are 32MHz/16MIPS or even 80MHz/40MIPS but > with PIC architecture so overall it is faster than 8 bit AVR for sure. > Also you can get one with USB module, 32bit timer, 16bit PWM etc... > = As I said in the original post, I regret they don't having USB or Ethernet. Of course a dsPIC is faster, but I have a product which uses a dsPIC, SRAM and PLD to capture images from a CCD and send them encrypted by Ethernet, and I think that one of these Xmega may perform faster because of the DMA and the crypto-engine and I wouldn't even need the PLD. My external SRAM (512KiB) is loosely coupled to the dsPIC, so I can't use it as ordinary RAM for variables and my frame buffer doesn't use it all. I have more that 100KiB of unused RAM that I can't use in an efficient way. With one of those Xmega I could just use it as ordinary RAM. What dsPIC would allow you to add processor speed (S/SD)RAM in a glue-less way? > BTW for AVR there is a debugger/programmer similar to PICkit2 which is > called AVR Dragon. It is around $50: > > http://www.atmel.com/dyn/products/view_detail.asp?ref=3D&FileName=3DAVRDr= agon_9_18.html&Family_id=3D607 > > Tamas > = Even better! Best regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist