Changes

Jump to: navigation, search

Orange Pi Zero 2W

930 bytes added, 16:47, 27 September 2023
40pin I2C test method
# As can be seen from the table below, the Android12 TV system has i2c1 and i2c2 turned on by default.
<div style="display: flex;">::{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"
|-
| '''GPIO serial numberNO.'''
| '''GPIO'''
| '''Function'''
| '''pin'''|| '''pin'''| '''Function'''| '''GPIO'''| '''GPIO serial numberPin'''
|-
| style="text-align: left;"|
| '''3.3V'''
| '''1'''
|-| '''<span style="color:#FF0000">264</span>'''| '''<span style="color:#FF0000">PI8</span>'''| '''<span style="color:#FF0000">TWI1-SDA</span>'''| '''<span style="color:#FF0000">3</span>'''|-| '''<span style="color:#FF0000">263</span>'''| '''<span style="color:#FF0000">PI7</span>'''| '''<span style="color:#FF0000">TWI1-SCL</span>'''| '''<span style="color:#FF0000">5</span>'''|-| '''269'''| '''PI13'''| '''PWM3'''| '''7'''|-| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''9'''|-| '''226'''| '''PH2'''| '''UART5_TX'''| '''11'''|-| '''227'''| '''PH3'''| '''UART5_RX'''| '''13'''|-| '''261'''| '''PI5'''| '''UART2_TX'''| '''15'''|-| style="text-align: left;"|| style="text-align: left;"|| '''3.3V'''| '''17'''|-| '''231'''| '''PH7'''| '''SPI1_MOSI'''| '''19'''|-| '''232'''| '''PH8'''| '''SPI1_MISO'''| '''21'''|-| '''230'''| '''PH6'''| '''SPI1_CLK'''| '''23'''|-| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''25'''|-| '''<span style="color:#FF0000">266</span>'''| '''<span style="color:#FF0000">PI10</span>'''| '''<span style="color:#FF0000">TWI2-SDA</span>'''| '''<span style="color:#FF0000">27</span>'''|-| '''256'''| '''PI0'''| style="text-align: left;"|| '''29'''|-| '''271'''| '''PI15'''| style="text-align: left;"|| '''31'''|-| '''268'''| '''PI12'''| '''PWM2'''| '''33'''|-| '''258'''| '''PI2'''| style="text-align: left;"|| '''35'''|-| '''272'''| '''PI16'''| style="text-align: left;"|| '''37'''|-| style="text-align: left;"|| style="text-align: left;"|| '''GND'''| '''39'''|}{| class="wikitable" style="width:390px;margin-right: 20px;text-align: center;"|-| '''Pin'''| '''Function'''| '''GPIO'''| '''GPIO NO.'''|-
| '''2'''
| '''5V'''
| style="text-align: left;"|
|-
| '''264'''
| '''PI8'''
| '''TWI1-SDA'''
| '''3'''
|
| '''4'''
| '''5V'''
| style="text-align: left;"|
|-
| '''263'''
| '''PI7'''
| '''TWI1-SCL'''
| '''5'''
|
| '''6'''
| '''GND'''
| style="text-align: left;"|
|-
| '''269'''
| '''PI13'''
| '''PWM3'''
| '''7'''
|
| '''8'''
| '''UART0_TX'''
| '''224'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''9'''
|
| '''10'''
| '''UART0_RX'''
| '''225'''
|-
| '''226'''
| '''PH2'''
| '''UART5_TX'''
| '''11'''
|
| '''12'''
| style="text-align: left;"|
| '''257'''
|-
| '''227'''
| '''PH3'''
| '''UART5_RX'''
| '''13'''
|
| '''14'''
| '''GND'''
| style="text-align: left;"|
|-
| '''261'''
| '''PI5'''
| '''UART2_TX'''
| '''15'''
|
| '''16'''
| '''PWM4'''
| '''270'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''3.3V'''
| '''17'''
|
| '''18'''
| style="text-align: left;"|
| '''228'''
|-
| '''231'''
| '''PH7'''
| '''SPI1_MOSI'''
| '''19'''
|
| '''20'''
| '''GND'''
| style="text-align: left;"|
|-
| '''232'''
| '''PH8'''
| '''SPI1_MISO'''
| '''21'''
|
| '''22'''
| '''UART2_RX'''
| '''262'''
|-
| '''230'''
| '''PH6'''
| '''SPI1_CLK'''
| '''23'''
|
| '''24'''
| '''SPI1_CS0'''
| '''229'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''25'''
|
| '''26'''
| '''SPI1_CS1'''
| '''233'''
|-
| '''266'''| '''PI10'''| '''TWI2-SDA'''| '''27'''|| '''<span style="color:#FF0000">28</span>'''| '''<span style="color:#FF0000">TWI2-SCL</span>'''| '''<span style="color:#FF0000">PI9</span>'''| '''<span style="color:#FF0000">265</span>'''
|-
| '''256'''
| '''PI0'''
| style="text-align: left;"|
| '''29'''
|
| '''30'''
| '''GND'''
| style="text-align: left;"|
|-
| '''271'''
| '''PI15'''
| style="text-align: left;"|
| '''31'''
|
| '''32'''
| '''PWM1'''
| '''267'''
|-
| '''268'''
| '''PI12'''
| '''PWM2'''
| '''33'''
|
| '''34'''
| '''GND'''
| style="text-align: left;"|
|-
| '''258'''
| '''PI2'''
| style="text-align: left;"|
| '''35'''
|
| '''36'''
| style="text-align: left;"|
| '''76'''
|-
| '''272'''
| '''PI16'''
| style="text-align: left;"|
| '''37'''
|
| '''38'''
| style="text-align: left;"|
| '''260'''
|-
| style="text-align: left;"|
| style="text-align: left;"|
| '''GND'''
| '''39'''
|
| '''40'''
| style="text-align: left;"|
| '''259'''
|}
</div>
<ol start="2" style="list-style-type: decimal;">
<li>The device node corresponding to i2c1 is '''/dev/i2c-1''', and the device node corresponding to i2c2 is '''/dev/i2c-2'''</li></ol>{| class="wikitable" style="width:800px;" |-|
apollo-p2:/ # '''ls /dev/i2c-*'''
'''<span style="color:#FF0000">/dev/i2c-1 &nbsp;&nbsp;&nbsp;&nbsp; /dev/i2c-2</span>''' &nbsp;&nbsp;&nbsp;&nbsp; /dev/i2c-5|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>First open wiringOP APP on the desktop</li></ol>
[[File:zero2w-img351.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then click the '''I2C_TEST''' button to open the i2c test interface</li></ol>
[[File:zero2w-img370.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>The i2c test interface of wiringOP is shown in the figure below</li></ol>
[[File:zero2w-img371.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then click the device node selection box in the upper left corner to select the i2c you want to test</li></ol>
[[File:zero2w-img372.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>Then connect an i2c device to the 40pin i2c pin. Here we take the ds1307 rtc module as an example.</li></ol>
[[File:zero2w-img178.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>The i2c address of the ds1307 rtc module is 0x68. After connecting the lines, we can use the '''i2cdetect -y 1''' or '''i2cdetect -y 2''' command on the serial port command line to check whether the i2c address of the ds1307 rtc module can be scanned. If you can see the address 0x68, it means that the ds1307 rtc module is wired correctly.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>apollo-p2:/ # '''i2cdetect -y 1'''</p>
<p>'''Or'''</p>
<p>apollo-p2:/ # '''i2cdetect -y 2'''</p>
|}
<p>[[File:zero2w-img373.png]]</p></li>
<li><p>Then set the i2c address to 0x68 in wiringOP, and then click the '''OPEN''' button to open i2c</p>
<span id="pin-pwm-test"></span>
 
=== 40pin PWM test ===

Navigation menu