16f84a + 24lc16b Eeprom


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31

    Smile 16f84a + 24lc16b Eeprom

    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
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31


    Did you find this post helpful? Yes | No

    Post Experimenting

    Well after much experimentation (putting a ZIF socket thru its paces)
    **my programmer and hobby testbed are two different things. I endavour to put a programmer connection on my testbed eventually, when my little spare time allows**
    i tried a 24lc256, and yes it does use a word address. Works well, or at least it appears that way.

    But leaving the code 'as is' leaves the last character of line 1 in the variable E_Byteout, and it displays this last character in the second line address range.

    So...I put together the whole thing in one line and write it (address = 0 to 18), then next read out the text on two seperate lines.(address = 0 to 10 and 11 to 18)

    My 2 questions are:
    Why can't I put 2x "Lookup" one after the other like I have in the example.
    Why won't the EEPROM record anything if I use the FOR and NEXT command to insert the address word say from 18 to 36?

    Many thanks

    AP

    **Oh one last thing. Sentence in the first section needs clarifying. My aim is not to write variable bytes into the EEPROM...instead i should be going along the lines of 'wanting to write character strings into it and then retrieving them from alternate locations' :-)
    Last edited by exelanoz; - 28th February 2006 at 10:42.

  3. #3
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31


    Did you find this post helpful? Yes | No

    Talking It's Working! Don't *Clap* just throw Money!

    Hehe Super Duper! It's Working!

    Finally i've got it all worked out.
    As they say "more than one way to skin a cat", - sorry, I mean no offence to any animal lovers. (I love my beautiful pet fishes)

    I had problem writing to different memory locations on a 24LC16.

    Like write:

    "Fish" to 0 to 3 (locations)

    after that put

    "plant" to 20 to 25 (locations)

    All good now. It was a simple fix.

    AP


    I would love to see some replies to any future posts...over 50 views and no reponse? What little I know is self taught, so expect to see some ridiculous code from me:-) and don't laugh.
    "Never under estimate the powers of an idiot"

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  4. Need Help Plz. on chip Eeprom 16F84A
    By cesarman in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2006, 00:53
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts