Shop OBEX P1 Docs P2 Docs Learn Events
cannot read from EEPROM with EEPROM-i2C-Engine-object — Parallax Forums

cannot read from EEPROM with EEPROM-i2C-Engine-object

Hi,

two years ago I used the EEPROM-I2C-engine-object for a project and in this project it works as expected.
The EEPROM-I2C-Object is from Kwabena W. Agyeman who did a lot of SPIN-coding.

Now I tried to use this object for a new project but it does not work.

The doc inside the object shows pull-up-resistors on the SDA and SCL-pins.
I do not use pull-up-resistors yet.

Now I'm wondering how does the propeller-chip himself manage to communicate with my DIY-propeller-board all the time
but when I use the EEPROM-I2C-enginge-object I only get zeros when reading from the EEPROM?

I tried reading from adress 0 to 1000 and reading from adress 16.000 or 32000 which all should be accessible.

What do you think?
Do I have to change any of the parameters like
  EEPROM_Address        = %1010 ' EEPROM Address for device selection.

  EEPROM_Max_Write_Time = 5     ' EEPROM Max Write Time in milliseconds so that write page and read known when to return false.

  EEPROM_Size           = 65536 ' EEPROM Size in bytes so that read page can properlly prevent wrap arrounds.
  
  EEPROM_Page_Size      = 32    ' EEPROM Page size in bytes so that write page can properlly prevent wrap arrounds.


best regards

Stefan

Comments

  • You have to have pull-ups on at least SDA. Most Propeller I2C drivers can work without a pull-up on SCL by driving the SCL line both high and low (rather than relying on the pull-up to provide the high signal). The bootloader's routine in ROM also expects a pull-up on SDA. If your boards worked without one, you were somehow lucky.
  • Hello Mike,

    You are right. I did not remember that my DIY-propeller-board had a pullup-resistor on SDA.
    After adding a Pull-up-resistor to the SCL-Line the EEPROM-read-write works fine.

    Thank you very much for your answer. If you haven't received a medal for very very long forum-support I suggest parallax should create one. (Or maybe a special designed Award-PCB with your favorite µControllerS on it?)

    I tried some other I2C-objects from the OBEX. Chris Gadd wrote an I2C-object with demo-code that checks the SDA and SCL-Line for Pullup-resistors. Very good idea Chris. You should be honored too.


    best regards

    Stefan
  • StefanL38 wrote: »
    Hello Mike,

    You are right. I did not remember that my DIY-propeller-board had a pullup-resistor on SDA.
    After adding a Pull-up-resistor to the SCL-Line the EEPROM-read-write works fine.

    Thank you very much for your answer. If you haven't received a medal for very very long forum-support I suggest parallax should create one. (Or maybe a special designed Award-PCB with your favorite µControllerS on it?)

    I tried some other I2C-objects from the OBEX. Chris Gadd wrote an I2C-object with demo-code that checks the SDA and SCL-Line for Pullup-resistors. Very good idea Chris. You should be honored too.

    best regards

    Stefan

    Mike has permanent recognition via the wayback machine:

    https://web.archive.org/web/20130514172417/http://www.parallax.com/Company/ParallaxContributors/tabid/696/Default.aspx

    I always donate to them every year so I can find info on parts from companies that have gone out of business. I encourage forum members to do the same.



  • Publison wrote: »
    Mike has permanent recognition via the wayback machine:

    https://web.archive.org/web/20130514172417/http://www.parallax.com/Company/ParallaxContributors/tabid/696/Default.aspx

    I always donate to them every year so I can find info on parts from companies that have gone out of business. I encourage forum members to do the same.

    Hey, there's another familiar looking guy on that page......

  • PublisonPublison Posts: 12,366
    edited 2017-05-16 22:49
    Wayback Machine getting the Webby Award.

    https://archive.org/details/youtube-XQNivSX2RIY?start=105

    Please donate. It preserves old Parallax sites too! :)
  • Publison wrote: »
    Mike has permanent recognition via the wayback machine:

    https://web.archive.org/web/20130514172417/http://www.parallax.com/Company/ParallaxContributors/tabid/696/Default.aspx

    I always donate to them every year so I can find info on parts from companies that have gone out of business. I encourage forum members to do the same.

    Hey, there's another familiar looking guy on that page......

    And a rather handsome guy at that! :)

Sign In or Register to comment.