NEW: GC9A01A Display driver for Teensy 3.x and Teensy 4.x

mjs513

Senior Member+
Good Morning all

@KurtE and I have been at it again. Recently we started playing with a WaveShare GC9A01A 1.28 Round Display as shown below.
1.28inch-lcd-module-1.jpg

Since we cannot leave well enough alone we modified the ILI9341_t3n library for use with the GC9A01 and created a new library for those displays. By using @KurtE's ILI9341_t3n library as the base we get everything in the ILI9341_t3n library (framebuffer, DMA etc) for use with the GC9A01A display.

Right now its 100% tested on all devices, only tested so far with the T4 and T4.1, so if anyone wants to play along the new library can be found on Github:

https://github.com/mjs513/GC9A01A_t3n

we have also updated the ILI9341_fonts library so you will have access to a stack of fonts:

https://github.com/mjs513/ILI9341_fonts
 
Great stuff, Will be fun to try it out, once mine arrives. Should hopefully arrive within the next week...
 
Good Morning all

@KurtE and I have been at it again. Recently we started playing with a WaveShare GC9A01A 1.28 Round Display

Good work. I've wondering about these displays, and of course whether I could adapt the uncanny eyes code. In theory, I imagine it should just 'work' providing the eye drawn is within the circle of LEDs that are displayed.
 
Last edited:
Good work. I've wondering about these displays, and of course whether I could adapt the uncanny eyes code. In theory, I imagine it should just 'work' providing the eye drawn is within the circle of LEDs that are displayed.

Evening Michael

Sorry was kind of sidetracked today with trying to get transparent BMP working - think I kind of got it working. But yes should be transparent since we are working with same base display driver. As you said as long as the eye fits :) Was actually on my to do list which seems to be getting longer and longer
 
Ok guys just implemented a Attitude Direction Indicator (ADI) using the new library with the additional feature of using transparent BMPs. Really experimental. Here is a short video of it in action:

Enjoy
 
It's been awhile since I played with ST7789 displays. Refresh my memory which pins should be used for the CS and D/C pins on the Teensy 4.0/4.1 for fastest frame rate.

From the pinout card, it looks like pins 10, 36, and 37 are the faster pins for SPI0 and pin 0 (and maybe pin 38) are the faster pins. IIRC, unlike in the Teensy 3.x where you want both CS and D/C to be among the fast pins, with the Teensy 4.x, it is most important if the fast pin is used for D/C and not CS. Of course in the Teensy 4.1 with two SPI ports, you don't need CS be flipped fast since both eyes won't be on the same SPI bus.

Given pin 38 is listed as an alternate pin to pin 0 for CS1, I don't remember if the library can use both at the same time (as fast pins), or like some of the pins in the Teensy 3.x (like pins 2 and 10), where if you want the fastest performance, you don't want pins that use the same resources internally.
 
@MichaelMeissner

Have no idea to be honest - been so long here as well since I played with those displays. Been busy with other stuff besides Teensy today :)

EDIT: Oh by the way managed to implement rotating a BMP by any angle as well just translation
 
How is the contrast and off axis on that display? it could be useful!

Think the contrast is excellent for such a small display and the off-axis performance good as well - titled it about 80 deg (just a guess) and was still able to see the display clearly.
 
Quick update...

I actually received a second one, which I picked up this morning from the Mailbox...

screenshot.jpg

Code is not 100%, but looks sort of fun using the round displays.

UpdateScreenAsync failed, so will look at that later.

But having some fun
 

Attachments

  • uncannyEyes_GC9A01A-220702a.zip
    1.4 MB · Views: 163
Quick update...

I actually received a second one, which I picked up this morning from the Mailbox...

Code is not 100%, but looks sort of fun using the round displays.

UpdateScreenAsync failed, so will look at that later.

But having some fun

Cool. Thanks. Mine should be here on Tuesday (Monday is a USA holiday). One issue with the traditional two displays was hiding the extra bulk of the corners of the display if you were thinking about embedding it in a costume.

I've been meaning to look at the next generation of code (used in the Monster M4SK, Hallowing M4, etc.) that reads the BMP file from the flash memory and allows more re-configuration without having to re-program it. That means diving into the MTP disk support.
 
Is this wired correctly? Can't get anything on screen.
WhatsApp Image 2022-07-03 at 12.24.05 PM.jpg

VCC -> +5v
GND ->GND
DIN -> Pin 11
CLK -> Pin 13
CS -> Pin 10
DC -> pin 9
RST-> Pin 8

FIXED:
All this time I was connecting the VCC to +5V,
connecting to +3V fixed it

What a scary eye!
 
