Need to write HEX file to EEPROM
GICU812
Posts: 289
I need to program an EEPROM, all I have on hand is a stamp, unless someone can tell me how to build a simple circuit to program it directly from PC.
Now I can write data to a specific address manually from the stamp debug, I know enough to do that, but with 16000 locations, that could be tedious.
Heres a short sample of my file
:100000002649C3002A2600002664C5002A240000D1
:10001000266CC5002668C5002633C3002670C500BF
:100020002623002927C3FD13B60013005D1301C466
:100030001304381305002A001300591301C51304D3
:10004000461305002A001300431301C5130454137B
:10000000 - is the address
26 49 C3 00 2A 26 00 00 26 64 C5 00 2A 24 00 00 - is the first 16 bytes of information
D1 - I think is a checksum.
So I need to strip the address and checksum and write the data to EEPROM. I could probably parse the data myself and ditch the address and checksum before I send it to the stamp if needed. So the file would just be 16000 sequential Hex values.
I would think there was an easy way of doing this, I just dont know what it is. Any suggestions?
Im also open to just building a simple programmer if someone knows of software that will do this for me.
Thanks
·
Now I can write data to a specific address manually from the stamp debug, I know enough to do that, but with 16000 locations, that could be tedious.
Heres a short sample of my file
:100000002649C3002A2600002664C5002A240000D1
:10001000266CC5002668C5002633C3002670C500BF
:100020002623002927C3FD13B60013005D1301C466
:100030001304381305002A001300591301C51304D3
:10004000461305002A001300431301C5130454137B
:10000000 - is the address
26 49 C3 00 2A 26 00 00 26 64 C5 00 2A 24 00 00 - is the first 16 bytes of information
D1 - I think is a checksum.
So I need to strip the address and checksum and write the data to EEPROM. I could probably parse the data myself and ditch the address and checksum before I send it to the stamp if needed. So the file would just be 16000 sequential Hex values.
I would think there was an easy way of doing this, I just dont know what it is. Any suggestions?
Im also open to just building a simple programmer if someone knows of software that will do this for me.
Thanks
·
Comments
Be sure to download the sample programs for the column.
Post Edited (Mike Green) : 9/15/2008 2:36:46 AM GMT
You can read in one of these lines with a single SERIN like
SERIN ioPin,Baud,[noparse][[/noparse]WAIT(":"),hex2 ignore,hex4 addr,hex2 ignore,hex2 d(0),hex2 d(1),hex2 d(2),hex2 d(3),hex2 d(4),...,hex2 d(15)]
All 16 items need to be on one long line. "ignore" is a byte that is ignored. "addr" is the address to be written. "d" is a 16 byte array
of values to be written to the EEPROM. The checksum is ignored and provides a little padding for the PC to react to the handshaking
lines (not shown here ... again ... read the SERIN chapter in the manual).
Ive written an eraser, I can set the EEPROM to all 255, or whatever I want, one byte at a time. Thats a start, but I dont know if there is a way to access a file, or I could even paste one line at a time into the debug window. Mike, im reading your last message, it might be what·I need.
Post Edited (GICU812) : 9/15/2008 2:50:14 AM GMT
So for now Im off to look for terminal emulator that will work
Jeff T.
You may be one step ahead of yourself. There are HEX text editors (HexEdit comes to mind). Write the data on the PC, file it, and then transmit it serially to a Stamp bytewise so that it may then write it to your EEPROM.
Just out of curiosity, are you trying to reverse engineer something? If so, there may be other methods less prone to possible typographical or transcription errors.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON
I am not reverse engineering anything,·it evolved from tests that involved reading tokenized code from an EEPROM and using the code to program a remote BS2·hard wired or wireless using the same checksum routines that the Stamp IDE uses.
This may not be the requirement of GICU812 but the program could achieve his goal, or maybe not.·The offer was intended as an alternative to consider. My problem right now is retrieving the programs from the hard drive in a dead PC, but that is not too big a deal.
Thanks for showing interest Bruce I hope my explanation was clear.
Jeff T.
The Stache Programmer may or may not hold some general interest for you:
http://www.emesystems.com/products.htm#Stache
Regards,
Bruce Battes
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Involvement and committment can be best understood by looking at a plate of ham and eggs. The chicken was involved, but the pig was committed. ANON