Shop OBEX P1 Docs P2 Docs Learn Events
BS2px24 & i2c — Parallax Forums

BS2px24 & i2c

AlessandroAlessandro Posts: 26
edited 2008-02-04 16:12 in BASIC Stamp
Hi peolple!

I'm trying to use the Ultrasonic sensor (of Lego Mindstorm nxt) with·Basic Stamp via i2c command.
I'have investigated that·the·I2C·commainds on Basic are too fast for the sensor.

Can I reduce the clock of the i2c command of the Parallax?

Thanks·in advance.

Alessandro (Roma, Italy).·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-04 15:52
    You can't change the clock, but that's not likely to be your problem anyway. All I2C devices must respond to clocks up to 100KHz or they can't be called I2C devices and the Stamps provide a clock of around 80KHz (slower on the BS2pe ... the Basic Manual has details). There must be something else going on. Perhaps you're sending successive I2C commands too quickly. You can put PAUSE statements between the I2C statements.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-04 16:12
    Gents -

    Unless I'm mistaken there is also an issue with I2C NEEDING pull-up resistors. Not having them causes all sorts of problems, but I don't know if what appears as apparent timing problems is among them.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is no pleasure in having nothing to do;
    the fun is in having lots to do, and not doing it!
Sign In or Register to comment.