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

Thread: buydisplay 1280 X 400 TFT ra8876 AND SSD2828 SPI connectivity

  1. #1
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117

    buydisplay 1280 X 400 TFT ra8876 AND SSD2828 SPI connectivity

    I have 2 of these buydisplay7.84 "candy bar" 1280 X 400 displays ..

    They require SPI for the RA8876

    and SPI for the ssd2828 chip .. which needs to initialize communications to the RA8876
    (its sort of set it and forget it )..

    So as the tri-state issue is still a problem ..

    I would like to use 1 SPI channel on the teensy 4.1 for the RA8876 pins 10/11/12/13

    and the second SPI1 channel on the teensy 4.1 for the ssd2828 pins 26/27/38/39

    I know how to get SPI working on pins 10/11/12/13 of the teensy .. but don't know how to configure up SPI1 pins 26/27/38/39 to make the call to the SSD2828 .

    can somebody give me some schooling on how to set up spi1 ?

    I had posted once before about this but it was quite some time ago ... I checked the SPI setup on my ra8875 display so I know its working .. I just don't know how to hitch it up to spi1.. if I can get spi 1 running I can test with the tra8875 display to make sure I have it right , then hitch the ssd2828 to it and get the display working

    Thanks in advance ..
    Keith
    Last edited by Keith_M; 02-25-2021 at 02:44 AM. Reason: need better clarification

  2. #2
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    I ported over a bit-banged version of configuration code for the SSD2828 and added it to my fork of the Ra8876LiteTeensy library. You can see the files here:

    https://github.com/blackketter/Ra887.../src/SSD2828.h
    https://github.com/blackketter/Ra887...rc/SSD2828.cpp

    This just requires 4 GPIO (for the SSD2828 CS, RST, SCK, SPI pins), so you won't need to dedicate an SPI port just to configure the chip.

  3. #3
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    oh wow !!! thanks ... Last time I had looked, the 7.84 was not moving forward ..

    I got the display a while back but am somewhere above a "beginner" and certainly below an "intermediate" programmer..

    I appreciate you posting this up so I can learn from it as well.

    Thankyou for your time and putting this code together..

    cheers
    K

  4. #4
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Blackketter .. Well gave the code a shot .. compiles and loads the demo .. but screen does not respond (Black no activity)... Validated my wiring and matched 1 for 1 for the t4.1 and what you have published ..Checked the wiring 3 times .. SDI/SDO and all clocks CS backlight are correct...nothing is reversed ... resets are correct too ..

    my system monitor is claiming "2D ready failed" ..

    Could use a little direction .. is there a simpler piece of code that just initializes the screen and prints "hello world" LOL

    Sorry , to be a pain ....

  5. #5
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117

    no luck , thinned it out

    #include "Arduino.h"
    #include "_font_ComicSansMS.h"
    #include "ER-TFT0784_t3.h"

    // Pin connection mapping
    ER_TFT0784_t3 tft = ER_TFT0784_t3(
    // Teensy pin // Display pin
    10, // RA8876 CS 5
    14, // RA8876 RESET 11
    11, // RA8876 MOSI 7
    13, // RA8876 SCLK 8
    12, // RA8876 MISO 6
    36, // SSD2828 CS 31
    38, // SSD2828 RESET 43
    4, // SSD2828 SDI 34
    37 // SSD2828 SCK 35
    );

    #define BACKLIGHT 9 // Display pin: 14

    void setup() {

    pinMode(BACKLIGHT, OUTPUT);
    analogWriteFrequency(BACKLIGHT, 50000);
    analogWrite(BACKLIGHT, 128);
    tft.begin(20000000);
    tft.setFont(ComicSansMS_14);
    tft.setTextColor(WHITE);

    }

    void loop()
    {
    tft.setFont(ComicSansMS_14);
    tft.setTextColor(WHITE);
    tft.fillScreen(0xfc10);
    }

  6. #6
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Quote Originally Posted by Keith_M View Post
    #include "Arduino.h"
    #include "_font_ComicSansMS.h"
    #include "ER-TFT0784_t3.h"

    // Pin connection mapping
    ER_TFT0784_t3 tft = ER_TFT0784_t3(
    // Teensy pin // Display pin
    10, // RA8876 CS 5
    14, // RA8876 RESET 11
    11, // RA8876 MOSI 7
    13, // RA8876 SCLK 8
    12, // RA8876 MISO 6
    36, // SSD2828 CS 31
    38, // SSD2828 RESET 43
    4, // SSD2828 SDI 34
    37 // SSD2828 SCK 35
    );

    #define BACKLIGHT 9 // Display pin: 14

    void setup() {

    pinMode(BACKLIGHT, OUTPUT);
    analogWriteFrequency(BACKLIGHT, 50000);
    analogWrite(BACKLIGHT, 128);
    tft.begin(20000000);
    tft.setFont(ComicSansMS_14);
    tft.setTextColor(WHITE);

    }

    void loop()
    {
    tft.setFont(ComicSansMS_14);
    tft.setTextColor(WHITE);
    tft.fillScreen(0xfc10);
    }
    okay .. I feel silly I just realized I dropped the ssd2828.h and .cpp files ..

  7. #7
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Okay, The backlight is coming on for the ra8876 7.84" display. But still can't seem to get text or a screen fill with color ....
    I'm running this on a t4.1
    is pin 36 on the 7.84" display (2828DC) not required ... I've not got it hooked up .. just questioning it ..


    Thanks for any input on this matter

  8. #8
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    Quote Originally Posted by Keith_M View Post
    Okay, The backlight is coming on for the ra8876 7.84" display. But still can't seem to get text or a screen fill with color ....
    I'm running this on a t4.1
    is pin 36 on the 7.84" display (2828DC) not required ... I've not got it hooked up .. just questioning it ..


    Thanks for any input on this matter

    Sorry for the silence. 2828DC / Pin 36 doesn't need to be connected.

    Not sure what the error "2D ready failed" is...

    One thing to double check is that the display is getting enough power. My T4.1 & display draw .75A at 5v.

  9. #9
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    No problem on the silence, I'm running it off my USB port on my HP workstation.I'll cut it over to my 5v supply... I've run my ra8875s ..4,3" 5" and 7" off usb with the t4.0/T4.1 so more then likely I'll need more current for 7.84". I'll give it a shot , I can't think of anything at this point that would stop it ..Other then maybe insufficient current...Thanks for your reply .. I pulled the code from your link as It looks like it was not rolled into the wwatson repository ..I saw the pull request , but it doesn't look like it got merged ...
    Will post up as I try to move forward here ..My display version is configured for 4 wire spi and 5Vcc..just in case there is something missed ..

  10. #10
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    Quote Originally Posted by Keith_M View Post
    .My display version is configured for 4 wire spi and 5Vcc..just in case there is something missed ..
    Same here. I did have one display that came from BuyDisplay that was misconfigured. Couldn't hurt to double-check the jumpers per the datasheet.

  11. #11
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Good Idea .. I had not thought of that ...getting complacent.. I've got a number of other displays from them and they came without a hitch ... I have a second 7.84" I could try to rule out a bad display as well
    Last edited by Keith_M; 03-09-2021 at 06:53 PM. Reason: typo

  12. #12
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Good call ... its misconfigured ...!!! I'll work through it this evening

  13. #13
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    for the SPI 4 wire configuration all pins that should be shorted are fine ...
    but there are pins that are suppose to be "open" which are shorted.

    light touch with my iron and I'll test again
    Last edited by Keith_M; 03-09-2021 at 07:39 PM. Reason: typo

  14. #14
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    c26 on my board after looking at it is not even bridged across its 2 pads its offset by a pad ..!!

    I'm going to check my other board out..

  15. #15
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Not only is it misconfigured , but c25 on the board is not properly mounted ..

  16. #16
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Okay ..
    validated the configuration for the second board all is good ...
    validated connections from display to teensy ...everything is where it should be according to your pinout list
    deleted my projects for the 7.84" display .. deleted the libraries as well ...

    re-downloaded from your link

    wired the display to my t4.1 identical to your pinout ..
    loaded all of the project .H files into the common project directory
    verified they were there
    Code compiles flawlessly no issues on compilation and load ..
    uploaded code.
    "NO happyness" LOL

    Decided to check the pinout for the 7.84" display yes it is correct ...
    Downloaded the datasheet in case there was a "misprint" with the pin allocation and re-checked it..
    Apparently I should be good to go, but can't seem to get there or I have 2 bad displays !!
    Attached a 1.5amp external regulated supply for the display /teensy ....(no luck)

    The one where the capacitor was not placed correctly I contacted Buydisplay engineering .. The display should still work .. its used strictly for noise bypass . I can resolder it at some point.

    So I suspect I must be missing something in the code at this point ..

    Anyhow an update ... Thanks for passing those ideas over!
    Just not there yet ..

    So not totally frustrated and pulling my hair out yet .. but this one is a challenge!!

  17. #17
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    Is it possible for you to test with the ER-TFT0784.ino example?

    I just verified that with hardware setup the same as is in there, that sketch works.

  18. #18
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Just tested with your pin mapping (no luck) .. is your display board the rev1.0 version ?

  19. #19
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Yes I ran your example ... no luck .. backlight but no display activity

  20. #20
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    I'm on arduino 1.8.13 and teensyduino 1.53 ....just for the notes

  21. #21
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    Yup, I"m on 1.53, though I'm using Platformio. Shouldn't matter.

    And the board is v1.0

    Here are images of my board and wiring for a sanity check:

    Click image for larger version. 

