Shop OBEX P1 Docs P2 Docs Learn Events
I2C EEPROM Help — Parallax Forums

I2C EEPROM Help

train nuttrain nut Posts: 70
edited 2009-07-02 21:25 in General Discussion
Bean

I am relatively new to SX.· I have a SX48 protoboard that I have sucessfully programmed some functions that work.· The problem I'm having is I can't get I2C EEprom working. All I get back is garbage. I've attached file of how I2C is connected and the program file.· Hope its something simple.

I am running at 75MHz because this will eventually be a data acquisition program.

Ben

Post Edited By Moderator (Bean (Hitt Consulting)) : 7/2/2009 11:15:31 AM GMT

Comments

  • PJMontyPJMonty Posts: 983
    edited 2009-07-02 05:58
    Ben,

    Add a subject to this thread to get more people to read it. In general, never post without a subject as those threads often get ignored.

    Thanks,
    PeterM
  • BeanBean Posts: 8,129
    edited 2009-07-02 11:12
    Do you really want the I2CSPEED to be 0.01 ?
    That might cause a problem at high clock speeds.
    Try removing that line.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Money is not that important....In the grand scheme of things.

    ·
  • JonnyMacJonnyMac Posts: 9,412
    edited 2009-07-02 16:45
    I would avoid using locals, too, as this adds processing overhead and time to do things. You can change I2C_IN to this:

    FUNC I2C_IN
      ackNak = __PARAM1.0
      I2CRECV SDA, __PARAM1, ackNak
      ENDFUNC
    


    ... and if you make "flags" the first byte in your variable list it will be global, even in the SX48.

    And I agree with Bean; based on the spec sheet lowest I2CSPEED setting you can legally use is 0.125 (~400kHz) -- I think you missed a decimal point.

    Post Edited (JonnyMac) : 7/2/2009 4:52:43 PM GMT
  • train nuttrain nut Posts: 70
    edited 2009-07-02 18:19
    I took out the I2CSPEED but I still get garbage.

    I was using locals to keep from using all my variable space but will try taking local out of I2CRead.

    Sorry about no subject as this is my first post.

    ·Thanks for the help so far.

    Ben
  • JonnyMacJonnyMac Posts: 9,412
    edited 2009-07-02 21:25
    SX/B has other tricks up it's sleeve that help preserve normal program variables. Have a look at the program that's attached.
Sign In or Register to comment.