Shop OBEX P1 Docs P2 Docs Learn Events
Problem with EEPROM (24LC128) — Parallax Forums

Problem with EEPROM (24LC128)

MacGeek117MacGeek117 Posts: 747
edited 2007-02-19 02:46 in General Discussion
I've been trying to write/read to an EEPROM with this program, but nothing is working. Does anyone have any suggestions?
RoboGeek

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"I reject your reality and subsitute my own!"

Adam Savage, Mythbusters
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.startrek.com


Post Edited (RoboGeek) : 2/17/2007 9:19:52 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2007-02-17 23:20
    To read from I2C you need to start with a write command then issue another start condition. I know it's screwy, but that is how all I2C device work.
    _READ:
     ADDR_MSB = __PARAM1
     ADDR_LSB = __PARAM2
     I2CSTART SDA
     I2CSEND SDA, STARTWRITE
     I2CSEND SDA, ADDR_MSB
     I2CSEND SDA, ADDR_LSB
     I2CSTART SDA
     I2CSEND SDA, STARTREAD
     I2CRECV SDA, TEMP, ACK
     I2CSTOP SDA
     RETURN
    


    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-02-17 23:37
    I tried the fix-no cigar. I even flipped the HIGH-LOW commands, but again, nothing. I don't understand whats happenning(or not happenning!).

    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
  • BeanBean Posts: 8,129
    edited 2007-02-18 01:30
    I think you have your read and write codes swapped.
    Read is %1010001 and write is %10100000

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-02-18 02:01
    thank you for all your help, but it still doesn't work. I truly don't understand!
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
  • BeanBean Posts: 8,129
    edited 2007-02-18 02:05
    Your _READ routine must end with "RETURN TEMP" instead of just "RETURN".

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-02-18 02:14
    If you know something I don't , please tell, because it stil won't work. I thing·I've been working with the Prop too long, because I don't remember·some of the quirks of SX/B,·and I sure haven't used I2C untill now.·Here's the new revision.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
  • BeanBean Posts: 8,129
    edited 2007-02-18 13:06
    Do you have pull-ups on the SDA and SCL lines ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-02-18 22:22
    Thank you, Bean!!! It works!!! I completely forgot about the pull-ups.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
    ·
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-02-18 23:26
    Please guys, allow me one comment on this thread:

    I think all of you agree with me that Bean is one of the best "bug detectives" here in the forum. Nevertheless, it would save Bean's and other helpers a lot of time (but also the time of a "problem poster") when you post your problem together with the program code in question, but also a schematic showing the SX and its hardware environment.

    Typically, microcontroller applications consist of hardware and software, so it helps a lot giving problem support when both parts can be inspected right away. I'm sure that Bean (or someone else) would have been able to figure out the missing pull-ups right on your first post when you had attached the code and the schematic together with it. Without this, it took some "ping-pong" posts, plus some (very professional) guesswork from Bean to figure out the problem.

    Please get me right - this is constructive criticism only, but I think it is a good example for new (and maybe old) forum members how to optimize their requests, and how to get exactly the hint they need to fix a problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • BeanBean Posts: 8,129
    edited 2007-02-19 00:51
    RoboGeek
    Your welcome.

    And to Guenther's point, I'm reminded of a saying, "A problem well defined is a problem half solved".
    The forum member's are good, but the more information you provide the better chance that your problem will be solved.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-02-19 02:46
    Good point. If you want it, here is the schematic. Again, thank you for all your help!
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
Sign In or Register to comment.