This is a Debian remake of the great article about how to interface a Microchip TCN75 Temperature sensor via I2C on Slackware. You have to read it first. Here I’ll post only brief notes and the differences with Debian on Bifferboard.
Required Software
You can install the required software by the following command, no need to compile anything:
apt-get install i2c-tools
Kernel modules
The instructions are fairly the same here, except that there is no module “i2c-core” and you don’t need to load it:
modprobe rdc321x_gpio
modprobe i2c-algo-bit
modprobe i2c-gpio
You have two options on where to connect the I2C pins (SDA and SCL):
- The difficult one – connect them to the JTAG pins by disabling the JTAG first. You will need to solder on the Bifferboard which may void your warranty.
- The easy one – connect them to the Serial console pins. There is no soldering involved here but the trade-off is that you cannot use these pins for your Serial RS-232 console which you may need for debugging or for other purposes. But you could always attach another serial console via USB by using an FT232R chip, for example. This option is my personal favorite here.
Both options work fine, I’ve tried them myself. Here are the corresponding commands:
# using the JTAG pins #11 and #13, soldering required to enable them
modprobe i2c-gpio-custom bus0=0,11,13# using the Serial console pins #7 and #8, no soldering involved here
modprobe i2c-gpio-custom bus0=0,8,7
Finally, you need to load one more additional module and you are done:
modprobe i2c-dev
Application software
The original Slackware article gives an example on how to query your I2C temperature sensor.
- TCN75 tiny SMD soldered
- The third pin of TCN75 is not used here
- TCN75 tiny SMD soldered completely, with cables
- I2C using the JTAG pins; note the additional resistor soldered on Bifferboard
- I2C using the Serial console pins