Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 3 1 2 3 LastLast
Results 1 to 25 of 74

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

  1. #1
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593

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

    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.
    Click image for larger version. 

Name:	1.28inch-lcd-module-1.jpg 
Views:	36 
Size:	36.5 KB 
ID:	28799

    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

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    Great stuff, Will be fun to try it out, once mine arrives. Should hopefully arrive within the next week...

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,391
    Quote Originally Posted by mjs513 View Post
    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 by MichaelMeissner; 06-25-2022 at 04:45 PM.

  4. #4
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    Quote Originally Posted by MichaelMeissner View Post
    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

  5. #5
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    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

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    Look great

  7. #7
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,391
    I put an order for 2x of the displays.

  8. #8
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467


    Looks like my one should arrive in town tomrrow

  9. #9
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593


    Cool can't wait to see what you come up.

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,391

    Cool

    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.

  11. #11
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    @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

  12. #12
    Senior Member
    Join Date
    Jan 2014
    Posts
    113
    How is the contrast and off axis on that display? it could be useful!

  13. #13
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    It Works!
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	64 
Size:	214.5 KB 
ID:	28837

  14. #14
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    Quote Originally Posted by KurtE View Post
    It Works!
    ...[/ATTACH]
    I pushed your updated version to the repository along with the tft_picture_viewer sketch you updated for the GC9A01 display.

  15. #15
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    Quote Originally Posted by neutron7 View Post
    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.

  16. #16
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    Quick update...

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

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	61 
Size:	98.0 KB 
ID:	28845

    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
    Attached Files Attached Files

  17. #17
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,391
    Quote Originally Posted by KurtE View Post
    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.

  18. #18
    Senior Member
    Join Date
    Jan 2019
    Posts
    161
    Is this wired correctly? Can't get anything on screen.
    Click image for larger version. 

Name:	WhatsApp Image 2022-07-03 at 12.24.05 PM.jpg 
Views:	44 
Size:	45.4 KB 
ID:	28848

    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 by donperryjm; 07-03-2022 at 05:42 PM.

  19. #19
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    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...

  20. #20
    Senior Member
    Join Date
    Jan 2019
    Posts
    161
    What do they use to convert the font? I want to do BankGothic font

  21. #21
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    Quote Originally Posted by donperryjm View Post
    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+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-font...20extension%5D.
    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.

  22. #22
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,892
    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];
    ^

    ...

  23. #23
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    8,593
    Quote Originally Posted by defragster View Post
    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

  24. #24
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,467
    Will take a look. Which Teensy?

    Update: Fixed
    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 by KurtE; 07-10-2022 at 01:19 PM.

  25. #25
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,892
    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 by defragster; 07-10-2022 at 06:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •