Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: u0607843 on January 19, 2009, 12:54:09 AM

Title: Question on Axon flash memory
Post by: u0607843 on January 19, 2009, 12:54:09 AM
Hi all,

This is my first time building a robot, and I would like to consider using the Axon microcontroller as a platform for making my first robot.

I'm reading that the Axon uses a ATmega640, which has a flash memory of 64kB, but when I see the Axon Test Program 1 sample program, it's a hex file of 68.8kB which is more than the 64kB maximum? In that case, how does it work?

I'm quite new to these stuff so my knowledge is still grossly insufficient to understand how things work exactly, hence I would like to seek enlightenment on this issue.

Thanks!
Title: Re: Question on Axon flash memory
Post by: Admin on January 19, 2009, 05:25:40 AM
When you compile your Axon code it will report memory usage for you in AVR Studio.

See Step 8:
http://www.societyofrobots.com/axon/axon_getting_started_software.shtml


I've wondered myself why it takes a lot more memory to store on a PC, but I'm sure someone can enlighten us! My guess is that it stores more information than that which is loaded onto the mcu, perhaps uploader instructions or something.
Title: Re: Question on Axon flash memory
Post by: Tomas on January 19, 2009, 07:57:53 AM
Is it 64kb or 64kB? Big difference. It is written 64kb in the comparison chart on the axon-page here (perhaps fix if wrong admin?)
Title: Re: Question on Axon flash memory
Post by: u0607843 on January 20, 2009, 02:24:48 AM
Thanks for the replies!
Title: Re: Question on Axon flash memory
Post by: Webbot on January 20, 2009, 06:03:31 AM
I've wondered myself why it takes a lot more memory to store on a PC, but I'm sure someone can enlighten us!

A hex file is actually stored as text. What will become a single byte in the processor is stored as a 2 digit number from '00' to 'FF' - so requires two bytes in the file. The file is also split into lines: and each line has a memory address at the start and a carriage return+line feed at the end. So all these extra packaging characters are only used in the hex file, not in the microcontroller.

Hex files are therefore quite bloated.