I would like to edit a DAT block with numbers in it, during run time. The numbers are a string. Then reboot, using the new numbers. Is this possible at all?
donde
Mike, I can't use the 12C for using the PropModule and has both SCL and SDA pulled up with 10K. And I guess I don't want to cut the trace. And, I really don't know how to use the 12C driver. Is there any other simple way to address the EEPROM and change the data numbers, during run time, and then reboot (re-compile)? I know the address of the data numbers on the EEPROM, using View Info.
donde
As the EEPROM is an I2C-device you have to use any kind of code doing the bitbanging according to the I2C-specs.
Only other way I can think of (VERY crippled way to do it):
keep the prop connected to your PC send the numbers you want to change to the PC
comunicate between the terminalprogram and propellertool to paste the new numbers into sourcecode
and load up to propeller-chip again. Like already mentioned very crippled way to do so.
donde said...
Mike, I can't use the 12C for using the PropModule and has both SCL and SDA pulled up with 10K. And I guess I don't want to cut the trace.
If you can't use the I2C due to a pair of pull up resistors, then how does the Propeller load it's program when you start it up?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
No, the pullups are there. That's not the point. The Basic12C Object info says they should not be there. But, reading further, I see it says most of the time pullups can be left connected, especially for the type EEPROM used with the Propeller Demo or PropModule. So, I'm going to go ahead and use the Basic 12C Object to do what what my question was.
donde
I don't see how the pull-ups could hurt. The danger with basicI2C is if the other device clock-stretches since basicI2C drives the clock line low AND high and if another device holds the line low when the Prop goes on it's merry way and flips the line high then you have a short. That is not the case for the EEPROM. Really BasicI2C is dead simple to use.
As I am unclear as to how your program is setup to operate, if you are just trying to store values to and from EEPROM, a possibly easier way to do it (if the DAT section is not required) is this: Memory Storage Management. It acts like a simple database system to store and recall values from the EEPROM. The first time you run the program, you could have the DAT values stored to the database, then after they are stored, they can just be accessed from the database directly (even after reboot). All the storage protocols are worked out for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Bobb
Thanks for your idea to use Memory Storage Management object. My program has to use the DAT block. I only need to write 5 numbers as a string to the EEPROM. The numbers replace what was there before. I know the start address of the EEPROM where the numbers reside. This only happens upon my request, and very infrequently.
So, I think I'll first try the Basic 12C object, and see what happens.
donde
I was just looking at some old posts about this issue earlier today. It's been done, and it's well described. I got some good ideas and a download from a thread called "EEPROM Datalogging and I2C" from 9/07.
Comments
-Phil
donde
Only other way I can think of (VERY crippled way to do it):
keep the prop connected to your PC send the numbers you want to change to the PC
comunicate between the terminalprogram and propellertool to paste the new numbers into sourcecode
and load up to propeller-chip again. Like already mentioned very crippled way to do so.
best regards
Stefan
If you can't use the I2C due to a pair of pull up resistors, then how does the Propeller load it's program when you start it up?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
donde
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!
Some of my objects:
MCP3X08/4 ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't make strings the bane of the Propeller, bend them to your will!
Thanks for your idea to use Memory Storage Management object. My program has to use the DAT block. I only need to write 5 numbers as a string to the EEPROM. The numbers replace what was there before. I know the start address of the EEPROM where the numbers reside. This only happens upon my request, and very infrequently.
So, I think I'll first try the Basic 12C object, and see what happens.
donde
http://forums.parallax.com/forums/default.aspx?f=25&m=219237
It's actually part of a sticky thread about Education Kits at the top of the forum.
Jim C.