Last edited:
It depends on what code you are using...
More specifically it matches what you pass through to the constructor...

Code:
#define TFT_DC  9
#define TFT_CS 10
#define TFT_RST 8
// Setup optional backlight pin
#define TFT_BL 7
...
GC9A01A_t3n tft = GC9A01A_t3n(TFT_CS, TFT_DC, TFT_RST);

Note: when I am hooking it up I use VC -> 3.3v

But in addition to this, many displays require you to hook up their Backlight pin.
With some of them, you can hook them up to an IO pin, others may draw too much
current to want to directly connect to an IO pin, so you can connect them to 3.3v directly or through
an inline resistor to limit the current.

I figured safe to connect directly to IO pin as they show that for hook ups to RPI, likewise for some M4 Arduino
https://www.waveshare.com/wiki/1.28inch_LCD_Module

You may then want to pull the IO pin HIGH...
 
What do they use to convert the font? I want to do BankGothic font

You could try the font editor from this post: https://forum.pjrc.com/threads/54345-ILI9341_t3-font-editor?highlight=ili9341+fonts

To use it looks like you have to download the ttf files for BankGothic and copy them into the Windows font directory:
1. Download for instance from: https://fontsgeek.com/bankgothic-font
2. Then copy the ttf files to the Fonts directory: https://www.lifewire.com/locate-fon...rs; try searching for *. [filename extension].
3. Open FontsEditor on select new from menu bar then select from font file. It will open up the MS Windows font selector and you then select BankGothic font and font size you want.
4. Then you need to Select EXPORT from the menu bar and it will export it to the ILI9341.t3 font format

Never really used it so have fun.

EDIT: Take a look at the existing font .h and .cpp font files to give you an idea how to name the files and sizes in them.
 
Display working here - with graphicstest.ino
DemoSauce needed and got p#1 font edit LIB, then complained of DMASetting? ... moved to above .ino ...
"C:\\T_Drive\\tCode\\libraries\\ILI9341_fonts\\src\\font_CourierNewItalic.c" -o "R:\\temp\\arduino_build_DemoSauce.ino\\libraries\\ILI9341_fonts\\font_CourierNewItalic.c.o"
In file included from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_CourierNew.h:17:0,
from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_CourierNew.c:1:
C:\T_Drive\tCode\libraries\GC9A01A_t3n\src/GC9A01A_t3n.h:261:3: error: unknown type name 'DMASetting'
DMASetting _dmasettings[2];
^
C:\T_Drive\tCode\libraries\GC9A01A_t3n\src/GC9A01A_t3n.h:262:3: error: unknown type name 'DMAChannel'
DMAChannel _dmatx;
^
In file included from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_ArialBoldItalic.h:17:0,
from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_ArialBoldItalic.c:1:
C:\T_Drive\tCode\libraries\GC9A01A_t3n\src/GC9A01A_t3n.h:261:3: error: unknown type name 'DMASetting'
DMASetting _dmasettings[2];
^
C:\T_Drive\tCode\libraries\GC9A01A_t3n\src/GC9A01A_t3n.h:262:3: error: unknown type name 'DMAChannel'
DMAChannel _dmatx;
^
In file included from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_ArialBlack.h:17:0,
from C:\T_Drive\tCode\libraries\ILI9341_fonts\src\font_ArialBlack.c:1:
C:\T_Drive\tCode\libraries\GC9A01A_t3n\src/GC9A01A_t3n.h:261:3: error: unknown type name 'DMASetting'
DMASetting _dmasettings[2];
^

...
 
Display working here - with graphicstest.ino
DemoSauce needed and got p#1 font edit LIB, then complained of DMASetting? ... moved to above .ino ...

Yep just confirmed getting those errors. There were some changes to DMA code after initial testing but never reran the Demosauce was testing with attitude indicator and uncanny eyes
 
Will take a look. Which Teensy?

Update: Fixed :eek:
Pushed up PR. - problem was the DMA structure was defined in the header file in an area that .c code would see (i.e. fonts)
So moved the structure to C++ section of header file.

Will merge in PR if @mjs513 does not beat me to it.

Update: Merged (So is Uncanny eyes)
 
Last edited:
Good work! Sorry - T_4.1.

It works.

Had to make some edits to the code I should have noted:
GC9A01A_t3n tft = GC9A01A_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO);
isn't supported - accepts:
GC9A01A_t3n tft = GC9A01A_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK);

Running after the initial some effects seem to be working on an unclear screen? Not run on an ili9341 in soo long, not sure what is normal?
> first is the jittery green dot rotating cube?
 
Last edited:
Back
Top