Changes

Jump to: navigation, search

Orange Pi CM4

598 bytes added, 17:46, 18 September 2023
How to set the pull-up and pull-down resistance of 40pin GPIO port
=== How to set the pull-up and pull-down resistance of 40pin GPIO port ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that the 4 GPIO pins below the Orange Pi CM4 have an external 3.3V pull-up, so setting the pull-down is invalid, and the other pins can normally set the pull-up and pull-down resistor function'''</big>
[[File:cm4-img260.png|center]]|}
# The following takes pin 11—the corresponding GPIO is GPIO3_C6—the corresponding wPi serial number is 5—as an example to demonstrate how to set the pull-up and pull-down resistance of the GPIO port
::[[File:cm4-img261.png]]
<ol start="2" style="list-style-type: decimal;">
<li>First, you need to set the GPIO port to the input mode, and the third parameter needs to be the serial number of the wPi corresponding to the input pin</li></ol>{| class="wikitable" style="width:800px;" |-| root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">5 </span> in'''|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>After setting to input mode, execute the following command to set the GPIO port to pull-up mode</li></ol>{| class="wikitable" style="width:800px;" |-| root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">5 </span> up'''|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then enter the following command to read the level of the GPIO port, if the level is 1, it means that the pull-up mode is set successfully</li></ol>{| class="wikitable" style="width:800px;" |-| root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">5''' '''1</span>'''
'''<span style="color:#FF0000">1</span>'''
|}
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then execute the following command to set the GPIO port to pull-down mode</li></ol>{| class="wikitable" style="width:800px;" |-| root@orangepi:~/wiringOP# '''gpio mode <span style="color:#FF0000">5 </span> down'''|}</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then enter the following command to read the level of the GPIO port, if the level is 0, the pull-down mode is set successfully</li>{| class="wikitable" style="width:800px;" |-| root@orangepi:~/wiringOP# '''gpio read <span style="color:#FF0000">5</olspan>'''
root@orangepi:~/wiringOP# '''gpio read 5<span style="color:#FF0000">0</span>'''|}</ol><span id="pin-spi-test"></span>
'''0'''
 
<span id="pin-spi-test"></span>
=== 40pin SPI test ===

Navigation menu