How do I read i2c Device ID# with basic_i2c_driver
BrianProp1user
Posts: 3
I am new to i2c protocalls just started 2 days ago- to learn it...
using this basic i2c driver was fairly easy- except for trying to get the Device ID #,
like this "0xdbA1"???
so far no luck...
_______________________________________________________________________________
_________________________________________________________________________
this paragraph above is the steps I,m trying to figure out????______^^^^^^^^^^^^
I have no problems reading or writing to eeprom-24lc256 of coarse.
If some could help it would be great.
using this basic i2c driver was fairly easy- except for trying to get the Device ID #,
like this "0xdbA1"???
so far no luck...
_______________________________________________________________________________
NXP Semiconductors UM10204
I2C-bus specification and user manual
The Device ID is read-only, hard-wired in the device and can be accessed as follows:
1. START command
2. The master sends the Reserved Device ID I2C-bus address followed by the R/W bit
set to 0 (write): 1111 1000.
3. The master sends the I2C-bus slave address of the slave device it needs to identify.
The LSB is a Dont care value. Only one device must acknowledge this byte (the one
that has the I2C-bus slave address).
4. The master sends a Re-START command.
1. START command
2. The master sends the Reserved Device ID I2C-bus address followed by the R/W bit
set to 0 (write): 1111 1000.
3. The master sends the I2C-bus slave address of the slave device it needs to identify.
The LSB is a Dont care value. Only one device must acknowledge this byte (the one
that has the I2C-bus slave address).
4. The master sends a Re-START command.
Remark: A STOP command followed by a START command will reset the slave state
machine and the Device ID Read cannot be performed. Also, a STOP command or a
Re-START command followed by an access to another slave device will reset the
slave state machine and the Device ID Read cannot be performed.
5. The master sends the Reserved Device ID I2C-bus address followed by the R/W bit
set to 1 (read): 1111 1001.
6. The Device ID Read can be done, starting with the 12 manufacturer bits (first byte +
4 MSBs of the second byte), followed by the 9 part identification bits (4 LSBs of the
second byte + 5 MSBs of the third byte), and then the 3 die revision bits (3 LSBs of
the third byte).
7. The master ends the reading sequence by NACKing the last byte, thus resetting the
slave device state machine and allowing the master to send the STOP command.
machine and the Device ID Read cannot be performed. Also, a STOP command or a
Re-START command followed by an access to another slave device will reset the
slave state machine and the Device ID Read cannot be performed.
5. The master sends the Reserved Device ID I2C-bus address followed by the R/W bit
set to 1 (read): 1111 1001.
6. The Device ID Read can be done, starting with the 12 manufacturer bits (first byte +
4 MSBs of the second byte), followed by the 9 part identification bits (4 LSBs of the
second byte + 5 MSBs of the third byte), and then the 3 die revision bits (3 LSBs of
the third byte).
7. The master ends the reading sequence by NACKing the last byte, thus resetting the
slave device state machine and allowing the master to send the STOP command.
Remark: The reading of the Device ID can be stopped anytime by sending a NACK
command.
If the master continues to ACK the bytes after the third byte, the slave rolls back to the first
byte and keeps sending the Device ID sequence until a NACK has been detected.command.
If the master continues to ACK the bytes after the third byte, the slave rolls back to the first
_________________________________________________________________________
this paragraph above is the steps I,m trying to figure out????______^^^^^^^^^^^^
I have no problems reading or writing to eeprom-24lc256 of coarse.
If some could help it would be great.
Comments
memory chip????
Is that possible????
Maybe it is for operating systems to scan the I2C buss and then determine what exists on what address, and the device id of said device so the operating system can load the right programs to interface with the device. ie Plug n Play type feature.
You could do it in Spin to load cogs with objects to read certain I2C devices such as ultrasonic sensors etc.