Program EEPROM using AVRISP Mk II

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

Folks,

Is it possible to program one byte of the EEPROM using the AVRISP Mk II? My client is recompiling his program 32 times for the 32 processors on the system to set the address, which is insane! Would just like to program byte 0 of the EEPROM in each processor with its relevant address once and then he can program all the processors with the same code.

Thanks!

Please note, suggestions of using JTAG or one wire debug are a non-starter as they are not connected up. We only have the SPI style of programming the processor available.

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

No problem with AS4...

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

1) In AVR8 apps, avoid byte 0 if you can. References upon request.
2) Put your "address" (serial number, RFID, whatever) at a known location in EEPROM.
3) When you build the master firmware, do not initialize that location (or locations). Leave them "erased" with a 0xff value in each byte. The firmware can use that to detect "no address set".
4) Then create a .EEP with the desired "address" for that unit. That .EEP should only have information for >>those locations<<.
5) With your ISP system, "Program EEPROM" with the serialized .EEP over the top of the normal ISP.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Thanks, with a load more digging I finally realised that there wasn't a GUI solution where I could just store them from a memory map, so I have created some Intel hex files and stored the address at zero - although it's not a big job to charge it to one! (I've never had issues using address zero with the AVR program itself programming the EEPROM by the way, I'm intrigued as to what the issue is.)

I'd forgotten Studio has that facility to program EEPROM (stopped using it years ago).

It's then easy to get AVRdude to program the EERPOM with the appropriate command. I suppose the one thing I have got to watch for is that whatever is used to program the flash preserves the EEPROM.

I reckon it would be easy to knock up a Qt program to make a GUI read and write EEPROM locations, so I could make a cross-platform application to do this. When I have an idle few moments (like that's going to happen ;~)! ) I shall attempt this.

The firmware will only ever read that one byte, it's a bit of a trivial application really!