Problem with reading, and writing to EEPROM
TC
Posts: 1,019
Hello all,
I am using JonnyMac's EEPROM driver to try to store and read values from the main EEPROM. I have a 64K EEPROM instead of the normal 32K for the prop.
But I have ran into a little problem that I cant figure out why. Here is what I got,
When I run this, my program stops. If I comment out
Thanks
TC
I am using JonnyMac's EEPROM driver to try to store and read values from the main EEPROM. I have a 64K EEPROM instead of the normal 32K for the prop.
But I have ran into a little problem that I cant figure out why. Here is what I got,
OBJ eeprom : "jm_24xx512" PUB eeprom.start(%000) eeprom.rd_block($8010, 10, @param) **** other stuff ****
When I run this, my program stops. If I comment out
eeprom.rd_block($8010, 10, @param)the program works like it should. I cant figure out what is going on, and I was hoping someone could help me figure out what is wrong.
Thanks
TC
spin
5K
Comments
Yes, just as a starter I am only trying to read and write 4 longs starting at address $8010. from my understanding, the prop only uses $0000 to $7FFF for its use. Anything at address $8000 and up the prop does not touch.
If your EEPROM is only 32K then you will in fact be reading from address $0010 -- in the program space. Reading from this space isn't harmful; writing to it can be if you don't know what you're doing.
No, there is no pull up resistor on the SCL line, I followed the schematic in the Propeller datasheet, and the manual. I can add one, have to let iron warm up.
EEPROM I am using is "24LC512".
If that was the case, I don't think the program would freeze just trying to read from any location.
Adding the pull-up on SCL will get things going. I've run into this on Propeller boards I didn't build. Again, the I2C spec is open-drain on SDA and SCL and calls for pull-ups on both. My I2C object expects both lines to be pulled-up.
Mike Green has a nice I2C object that does in fact drive the SCL line high and low.
That was the ticket, Thanks.