Uploading Hex files to external EEPROM using an Arduino

Hardware questions and issues with the FV-1

Moderator: frank

Post Reply
PhilHaw
Posts: 14
Joined: Wed Feb 27, 2013 9:10 am
Location: Northern Ireland
Contact:

Uploading Hex files to external EEPROM using an Arduino

Post by PhilHaw »

Ice-nine and I are working on an FV-1 project at the moment in which we hope to have two external EEPROMs which have their address pins set so that they can be selected by an Arduino Uno. Hopefully this will allow to expand the FV-1 programs to 16.

We have designed a 3.3V <-> 5V bidirectional logic level shifter for the SCL and SDA lines so hopefully this will allow the 3.3V logic FV-1 and the 5V Nano to access the EEPROMs on the I2C bus (not at the same time of course).

We would like to allow users to be able to upload their own FV-1 programs to either or both of the EEPROMs and although we have designed in a programming g interface, we wish to avoid them having to buy a PICkit2 or similar programmer. The idea is to use the USB interface on the Nano to transfer the HEX files from the user's computer to the EEPROM via the Nano.

Does this sound feasible and is it simply a question of writing the HEX file byte by byte to the EEPROM or is there some special protocol needed?

How is the checksum calculated so users could verify their upload is correct?(the PICkit2 does it for example)

Thanks for taking the time to read this long epistle :D

Phil.
slacker
Posts: 116
Joined: Tue Feb 01, 2011 1:13 pm

Post by slacker »

I've done a similar thing with a PIC so it should be possible with a nano , writing the data to the EEPROM is just a case of writing it byte by byte, the datasheet explains how to do it, there's no special protocol it's just I2C, which the nano can do.
The trickier bit for me was getting the hex file to the PIC. I ended up using a USB to serial convertor, which the nano has built in and serial terminal on the PC to send the hex file, this meant no special software was needed. The PIC then stripped out the non data parts of the hex file, converted the format from ASCII to hexadecimal and then wrote it to the EEPROM.
There's probably better ways to do it especially having to convert from ASCII to hex but it worked.
I don't know if I still have the code, I gave up on the idea once I discovered you can write to the EEPROM using a £1 USB to serial cable.
PhilHaw
Posts: 14
Joined: Wed Feb 27, 2013 9:10 am
Location: Northern Ireland
Contact:

Post by PhilHaw »

Thanks slacker. I've been reading the specs of the Intel Hex files so now I understand the format. With limited memory left in the Nano's program space, I'm thinking it would be better to have the PC handle the donkey work of decoding the hex file and then sending it a byte at a time to the Nano which will then write it to the EEPROM.

I've used Processing before to write another app which communicates between the PC and the Nano over the USB/Serial link so I can maybe adapt that after I write (or find/steal) a suitable routine for decoding the hex.

Phil.
Post Reply