Chapt 5. Android 12 TV system instructions
5.15.4. 26pin I2C test method
1) The i2c3 in 26pin is enabled by default in Android, and the corresponding device node is /dev/i2c-3
apollo-p2:/ # ls /dev/i2c-3
/dev/i2c-3
2) First open the wiringOP APP on the desktop
Img
5.77
3) Then click the I2C_TEST button to open the i2c test interface
Img
5.78
4) The i2c test interface of wiringOP is shown in the figure below.
You can see that the default i2c is /dev/i2c-3, so we don ’t need to re-select
Img
5.79
5) Then connect an i2c device to the 26pin i2c3 pin, here we take the ds1307 rtc module as an example
Img
5.80
Pins of the RTC module | The pin corresponding to the 26pin of the development board
5V - pin 2
GND - pin 6
SDA - pin 3
SCL - pin 5
6) The i2c address of the ds1307 rtc module is 0x68.
After connecting the wires, we can use the i2cdetect-y 3 command in the serial port command line to check whether the i2c address of the ds1307 rtc module can be scanned.
As shown in the figure below, if you can see the address 0x68, it means that the wiring of the ds1307 rtc module is correct.
apollo-p2:/ # i2cdetect -y 3
Img
5.81
7) Then set the address of i2c to 0x68 in wiringOP, and then click the OPEN button to open i2c3
Img
5.82
8) The display after clicking the OPENbutton to open i2c3 is as follows
Img
5.83
9) Then we test to write a value into the register of the rtc module, for example, write 0x55 to the 0x1c address
a. We first set the address of the register to be written to 0x1c
Img
5.84
b. Then set the value to be written to 0x55
Img
5.85
c. Then click the WRITE BYTE button to execute the write action
Img
5.86
10) Then click the READ BYTE button to read the value of the 0x1c register, if it is displayed as 0x55, it means that the i2c read and write test has passed
Img
5.87