Name:	IMG_7581.jpg 
Views:	19 
Size:	120.3 KB 
ID:	24034 Click image for larger version. 

Name:	IMG_7579.jpg 
Views:	13 
Size:	122.8 KB 
ID:	24035Click image for larger version. 

Name:	IMG_7578.jpg 
Views:	20 
Size:	110.7 KB 
ID:	24036

    Hard to trace out the wires from those, I think. Happy to do so if you need.

  22. #22
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    Look fine by me, but I have to admit this one is a challenge and it shouldn't be .. it's straight up wiring and pin configuration validation ..
    So I must be missing something but I can't figure out what ... configurations are good ...wiring is correct..

    Think I'll put it aside tonight and give it another go tomorrow ...

    Thanks .. good inspiration you have provided !!

    cheers
    K

  23. #23
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    117
    well for grins and just to make sure I wasn't losing my marbles .. I pulled the Dupont connectors off the display and routed them to an RA8875 display on the bench .. loaded code and up it came ..Wanted to rule out a hardware failure in the t4.1

    So I know that the SPI for the screen is correct and functional .. The only thing I can't check is the ssd2828 bit banging

  24. #24
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    Interestingly, I'm seeing "2D ready failed" on my console too. It's happened twice now after running some demos for a long time.

    Not sure where it's coming from, searching the source comes up empty. And it appears my loop() is running very slowly and nothing is being drawn.

    Power cycling and things come up working again.

    Anybody know where this message might be coming from?

  25. #25
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    339
    NM, found it. (Wasn't searching in the right folder...)

    Apparently the 8876 isn't responding. Not sure why that might be intermittent on my side, but if it happens fo you from the start, Keith, it implies a problem with the RA8876 SPI and not the SSD2828.

    Do you have a scope or analyzer you can put on those pins?

Posting Permissions

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