Hi folks,
I am about to load some data into a FRAM chip. so I decided to re-familiarise myself with i2c stuff.
So, I made a small program to load a character into an Eeprom at location 00 and then read it back.
It is a new Eeprom, so I expected the contents to all be $FF to start with.
I ran the program and the debug showed that it had read $FF - there were no signs of a write having happened!
Then I ran another program to control a new RTC chip (DS1307).
Indications are similar - there are read results of $FF but no sign of a write happening.
This is my first attempt to use the new Hi2c commands - have I missed something?
I am using a Picaxe14M2 and it programs OK.
I had a quick look on both SDA/SCL lines with a DSO, and the pulses seem to be present.
I tried another Eeprom (a used one) with same result - no change to the read data.
Here is the code used for the Eeprom:
I have double checked all connections and they OK.
The WP pin on the Eeprom is set to 0V (pin 1).
Originally I ran the program from a V5 editor, then swapped over to the V6 on another PC - same result.
Comments?
kenmac
I am about to load some data into a FRAM chip. so I decided to re-familiarise myself with i2c stuff.
So, I made a small program to load a character into an Eeprom at location 00 and then read it back.
It is a new Eeprom, so I expected the contents to all be $FF to start with.
I ran the program and the debug showed that it had read $FF - there were no signs of a write having happened!
Then I ran another program to control a new RTC chip (DS1307).
Indications are similar - there are read results of $FF but no sign of a write happening.
This is my first attempt to use the new Hi2c commands - have I missed something?
I am using a Picaxe14M2 and it programs OK.
I had a quick look on both SDA/SCL lines with a DSO, and the pulses seem to be present.
I tried another Eeprom (a used one) with same result - no change to the read data.
Here is the code used for the Eeprom:
Code:
hi2csetup i2cmaster, %10100000, i2cslow, i2cbyte
write_data:
pause 500
hi2cout 0, ("X")
pause 1000
read_data:
hi2cin 0, (b0)
pause 100
debug b0
The WP pin on the Eeprom is set to 0V (pin 1).
Originally I ran the program from a V5 editor, then swapped over to the V6 on another PC - same result.
Comments?
kenmac