August 13, 2021
Nanopi Neo - pins and signals
Running an OS with a serial console may be interesting for a short while, but to do
anything really interesting with a board like this, you need to connect things to IO
pins. This board packs in an amazing amount of IO for such a tiny board.
Well, compared to the Orange Pi with its 40 pin connector, here we have 36 pins,
so we really aren't all that handicapped.
On board LED's
Before we talk about the connections that go off board, let's talk about two on board LEDs.
They are next to the SD card and labeled PWR and STAT.
The PWR led is not an actualy power indicator -- it is driven by an IO pin.
Mine is green, and blinks when I manipulate GPIO J10 (the Nanopi schematics call this L10).
The status LED is on a different pin that the Orange PI. For the Neo it is on A10
(the Orange Pi puts it on A15).
To build Kyu to blink the status light, go to orange_pi/board.h and uncomment the line
that defines BOARD_NANOPI_NEO, then go back to the main directory, type make, and reboot.
On my board the "power" LED is green and the status LED is blue.
36 pins on two IO connectors
If you hold the board in front of you with the ethernet connector down, we can talk
about left and right. In that orientation, the right side has a double row of 24 pins.
The left side has a single row of 12 pins.
First the single row of pins on the left.
The schematic calls this CON2
- 5 volts
- USB1 - DP
- USB1 - DM
- USB2 - DP
- USB2 - DM
- PL11, Rx, IR -- 10K pullup to 3.3
- PA17, SPDIF
- i2s0 - lrck
- i2s0 - bck
- i2s0 - dout
- i2s0 - din
- Ground
The question now (for me anyway) is which pins I can use for plain old GPIO.
I am not sure at all about any of the pins on this connector, but L11 looks
fine as long as I don't mind the pullup. A17 looks just fine too, despite the
"SPDIF" label. The last four pins come from the audio codec and don't have
alternate functions as GPIO pins.
As far as the USB pins, the chip supports 4 usb connections.
USB0 is the micro-USB and USB3 is the big square USB.
USB 1 and 2 are simply provided here in case the adventurous builder
wants to add connectors and hardware for them (I guess) and they don't
have alternate functions as GPIO, so they are of no use to me.
Now what about the 24 pins on CON1 (the connector on the right).
Here we have odd and even pins. Pin 1 is at the top left, holding the
card with ethernet down (once again). In other words pin 1 is towards
the inside of the card and sort of near the micro-USB connector.
- 1 - 3.3 volts
- 3 - GPIO A11 i2c0 sda
- 5 - GPIO A12 i2c0 scl
- ---
- 7 - GPIO G11
- 9 - Ground
- 11 - GPIO A0 Tx on uart2
- 13 - GPIO A2 RTS on uart2
- 15 - GPIO A3 CTS on uart2
- 17 - 3.3 volts
- 19 - GPIO C0 spi0 mosi
- 21 - GPIO C1 spi0 miso
- 23 - GPIO C2 spi0 mclk
- 2 - 5 volts
- 4 - 5 volts
- 6 - Ground
- ---
- 8 - GPIO G6 Tx on uart1
- 10 - GPIO G7 Rx on uart1
- 12 - GPIO A6 PWM1
- 14 - Ground
- 16 - GPIO G8 RTS on uart1
- 18 - GPIO G9 CTS on uart1
- 20 - Ground
- 22 - GPIO A1 Rx on uart2
- 24 - GPIO C3 spi0 cs
A quick reminder to myself. I skipped pins 1-6 and soldered an 18 pin connector to
my board (because I soldered wires for power and ground to pins 2 and 6).
Just for the record, section 3.2 of the H3 chip datasheet describe pin muxing.
It is important to note that for whatever reason, Allwinner avoids calling i2c i2c in their docs.
They like to call it TWI, which I guess is "two wire interface".
All told we get 16 GPIO pins on this 24 pin connector. We get another two, with some issues, on the
other connector. We get a single i2c interface, and a single spi interface, as well as two uarts.
Have any comments? Questions?
Drop me a line!
Tom's electronics pages / tom@mmto.org