Shop OBEX P1 Docs P2 Docs Learn Events
Tachyon I2C Device Discovery for P1 — Parallax Forums

Tachyon I2C Device Discovery for P1

I am fascinated and confounded by Tachyon i2c device discovery for the P1.

I compiled and loaded the EEPROM with Tachyon 5.7 on my target device. I loaded EXTEND.FTH. I entered ^C to reset the device. I looked at the i2c devices that it found. Entering ?? or lsi2c will also display the i2c devices that it finds. I think that's pretty cool.

I got mixed results. Not surprisingly, it did not identify all the devices, it missed a few devices and it listed some devices as "unknown."

It listed this devices as unknown:
LSM9DS1 Mag (ST Microelectronics)

It misidentified this as an RTC:
LSM9DS1 Accel/Gyro (ST Microelectronics)

It completely missed the existence of these:
MAX7312 16-Port IO Expander (Maxim)
RS5C372A/B Real Time Clock (RICOH)
MPL31A2 Altimeter/Barometer (NXP Semiconductors)

In looking at EXTEND.FTH, the pri i2c$ method, that searches for i2c devices simply addresses the device and looks for an acknowledgement bit. It then uses SWITCH to locate the device name by the i2c address.

pri i2c$ has the this interesting comment, "--- and automatically add the device if it is found."
The confounding part is, how would it know what device it is if it's not in the table? I was a bit hopeful, but now I know better!

My device has two additional i2c buses on separate pins. My next Tachyon exploration is to expand pri i2c$ to look for i2c devices on the other i2c buses.

Introduction to Tachyon: https://docs.google.com/document/d/1bEH0DfGmu99M1SqCbmlzl991Ssv2J5m6XWmkJX0XSl8/edit#

Comments

  • MJBMJB Posts: 1,235

    @dbpage said:

    pri i2c$ has the this interesting comment, "--- and automatically add the device if it is found."
    The confounding part is, how would it know what device it is if it's not in the table? I was a bit hopeful, but now I know better!

    this refers to the RTC only, that when discovered gets activated - but the code is only a comment in ()

Sign In or Register to comment.