Larry Bank Posted September 3, 2017 Posted September 3, 2017 The documentation on the Orange Pi Zero Plus 2 is somewhat scarce. I couldn't find information on the GPIO map for the 26-pin header anywhere, but I manually mapped it. I did this with an LED on each successive pin and testing through the /sys/class/gpio driver until I found the one to control it. This caused a bunch of resets and eventually corrupted my sd card, but I got the info Each of the numbers below is the GPIO number used for /sys/class/gpio. For example, 110 means gpio110. The list is by pin number from 1 to 26. A value of -1 means unavailable (as far as I could discover): -1, -1, 12, -1 (pin 1,2,3,4) 11,-1,6,0 (pin 5,6,7,8) -1,1,352,107 (pin 9,10,11,12) 353,-1,3,19 (pin 13,14,15,16) -1,18,-1,-1 (pin 17,18,19,20) -1,2,14,13 (pin 21,22,23,24) -1,110 (pin 25, 26) I've added this table to my SPI_LCD project to make it easier to use for generic GPIO access without having know the details of working with the sysfs kernel driver: https://github.com/bitbank2/SPI_LCD P.S. The red LED on the board is mapped to GPIO17 1
Larry Bank Posted September 4, 2017 Author Posted September 4, 2017 Update: I keep crashing the machine/corrupting the SD card when trying to located the GPIO numbers for the SPI in/out pins (19/21), but I found the GPIOs for the RX/TX pins on the 3 pin header next to the 26 pin header: GPIO5 -> TTY RX GPIO4 -> TTY TX I've also noticed that the SPI kernel driver seems to run slower than it should. I can set a speed of 33Mhz (the max defined for the SPI) and on other Orange Pi devices, my LCD code can achieve around 28FPS on an ILI9341 (240x320x16bpp). On the OPZ+2, the same speed/code only gets 16.8FPS. Can anyone speculate why the SPI throughput would be slower on this device versus the regular Orange Pi Zero?
specialist383 Posted September 17, 2017 Posted September 17, 2017 I checked the Orange Pi Zero Plus2 datasheet .v1, the table above and the pins that work in my OpiZeroP2 controller and came up with a pinout diagram of the GPIO connector referenced to port and pin numbers. Pins 11 and 13 seem to be strange. For Python users, not all pins are usable in a program using the pyA20-H3 driver and its (incomplete) mapping. The function of most of the pins depend on the H3 internal function activated in the fex/dtb file during boot.
martinayotte Posted September 17, 2017 Posted September 17, 2017 Pins 11 and 13 are not so strange, they are PL0/PL1 which provide S-TWI.
nopnop2002 Posted October 11, 2017 Posted October 11, 2017 @specialist383 For Python users,you can control all pin using python-periphery. https://github.com/vsergeev/python-periphery.git
Recommended Posts