Posted: Tue Nov 25, 2014 7:40 am Post subject: ATMEGA Vs XMEGA code resource/size demand differences?
Hello all,
I am considering moving from an ATMEGA324PA to a ATXMEGA64D3-AU or ATXMEGA128A3U-AU. I need some additional pins which is why the difference from 48 to 64 pins. I have never worked with the XMEGA, but it seems that is the next gen before getting into the really cool, hi power ARM device (while waiting for MCS to have their next gen product ready).
My question is, does the XMega product require more code space than the ATMEGA - meaning that a 1:1 code space requirement is not the case. ie, the same code [size] used for an ATMEGA, is actually 1.2, 1.5 or larger to make the XMega work in the same manner.
I ask so I know what part number to get to try this our for the first time.
you will not get 1:1.
- the xmega int. table is bigger since it has more interrupts. but you could check out $reduceivr
- the xmega is not complete the same : registers are not in the same address space which means you can not get a pointer to a register. this breaks some code. internally that is solved by using an array for cases where it is required but it requires an extra step.
- the uarts take advantage of the linear architecture of the hardware and so you can use dynamic uarts. but since it requires to pass a channel , it creates more code. this i will change with an avr compatibility option however. it means you loose the dynamic uart, but you get back more space.
- some of the hardware have more registers to setup so that requires code as well.
i would advise to simply test it by changing $regfile to the xmega of choice. while it might need some remarks in your code, it could give a good idea.
xmega are excellent chips. _________________ Mark
Thanks Mark.
It seems from your response, that there is no real need to worry about the allotted code size of 64k on the lower end ATXMEGA64D3-AU. And, it's cheaper!
I will do as you suggest and try it just for experiment. The real big prize is the ARM, but you already know that.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum