PDA

View Full Version : Saving to EEProm



pjv
11-09-2010, 10:25 PM
Hi All;

A question here on the the Propeller IDE.

I have a Prop program running on a PDB that writes a little data via I2C to that Prop's EEProm in an unused area. Then I wish to save that data to a file on my PC. So I press the F8 key to bring up the program information/hex screen, and push the SAVE_to_EEProm button to initiate the transfer to the PC.

But then when I open the PC file with an editor, the programs are there, but the data I wrote is absent. Yet I know it existed, because I also have a piece of code on that Prop that reads the EEprom and show its contents. So what happens??

Does the Propeller IDE re-compile the application code an save a clean copy, effectively flushing the data I wrote to the EEProm?

I thought others had written to unused sections of the EEProm; but perhaps it cannot be saved to an external PC file using the F8 rendered screen??

If what I am trying is not possible, then what is an easy way to dump Prop generated I2C strings via the PDB (or other) USB connector directly to a file on a PC?

Help ?!

Cheers, (from the PC-illiterate)

Peter (pjv)

hover1
11-09-2010, 10:44 PM
Peter,

The IDE will write to the entire 32K of the EEprom, wiping out anything in the region and re-writing it, and clearing space to 32K, IIRC.

The easiest way out of this predicament, is to throw hardware at it. Replace the 24LC256 with a 24LC512 and write all your stuff above 32K and the IDE will not touch it upon reprogramming.

Jim

Brian Riley
11-09-2010, 10:51 PM
By using the "Save to EEPROM" command you reparsed the program and produced a new program image with all unused spaces zeroed and then wrote it to the EEPROM overlaying the data you wrote in the unused space with zeroes.

The simplest thing to do is to write a program to read the EEPROM and send the data up the serial line to PST and capture and save it that way. The trick is to just Load that data retrieval program to RAM only leaving the initial program and your interleaved data alone untouched in the EEPROM.

The next step would be, since the PDB has the EEPROM socketed would be to pry out the 24LC256 and replace it with a 24LC512 and use the upper half which never gets touched by the bootloader.

If you move this program to a project board, the Parallax Propeller Proto, or Nick's whole family of Propeller Platform boards all come with 24LC512's


cheers ... BBR

John Abshier
11-09-2010, 10:53 PM
> Does the Propeller IDE re-compile the application code an save a clean copy, effectively flushing the data I wrote to the EEProm? Yes

I am not sure what you mean by "I2C strings" You can write the data to the PC using one of the serial objects. With PST you can copy the data and then paste it into you editor of choice and save that file. Some terminal programs have a save to file capability. If you can describe the data you are writing to EEProm, we may have better answers.

John Abshier

pjv
11-09-2010, 11:51 PM
John, Brian and Hover;

Thanks for the responses.

I think I understand what my mis-understanding was..... the button in the F8 window is labeled "Save EEPROM File", and I took that to mean that the IDE would copy the EEProm contents (with my changes as written) to the PC.

But now I understand that the IDE simply copies the code of the IDE to a binary file on the PC and lables it with an ".eeprom" extension. So in fact the EEProm itself is never copied, just what the IDE thought should be in the EEProm is saved to the file.

Or do I still mis-understand my mis-understanding?

Cheers,

Peter (pjv)

hover1
11-10-2010, 12:54 AM
Ah,

I understand the misunderstanding of my misunderstanding of the problem.:lol:

Yes, The F8 "Save EEPROM FILE" does not look at the EEPROM, but just saves the program from the IDE to a binary file to be ready to be loaded to the EEPROM.

Jim





John, Brian and Hover;

Thanks for the responses.

I think I understand what my mis-understanding was..... the button in the F8 window is labeled "Save EEPROM File", and I took that to mean that the IDE would copy the EEProm contents (with my changes as written) to the PC.

But now I understand that the IDE simply copies the code of the IDE to a binary file on the PC and lables it with an ".eeprom" extension. So in fact the EEProm itself is never copied, just what the IDE thought should be in the EEProm is saved to the file.

Or do I still mis-understand my mis-understanding?

Cheers,

Peter (pjv)

kuroneko
11-10-2010, 01:21 AM
I think I understand what my mis-understanding was..... the button in the F8 window is labeled "Save EEPROM File", and I took that to mean that the IDE would copy the EEProm contents (with my changes as written) to the PC.

You should have a look at Phil's unload application (http://forums.parallax.com/attachment.php?attachmentid=72308&d=1281334707) which grabs the EEPROM content from the board and saves it PC-side.

hover1
11-10-2010, 01:59 AM
I also remember a utility from the Hydra Forum, "Hydra Asset Manager":

http://forums.parallax.com/showthread.php?t=91596&highlight=Hydra+Asset+Manager+released

Never used it, but it was supposed to save EEPROM data to the PC side also.

I would try Phil's first, as I don't know if HAM is still supported, and we all know where Phil lives. :)


Jim

pjv
11-11-2010, 03:58 AM
Kuroneko and Hover;

Presently I have no 512 EEProms, so I tried dumping directly to PST, but unfortunately that did not work because the data I wrote to the EEProm is raw binary. Some are interpreted as control characters such as erase screen, line feed etc., and thus not capturable.

I will give Phil's program a go. I'm sure it will do what I want....... thanks Phil!

Cheers,

Peter (pjv)