Help with the i2cLibrary 1.3
DarrenY
Posts: 61
Hi All,
I am attempting to interface to a VTI SCP1000 Pressure sensor.
The SCP1000 has a TWI interface that VTI say is i2C compatible.
Upon using the i2c Library with the SCP1000, I find the sensor on the bus via i2cObject.devicePresent OK, but when I try and read a register using i2cObject.readLocation I just get the value 80000000 (decimal) back all the time ??
I'm attempting to read the ASIC version (register location 0x00) with the following:
the debug object is my output to my PC terminal.
I have my hardware configured as per the i2c Library 'demo' setup, i.e 2 x 1k and 2 x 4.7k pull-ups
Any ideas as to why I get 80000000 all the time??
Thanks,
Darren.
I am attempting to interface to a VTI SCP1000 Pressure sensor.
The SCP1000 has a TWI interface that VTI say is i2C compatible.
Upon using the i2c Library with the SCP1000, I find the sensor on the bus via i2cObject.devicePresent OK, but when I try and read a register using i2cObject.readLocation I just get the value 80000000 (decimal) back all the time ??
I'm attempting to read the ASIC version (register location 0x00) with the following:
if i2cObject.devicePresent(i2caddress) ' check for the sensor on the bus debug.str(string("Found SCP1000",10,13)) asicversion := i2cObject.readLocation(i2caddress, $00, 8, 8) debug.str(string("ASIC Version: ")) debug.num(asicversion) debug.str(string(10,13))
the debug object is my output to my PC terminal.
I have my hardware configured as per the i2c Library 'demo' setup, i.e 2 x 1k and 2 x 4.7k pull-ups
Any ideas as to why I get 80000000 all the time??
Thanks,
Darren.
Comments
Is your i2caddress correct?
The spec sheet says the default address is 0x11, b'001 0001
I am using
SCP1000_Addr = %0010_0010
This is the reason I am trying to read the ASIC version - so my object can be generic for both P03 and D11 ASIC versions....
For example, if I read (for example) REVID multiple times, I get 1, 255, 1, 255, 1, 255 etc.
I'm working through the 8-bit TWI read sequence as per the VTI spec sheet to check it matches the i2cLibrary 1.3 but has anyone got any ideas?
Post Edited (DarrenY) : 8/26/2007 8:03:43 PM GMT
So basically it wasn't doing a read at all!!
But now it is (Phew!), but just can't work out why the read isn't consistant
Just an idea because I can't see how you are doing it but many i2c devices require a NAK on the last byte transfered before the stop.
*Peter*