To try and gain some understanding of I2C I have been playing with the EEPROM R/W example.
I have made a few small changes to make it easier for me to understand. However, there is one issue I have yet to get to the bottom of.
When reading then writing to my hardware EEPROM the contents are one location out. i.e the "H", "i" instead of being in locations 0 and 1 seem to be in locations 1 and 2. What am I missing ?
Cheers
Stewart
I2C EEPROM
Moderator: Benj
-
- Posts: 116
- Joined: Tue Jul 17, 2012 9:34 am
- Been thanked: 18 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: I2C EEPROM
Hi Stewart,
It looks like your doing everything correct to me so not sure why you are getting these results. What value pull up resistors are you using? Also for interest which specific I2C EEPROM device are you using?
It looks like your doing everything correct to me so not sure why you are getting these results. What value pull up resistors are you using? Also for interest which specific I2C EEPROM device are you using?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 116
- Joined: Tue Jul 17, 2012 9:34 am
- Been thanked: 18 times
- Contact:
Re: I2C EEPROM
Hi Benj,
The pull ups are both 1k, and the EEPROM is a 24C08WP. A0 is tied high, the other address pins low.
Looking with a logic analyser the first data read back is a NULL. Whether this is what was stored, or a misread I don't know.
Cheers
Stewart
The pull ups are both 1k, and the EEPROM is a 24C08WP. A0 is tied high, the other address pins low.
Looking with a logic analyser the first data read back is a NULL. Whether this is what was stored, or a misread I don't know.
Cheers
Stewart
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: I2C EEPROM
Hi Stewart,
Aha think I have spotted the issue. You are setting the internal address using two bytes but the device only has one address byte according to the datasheet. Therefore sending address LSB of 0 is actually writing 0 to the first EE location.
Aha think I have spotted the issue. You are setting the internal address using two bytes but the device only has one address byte according to the datasheet. Therefore sending address LSB of 0 is actually writing 0 to the first EE location.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 116
- Joined: Tue Jul 17, 2012 9:34 am
- Been thanked: 18 times
- Contact:
Re: I2C EEPROM
Ah !
That may well be the answer. I will try modified code tomorrow and let you know if that fixes it.
Many thanks
Stewart
That may well be the answer. I will try modified code tomorrow and let you know if that fixes it.
Many thanks
Stewart
-
- Posts: 116
- Joined: Tue Jul 17, 2012 9:34 am
- Been thanked: 18 times
- Contact: