Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Skwit
PostPosted: Aug 02, 2011 - 10:51 AM
Wannabe


Joined: Jun 21, 2002
Posts: 92
Location: Hilden, Germany

Hi,

I'm confused. I have an Atmel 16 Bit EEPROM connected to my AP7000 processor. I want to insert a test pattern into the EEPROM: The first two sectors, from 0x0000 to 0x1FFF should contain a test pattern, let's say a repeated 0x0102. The file will be flashed via avr32program.

I generate my Intel Hex or Binary file using srec_cat. I get a file, where on address 0x0000 is the 0x01 and on address 0x0001 is the 0x02. This is wrong. I want 0x0102 to be on 0x0000, because it's a 16 bit eeprom. How do I tell this my .hex or my .binary file?

kind regards,
Christian

_________________
"It compiles! Ship it!"
 
 View user's profile Send private message  
Reply with quote Back to top
david.prentice
PostPosted: Aug 02, 2011 - 11:10 AM
10k+ Postman


Joined: Feb 12, 2005
Posts: 20437
Location: Wormshill, England

If you want to use Intel Hex format, you can only use 8-bit addressing.

It is common with 16 bit eeproms like a 93C46 to store the data in bigendian fashion. e.g. address 0x0000 holds 0x01, address 0x0001 holds 0x02.

The '16-bit' byte address is 0, 2, 4, 6, 8 ....
Simply use (byte_address>>1) to obtain the word address.

If you are determined to use a 16-bit format, use Google. However Intel Hex is accepted by every programmer invented.

Look at the 'flash.hex' when you read the contents of your AVR32 to Intel Hex format file. Can you recognise the AVR32 opcodes?

David.
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Skwit
PostPosted: Aug 02, 2011 - 04:19 PM
Wannabe


Joined: Jun 21, 2002
Posts: 92
Location: Hilden, Germany

Quote:
It is common with 16 bit eeproms like a 93C46 to store the data in bigendian fashion. e.g. address 0x0000 holds 0x01, address 0x0001 holds 0x02.


So if I have an EEPROM with an 16bit address range from 0x00000 to 0x3FFFFF I have to double the address range in my Hex file? In my Intel Hex or Binary-File the range will then go from 0x00000 to 0x800000?

kind regards,
Christian

kind regards,
Christian

_________________
"It compiles! Ship it!"
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits