Dear all,
I did destroy the only two IR proximity sensors I had the other day, so did not get to a state where I could report how accurate and how sensitive to ambient they were . Will get some more to complete the tests.
However, the long awaited VL6180X arrived today. 10 of them, so some margin for error .
I have now been playing with it for an hour or so. I managed to solder it well with the recommended caps and resistors as per data sheet. I added an N4001 in series with the positive terminal from regulated 3.3V supply, so I'm running my axe091 at 2.72-2.73V. Picaxe40x2 is happily downloading a program. I have strange behaviour of the sensor, though.
With i2c address of 0x52, I get seemingly random numbers from any register I try to read. With any other address (just had to try it given my trivial mistake the other day), I get 255. As I understand, this means I'm talking to the thing with the address of 0x52, but it is talking rubbish back to me. Not the register number referred to (which I have seen before), but different number every loop. There are no other components involved apart from I2C pull-ups and already mentioned caps and 47k resistors with the sensor. Here is the code:
Any ideas what to look for?
Thank you for your time,
Edmunds
I did destroy the only two IR proximity sensors I had the other day, so did not get to a state where I could report how accurate and how sensitive to ambient they were . Will get some more to complete the tests.
However, the long awaited VL6180X arrived today. 10 of them, so some margin for error .
I have now been playing with it for an hour or so. I managed to solder it well with the recommended caps and resistors as per data sheet. I added an N4001 in series with the positive terminal from regulated 3.3V supply, so I'm running my axe091 at 2.72-2.73V. Picaxe40x2 is happily downloading a program. I have strange behaviour of the sensor, though.
With i2c address of 0x52, I get seemingly random numbers from any register I try to read. With any other address (just had to try it given my trivial mistake the other day), I get 255. As I understand, this means I'm talking to the thing with the address of 0x52, but it is talking rubbish back to me. Not the register number referred to (which I have seen before), but different number every loop. There are no other components involved apart from I2C pull-ups and already mentioned caps and 47k resistors with the sensor. Here is the code:
Code:
#picaxe40x2
#no_data
#no_table
Symbol I2CSpeed = i2cslow
Symbol VL6180X = 0x52 'ALS/proximity sensor
Symbol GPIO1 = B.0
Symbol GPIO1Pin = pinB.0
init:
hi2csetup i2cmaster, VL6180X, I2CSpeed, i2cbyte 'Announce there will be I2C
hi2cout 0x010, (0) 'Disable (Hi-Z) GPIO0
hi2cout 0x011, (%00010000) 'Set GPIO1 as interrupt pin
hi2cout 0x014, (0) 'Disable all interrupts for testing
' hi2cout 0x2A3, (1) 'Interleaved mode of range and ALS measurements
hi2cout 0x018, (%00000001) 'Start range measurements only
hi2cout 0x01B, (%00000010) '20ms in between measurements
hi2cout 0x02D, (0) 'Disable signal-to-noise, range-ignore and convergence features
main:
hi2cin 0x000, (b0)
sertxd (#b0, LF, CR)
pause 2000
goto main
Any ideas what to look for?
Thank you for your time,
Edmunds