
/././././bus/i2c -rw-r-r- 1 root root 4096 Oct 4 12:53 uevent Hardware Monitoring ( hwmon) Devices ¶ Total 0 -r-r-r- 1 root root 4096 Oct 4 12:54 modalias -r-r-r- 1 root root 4096 Oct 4 12:54 name drwxr-xr-x 2 root root 0 Oct 4 12:54 power lrwxrwxrwx 1 root root 0 Oct 4 12:54 subsystem ->. This is relatively easy follow the kernel build documentation. Raspberry Pi OS does not package that driver, so you have to build The Linux kernel comes with a driver for LM73 Using the Device: hwmon - Hardware Monitoring ¶ Linux out of the box, and LM73 is no exception. See the kernel documentation forĭetailed information - we are scratching only the surface here.īut this is rarely necessary because most devices are supported by Implementing the device’s protocol in userspace is always possible for

#include #include #include #include #include #include #include #include using namespace std int main ( int argc, char ** argv ) LM73 pin 1 is left floating - the chip should appear on address Now we use the i2cdetect program from the i2c-tools package to check ifĮverything’s connected correctly.

I2c-tools/ i2cdetect: Diagnostics, Detecting Devices ¶ Given the above IDC header pinout, we can now connect to the Raspberry The breakout board takes this into account: a 3 pin header lets youĬonnect pins with a jumper. The LM73 lets you choose between three different addresses, via pin 1. The breakout board has a 10-pin IDC header with the following pin I decided to isolate the chip for easy testing, and came up with a PCB Practical since the Pi’s I2C operating voltage is 3.3V we use theĭuring a larger project, I had to write a larger software package and,Īmong other tasks like PCI communication, talk to LM73. Power can be supplied in a range between 2.7V and 5.5V. LM73 comes in a SOT-23 package which means that it is rather See how to detect devices on it using the i2cdetect tool. Reboot, and check if /etc/i2c-1 is still there. etc/modules-load.d/i2c, with i2c-dev in it. The same is accomplished by creating a dedicated file, say In /boot/config.txt insert the following line 1 Then pass the relevant information to the kernel which will reactĪccordingly - load the appropriate drivers, for example. On, you configure the bootloader to turn it on. Enable I2C, Load BCM2835 Platform Driver ¶īy default, on Raspberry Pi OS everything’s off. Of those, i2c-0, is dedicated to display and touch handling and is

The Raspberry has two I2C host controllers (“masters”) built-in. The Hardware Monitoring interface in /sys/class/hwmon Principles hold unmodified for other devices that run Linux (more Rasperry Pi because everything’s easy there. This article shows how you use Linux to communicate with I2C devices.

Using the Device: hwmon - Hardware Monitoring Using the Device: Talking I2C from Userspace I2c-tools/ i2cdetect: Diagnostics, Detecting Devices
