Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATMEGA Vs XMEGA code resource/size demand differences?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
TSEYFARTH

Bascom Member



Joined: 01 Jul 2006
Posts: 1048

usa.gif
PostPosted: Tue Nov 25, 2014 7:40 am    Post subject: ATMEGA Vs XMEGA code resource/size demand differences? Reply with quote

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.

All feedback would be appreciated!
Thank you,
Tim

(BASCOM-AVR version : 2.0.7.7 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5093
Location: Holland

blank.gif
PostPosted: Tue Nov 25, 2014 9:57 am    Post subject: Reply with quote

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
Back to top
View user's profile Visit poster's website
TSEYFARTH

Bascom Member



Joined: 01 Jul 2006
Posts: 1048

usa.gif
PostPosted: Tue Nov 25, 2014 5:51 pm    Post subject: Reply with quote

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.

Tim
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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