storing a few values into upper half of 24LC512 (64kB) EEPROM
StefanL38
Posts: 2,292
Hi,
after a long time I'm working on a project for my father. building a programmable Timer for a 230V-Pump.
Menus on a serial LCD are up and running. Now I want to store the times when to switch on / off the pump
in the upper half of a 24LC512 (64kB) EEPROM.
I tried the HITT_Boot_EEPROM_010.spin-object. And Kyes I2C-engine No luck so far
It's a DIY-Propellerboard with EEPROM wired as in the manual
all three adress-pins connected to ground PIN29 (SDA) with a pullup-resistor
Which I2C-driver do you recommend?
It would be very helpful to have demo-code that shows how to use the methods and also has documentation what the
result should be
Kyes driver has a small circuit showing the SCL-line should have a pullup-resistor too?
How the heck can the propeller-tool work with the EEPROM without a SCL-Pullup but not the drivers?
or does this not matter???
best regards
Stefan
after a long time I'm working on a project for my father. building a programmable Timer for a 230V-Pump.
Menus on a serial LCD are up and running. Now I want to store the times when to switch on / off the pump
in the upper half of a 24LC512 (64kB) EEPROM.
I tried the HITT_Boot_EEPROM_010.spin-object. And Kyes I2C-engine No luck so far
It's a DIY-Propellerboard with EEPROM wired as in the manual
all three adress-pins connected to ground PIN29 (SDA) with a pullup-resistor
Which I2C-driver do you recommend?
It would be very helpful to have demo-code that shows how to use the methods and also has documentation what the
result should be
Kyes driver has a small circuit showing the SCL-line should have a pullup-resistor too?
How the heck can the propeller-tool work with the EEPROM without a SCL-Pullup but not the drivers?
or does this not matter???
best regards
Stefan
Comments
There's a EEPROM datalogging section in the Propeller sticky about the PEK.
The only boards I'm aware of which don't include pull-ups on both data and clock are the Demo Board, The PPDB and jazzed's TetraProp board (though it's not too hard to add a pull-up on the clock on TetraProp).
Some I2C devices can do tricks like clock stretching (or so I've read) which requires a pull-up on the clock line as well as the data.
Give the EEPROM address a name in CON. Start at $8000, increase the address number based on the the number of bytes that may be written to that address.
Make a method that is called GETPREFS so that on boot, it reads any values you want loaded right away.
Make a method that writes a value to the EEPROM a la carte whenever you want to update the stored values
Make a method that writes ALL values to the EEPROM called SETDEFAULTS this is one shot reset to default values
Examples
To test, set a value to Value1, write it to eeprom, then read it back from eeprom.
I trimmed the code and changed some things to make it look more readable...
Here FromRam copies 6000 bytes to eeprom starting at address 33000.
ToRam copies it back...
thank you very much for your answers and code samples.
It turned out to be a variant of murphy's law: ask for software and find the hardware-bug.
It was indeed the missing pullup-resistor on SCL. After adding the PullUp everything works fine now.
best regards
Stefan