IR sensor notes

I2C what it mean: http://www.ti.com/lit/an/slva704/slva704.pdf

address of device seems to be 0x1A and not 0x34 as reported by datasheet via i2cdetect:

pi@raspberrypi:~ $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: – – – – – – – – – – – – – 10: – – – – – – – – – – 1a – – – – – 20: – – – – – – – – – – – – – – – – 30: – – – – – – – – – – – – – – – – 40: – – – – – – – – – – – – – – – – 50: 50 – – – – – – – – – – – – – – – 60: – – – – – – – – – – – – – – – – 70: – – – – – – – –

reads do not appear to be working via python smbus (http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2 )

write seem fine — or are they

this is a problem with repeated starts

write (looks good):  good write

read (looks bad):  bad read

Note the stop condition (P) in the middle. (http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus/i2c-bus-events/start-and-stop-conditions.html) this fucks it all up!

to fix this

https://www.reddit.com/r/raspberry_pi/comments/2z7uaw/repeated_starts_on_i2c/

ensure /etc/modprobe.d/i2c.conf (rather than /etc/modules ) has the following line:

options i2c-bcm2708 combined=1

result:

good read?

Smbus limited to 32 bytes received data try code from :

https://www.raspberrypi.org/forums/viewtopic.php?t=162248&p=1049717

but the 32 bytes look okay

a = [126, 167, 131, 110, 129, 159, 130, 92, 131, 143, 131, 26, 130, 80, 131, 85, 130, 87, 128, 174, 130, 9, 130, 149, 131, 7, 130, 210, 131, 5, 130, 202]

unresolved questions: why does register 0x02 always return 1? shouldn’t it return 0 sometimes? is it because i’ve never read the entire 0xA0 register off? maybe?

what is PTAT?

more links

http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2

https://www.raspberrypi.org/forums/viewtopic.php?t=19847&p=194723