Two weeks ago I’ve received my Orange Pi Zero and start to play with it. After some sleepless nights setting up the environment for cross compile, searching the web for some tips and building a circuit, I successfully drive a Nokia 5110 LCD using SPI. A nice thing about this LCD module is, two of its mounting holes matches with Orange Pi Zero’s mounting holes.
I used WiringOP, which is Orange Pi port of WiringPi for managing GPIOs. I did not build native code on Orange Pi Zero, instead, set up a cross-compiler tool-chain, integrated it to Eclipse IDE for a quick and easy to work development environment.
So I am going to show you how to set-up a similar working environment to quickly interact with other hardware using your Orange Pi. I use Ubuntu 12.04 as my workstation, Eclipse as my IDE for C development. Armbian (Ubuntu Xenial) is running on Orange Pi Zero, it is stable, WIFI and ethernet are both working.
So I am planning this series in three parts:
- Building the Hardware, Part 1
- Setting Up Cross Compiler Toolchain and Eclipse IDE, Part 2
- Building WiringOp and Driving 5110 LCD, Part 3
Building the Hardware
Here are the things I will use for this small project.
A 5×7 pre-drilled PCB, an Orange Pi Zero, a Nokia 5110 LCD, some 2.54 header connectors, a cooler plate but it is optional for this project. I also add an SHT21 humidity and temperature sensor board to test I2C functionality.
Here is pin-out of Orange Pi Zero, you can get the full schematics here.
We must select some pins to control the LCD. Nokia 5110 LCD requires 5 pins.
My LCD module has an 8 pin connector so I use a connection like below:
- GND: Ground
- BL: Backlight
- VCC: Power, 3v3
- CLK: Clock for SPI -> (Orange Pi SPI-CLK pin 23)
- DIN: MOSI for SPI -> (Orange Pi SPI-MOSI pin 19)
- DC: Data/Command -> (Orange Pi IO-3 pin 15)
- CE: Chips Select -> (Orange Pi IO-0 pin 11)
- RST: Reset -> (Orange Pi IO-6 pin 22)
Here are the pictures of the steps that I build my board. I use a power jack for quick powering from an adaptor and also install my SHT21 module too.