Adressing of a 16 Bit EEPROM in Intel Hex or Binary

Last post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!"