Technoman
Senior Member
Hi,
Not sure I am not reinventing the wheel...
In order to code an I2C scanner, using an 28X2, I need your help to check if the following principle is right, as I am not yet easy with that bus.
1) set-up with : hi2csetup i2cmaster,scan_adress,i2cslow,i2cbyte
Within a loop the scan_address is ranging 0 to 127 using bit1-bit7, skipping some addresses like 0, %1111xxx or %0000xxxx
A question is : will every chip respond with i2cslow? Need to switch to i2cfast for some?
2) then reading with : hi2cin scan_adress,(b1)
If a chip is not responding, would I systematically get an $FF in b1, otherwise a different value? Is there a better way to see if a chip is present?
Not sure I am not reinventing the wheel...
In order to code an I2C scanner, using an 28X2, I need your help to check if the following principle is right, as I am not yet easy with that bus.
1) set-up with : hi2csetup i2cmaster,scan_adress,i2cslow,i2cbyte
Within a loop the scan_address is ranging 0 to 127 using bit1-bit7, skipping some addresses like 0, %1111xxx or %0000xxxx
A question is : will every chip respond with i2cslow? Need to switch to i2cfast for some?
2) then reading with : hi2cin scan_adress,(b1)
If a chip is not responding, would I systematically get an $FF in b1, otherwise a different value? Is there a better way to see if a chip is present?
Last edited: