Jump to content

I finally mapped the GPIO on the OPZ+2 (H3)


Larry Bank

Recommended Posts

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

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.

opizerop2-gpio-1.thumb.jpg.2ca69477783ef9c1b57aeb64d5094d75.jpg

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines