Hello there!
I am using a 16F84A @ 4Mhz XT with a 24LC16B, 4.7K Res. on SDA, SCL.
All A0 A1 A2 to GND, WP is on GND
My aim is to write Variable Bytes into the 24LC16B and then have the ability to retrieve them from random locations within the EEPROM.
Being a beginner with EEPROMS, I have used the examples given by Les Johnson 'Experimenting with PICBasicPro' then I have modified the code, but with little results. If anyone has any tips or pointers, it would be much appreciated.
I have read and re-read and studied the wretched data sheets for the 24LC16B, the diagrams showing it requires these to Write: 'Control Byte' + 'Word Address' + 'Data'
That all makes sense, however when I change the 'Word Address' to 'Byte Address', it starts working with the first 10 locations on the eeprom and any subsequent writes from 11 and on are not OK neither can I read them back correctly... or am I just illiterate with the data sheets????
I can read back "Hello World" only.
I've attached the TXT file with the Code.
I understand that to do random read it has to do a 'Control Byte' Write and then do a 'Control Byte' Read, this is so the internal address pointer is in the right direction, - but using the i2c commands, is this feasible?
Would you do a i2cwrite with a blank variable then switch to a i2cread??
If anything is unclear, let me know, so I can try and explain it better.
Cheers
From the Land down under
AP
Bookmarks