Zonnestroompanelen in Nederland

duurzaamheid achter de meter

(36) Arduino Nano and the circular GCA901 240*240 pixel TFT display

by Floris Wouterlood – The Netherlands – August 2, 2023

Summary
We wire here a circular 1.28” diagonal 240*240 pixel color display with GCA901A controller to an Arduino Nano. I appreciate the humble Nano because this platform is so extremely handy for the creation of sketches that need to be fast and economical with memory and microprocessor load. Also the ultrafast compilation and upload of sketches from my computer to the Nano greatly facilitates development of sketches and functions for later use in high-performance platforms, for example the ESP32. It is always handy to have a development platform immediately at hand.

figure 1. Wiring diagram: Arduino Nano, 1.28” circular 240*240 SPI GC9A01 TFT display.

Pin mapping
Note that the TFT display is a 3.3V device while the pins of a Arduino Uno or Nano deliver 5V. To reduce voltage in the control wires I inserted a 220 Ω resistor in series. This display breakout board has seven pins (figure 1) of which five serve the SPI interface (CS, DC, SDA, SCL and RST). The two remaining pins are marked VCC and GND. These two are obvious. The pin marked RST is not connected.

Pin connectivity table

GC9A01 display Arduino Nano pin
RST
CS 10
DC 9
SDA 11
SCL 13
GND GND
VCC 3V3

Wiring
We are using conventional pin mapping: SCL (clock) and SDA (data, on other displays named MOSI) connect to pins 13 and 11 of the Nano, respectively. Pins 10-13 are the standard pins on the Arduino Uno and Nano that support SPI communication with peripheral devices: pin 10 (SS, Chip Select-CS, pin 11 MOSI, or data-SDA); pin 12 MISO; pin 13 SCLK, or clock). Pins CS and DC need to be declared in software. I have selected here pin 9 for DC.

figure 2. Pin connectivity Arduino Uno – Nano, 1.28” circular 240*240 SPI GC9A01 TFT display.

Library
The library that fully supports all graphical functions of the GC9A01 chip is the Adafruit_GC9A01.h library. It follows Adafruit convention which means that all graphical instructions are pretty familiar. Since sketches that use the the Adafruit_GC9A01.h library seamlessly run in the ESP8266 and ESP32 microcontroller environments it is handy to develop and debug sketch snippets on an Arduino Nano before transferring to ESP8266 or ESP32 that require much more compilation time.

Downloadable sketch

• Nano_GC9A01_voltage_meter.ino
(needs the Adafruit_GFX.h and the Adafruit_GC9A01A.h libraries)Sketch is packed in a ZIP file: Nano_GC9A01_voltage_meter.zip

figure 3. Sketch running on a breadboard assembly of an Arduino Nano and a circular display with GC9A01 controller