Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 9 FirstFirst ... 2 3 4 5 6 ... LastLast
Results 76 to 100 of 204

Thread: RA8875 from Buydisplay

  1. #76
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Not sure why the 480x272 display is causing issues - I am using the 800x480 without problem with the Adafruit RA8875. I just updated my RA887_t4 with what I currently have on my desktop: https://github.com/mjs513/RA8875. Should not be too much different.

    The other display I am getting on Monday is a 480x272 display and then might be able to help more.

    EDIT: Just a sample of a few startup commands there do appear to be a few differences?

  2. #77
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 - I will double check what you have versus what I have... and see...

    Which Buydisplay one did you order? You obviously choose the faster shipment method (I did china post).. Should be here within the month.
    The new one I ordered is:
    Code:
    SPI 800x480 4.3'' TFT LCD Module Display Touch Panel Screen RA8875 
    Interface
    Pin Header Connection-4-Wire SPI
    Power Supply (Typ.)
    VDD=5.0V
    Touch Panel(Attached by default)
    4.3"Capacitive Touch Panel
    MicroSD Card Interface
    Pin Header Connection
    I have two of their 5" ones, which appear to sort of work on T3.6
    One of the 480x272 with resistive touch...
    One of the 800x480 with capacitive touch, where the touch is some ribbon cable hanging off end of display (larger part of ribbon going to looks like a miniature board and then to small ribbon connection...

    If I run the Adafruit test app with their library I see:
    Click image for larger version. 

Name:	IMG_0865.jpg 
Views:	6 
Size:	177.3 KB 
ID:	17429

    If I run your benchmark or the drawinTests program with RA8875, I see:
    Click image for larger version. 

Name:	IMG_0866.jpg 
Views:	6 
Size:	147.4 KB 
ID:	17430

    I am guessing maybe something to do with the back light setup, with the PWM stuff, but that looked sort of the same in code, although maybe slightly different?

  3. #78
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE
    This is my config (No sd card):
    Code:
    4.3"TFT LCD Display Module Controller Board w/Serial SPI,I2C,MCU 
    Interface
    Pin Header Connection-4-Wire SPI
    Power Supply (Typ.)
    VDD=5.0V
    Touch Panel(Attached by default)
    4.3"Resistive Touch Panel
    https://www.buydisplay.com/default/4...al-spi-i2c-mcu

    EDIT: I don't have the Backlight connected with my RA8875....

  4. #79
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    I don't have the backlight pin connected either, I think that it is done internal to the controller.

    Note: some differences between the two libraries:
    Adafruit uses SPI_MODE0, where as the RA8875 uses SPI_MODE3...

    Which when the SPI changes from MODE0 to MODE3, the first communications screw up... (CLOCK not at right spot... until first byte is output...)

    Tried two hacks yesterday:
    a) Switched to MODE0 as it works for Adafruit and the RA8875 library on ESP32 runs at Mode0...
    b) In the _initialize... method, right at start after SPI is initialized. Try doing an SPI.beginTransaction(..., SPI_MODE3); SPI.transfer(0); SPI.endTransaction(); with the CS not asserted...

    Neither helped so far...

  5. #80
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    Actually got it to work:

    If you use: tft.begin(RA8875_480x272)
    You end up with the problem I have.

    However if you use: tft.begin(Adafruit_480x272)

    It works...

  6. #81
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Damn - thought you read the wiki about using the adafruit RA8875. Sorry should have mentioned it again before you went through all this. Think its in the benchmark file I posted as well.

  7. #82
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 - I missed it

    But at least I learned a few things along the way

    FYI - I pushed up a modified version of your branch: https://github.com/KurtE/RA8875/tree/RA8875_t4_multi

    That hopefully allows us to run displays on SPI or SPI1 or SPI2 on T3.5/6 and T4.Click image for larger version. 

Name:	IMG_0868.jpg 
Views:	5 
Size:	166.2 KB 
ID:	17433

    Here is T4 running Adafruit one, and T3.6 running 800x480 BuyDisplay on SPI1...

  8. #83
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Way cool that you got it all working. Since you got it all working maybe I should delete my fork so we don't confuse the issue on versions for the T4. Not sure where to go from here with this display.

  9. #84
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    Or I could simply do a PR to your branch...

    What I find sort of interesting about this display and the libraries for using it, is things like, you hear that the display has smarts in it, so for example you can fill the whole screen with a color,
    For example in my editing of the LA stuff, I short handed it down to:
    Code:
    CMD: 0x91 0x00
    CMD: 0x92 0x00
    CMD: 0x93 0x00
    CMD: 0x94 0x00
    CMD: 0x95 0xDF
    CMD: 0x96 0x01
    CMD: 0x97 0x0F
    CMD: 0x98 0x01
    CMD: 0x63 0x00
    CMD: 0x64 0x00
    CMD: 0x65 0x00
    CMD: 0x90 0xB0
    Note: each CMD like this is actually 4 bytes output: 0x80 0x92 0x00 0x00
    So to fill screen took 44 bytes transferred... Not bad:
    However, the code waits for the display to be done:
    Code:
    /**************************************************************************/
    void RA8875::fillWindow(uint16_t color)
    {  
    	_line_addressing(0,0,RA8875_WIDTH-1, RA8875_HEIGHT-1);
    	setForegroundColor(color);
    	writeCommand(RA8875_DCR);
    	_writeData(0xB0);
    	_waitPoll(RA8875_DCR, RA8875_DCR_LINESQUTRI_STATUS);
    	#if defined(USE_RA8875_SEPARATE_TEXT_COLOR)
    		_TXTrecoverColor = true;
    	#endif
    }
    And this does a lot of SPI transfers and takes a lot of time... Example:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	5 
Size:	43.3 KB 
ID:	17434
    That little region to the far left between A2 and A1 is the command output, the rest of this area, is the system polling the display are you done yet...

  10. #85
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Not sure if there is a way around that one unless you used something like a circular buffer for the commands so when one command finishes the other is dequed and executed. Just speaking my thoughts out loud here - really would have to look at the manual to what could be done.

  11. #86
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 and hopefully others who actually use these displays...

    Yes it is unclear to me how one would best use these displays...

    This simplest way is what is done here: Issue command, wait until it completes...
    Another approach might be: <wait until not busy> issue next command...

    But again not sure how one uses these... Example with my stuff that supports multiple SPI busses, one could have a display on each one, example 2 or 3 on T4 (or T3.5/6) and then you might want to issue things like fill screen on all of the displays... Current way would only have one update at a time... But again I am only playing, and don't have any plans to actually use these...

    Likewise, I think these displays have an IO pin called WAIT, which I think is supposed to tell when the RA8875 is busy. So far I don't think the library does anything to use this possible capability? Not sure if one wanted to use it, if best to poll it (versus) doing SPI polling, or could setup ISR? ...

    Anyway not sure how far to take any of this, as not sure if any of these changes will make it into anything someone will find?

  12. #87
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Just posted this on the other thread for the RA8875:
    WAIT - output to indicate that the RA8875 is in a busy state. The RA8875 can't communicate with the microcontroller when the wait pin is active. It is active low and could be used by the microcontroller to poll busy status.
    Yes you can put it into some sort of ISR maybe but don't think any of the other RA8875 from BuyDisplay have an equivalent pin.

    An I am with you - I really don't use this display except to experiment with so not sure where to go from here except to make sure the library works with the T4 and maybe a tweek or two.

  13. #88
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 - I am sort of curious so may hook up LA to my Adafruit board which has it clearly marked and a breakout pin already soldered in it...

    I believe it is also on my BuyDisplay 5" boards (ER-TFTM050...) on I believe on Pin9 of the JP3 connector.
    And I believe it is on Pin 9 of the new 4.3" board, which will arrive someday...

  14. #89
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Should be interesting to see if the JP3 connector pins work - looked at the datasheet for the 5" display and it looked like JP3 was for the parallel interface.

  15. #90
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    As an FYI - I hooked up the 480x272 Buydisplay... version, modified the benchmark app, to use the right pins, begin... And hooked up LA...

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	4 
Size:	43.7 KB 
ID:	17440

    The bottom (green) line is hooked up to pin 9 of that connector, you can see the quick busy settings for each group of commands output to fill screen, followed by a long down time
    which pretty well corresponds to the busy status returned by the query...

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	4 
Size:	56.1 KB 
ID:	17441

    As you can see in this more closeup version. Also notice that they change the clock speed to read the data back (40 command), versus issuing the query(80 command byte)...

  16. #91
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    Although maybe it is not something to worry much about...
    That is I adapted the simple program to count how many times per second I could do a fill screen
    Code:
    #include <SPI.h>
    #include <RA8875.h>
    
    #define DELAY_BETWEEN 500
    //#define USE_SPI1
    
    
    /*
      Teensy3.x and Arduino's
      You are using 4 wire SPI here, so:
      MOSI:  11//Teensy3.x
      MISO:  12//Teensy3.x
      SCK:   13//Teensy3.x
      the rest of pin below:
    */
    #ifdef USE_SPI1
    
    #define RA8875_INT 3//any pin
    #define RA8875_CS  10//restriction for Teensy3 and CS
    #define RA8875_RST -1//any pin
    #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
    #define RA8875_MOSI 0
    #define RA8875_MISO 1
    #define RA8875_SCLK 32
    #elif defined(__IMXRT1062__)
    #define RA8875_MOSI 26
    #define RA8875_MISO 1
    #define RA8875_SCLK 27
    #endif
    #else
    #define RA8875_INT 3//any pin
    #define RA8875_CS  10//restriction for Teensy3 and CS
    #define RA8875_RST 9//any pin
    #define RA8875_MOSI 11
    #define RA8875_MISO 12
    #define RA8875_SCLK 13
    #endif
    /*
      Teensy 3.x can use: 2,6,9,10,15,20,21,22,23
    */
    
    RA8875 tft = RA8875(RA8875_CS, RA8875_RST, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);
    
    void setup() {
      Serial.begin(38400);
      long unsigned debug_start = millis ();
      while (!Serial && ((millis () - debug_start) <= 5000)) ;
      Serial.printf("CS:%u RST:%u, MOSI:%u SCLK:%u MISO:%u\n", RA8875_CS, RA8875_RST, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);
      //
      //  tft.begin(RA8875_800x480);
      tft.begin(RA8875_480x272);
      //  tft.begin(Adafruit_800x480);
      //  tft.begin(Adafruit_480x272);
    }
    
    uint16_t color_list[] = {RA8875_RED, RA8875_GREEN, RA8875_BLUE, RA8875_WHITE, RA8875_BLACK,
                             RA8875_YELLOW, RA8875_MAGENTA, RA8875_CYAN
                            };
    void loop() {
      uint16_t color_index = 0;
      uint16_t frame_count = 0;
      elapsedMillis em = 0;
    
      // How many frames per second? 
      while (em < 1000) {
        tft.fillWindow(color_list[color_index++]);
        if (color_index >= (sizeof(color_list)/sizeof(color_list[0]))) color_index = 0;
        frame_count++;
      }
      Serial.printf("Frames: %d in %d ms\n", frame_count, (uint32_t)em);  
    }
    It is returning about 202 frames per second

  17. #92
    Member
    Join Date
    Nov 2017
    Location
    Belgium
    Posts
    88
    Quote Originally Posted by mjs513 View Post
    Yes you can put it into some sort of ISR maybe but don't think any of the other RA8875 from BuyDisplay have an equivalent pin.
    I've checked the datasheets of every RA8875 lcd from BuyDisplay. They all without exception have a WAIT pin.

    Displays with integrated capacitive touch controller have a 40pin connector for parallel & serial communication.

    Displays with a loose ffc cable for the capacitive touch controller have a 30pin connector for parallel communication and a 8pin connector for serial coms.

    In both cases WAIT is on pin 9 of the large connector.
    They also have an INT line on pin10, which can be configured to fire when the moving/filling BTE function is completed.

  18. #93
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    Quote Originally Posted by neurofun View Post
    I've checked the datasheets of every RA8875 lcd from BuyDisplay. They all without exception have a WAIT pin.

    Displays with integrated capacitive touch controller have a 40pin connector for parallel & serial communication.

    Displays with a loose ffc cable for the capacitive touch controller have a 30pin connector for parallel communication and a 8pin connector for serial coms.

    In both cases WAIT is on pin 9 of the large connector.
    They also have an INT line on pin10, which can be configured to fire when the moving/filling BTE function is completed.
    @nuerofun
    That's good to know - so if we make any changes in the future at least we know that it will apply to all RA8875 displays regardless of configuration (parallel or serial).

  19. #94
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    202 frames per second on fills is not too bad from my perspective but then I don't use this display enough to know if that's good or bad. Have to check with the other displays out of curiosity

  20. #95
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 - It is the same test program (other then modified for name changes...) as I tried with the SSD1351 - With my SSD1351 using registers, I got about 71FPS... For a 220x220 display and the one I timed was the 480x222.


    If I run the test again on T3.6 to my 800x480 Ra8875 display I am getting about 61FPS

  21. #96
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Interesting - I am getting about 16 FPS on the ST7789 (340x220), on the ST7735 getting 72 fps (128x128). This is on a T4

    SSD1351 (128x128) on t4 = 58fps (stock)
    Last edited by mjs513; 09-01-2019 at 09:02 PM.

  22. #97
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    @mjs513 I was wrong above on the speed of the SSD1351 or more specifically the number of pixels 128x128 - Which from an earlier thread:
    https://forum.pjrc.com/threads/57383...l=1#post213849

    So if ST7735 is getting 72fps(128*128), I would expect(72*((128*128)/(340*220))) = 15.77... So your observed feels correct...

  23. #98
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    Thanks for that. Brings up a good point when we doing timing comparisons - need to normalize them as you did if we are using different display resolutions.

  24. #99
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,316
    What is interesting about all of these different displays is some are good for some things and some are good for other things.

    That is the RA8875 has many of it's primitives are accelerated, so they run fast. Things like fillRectangle... But as for drawing images, so far they sort of suck... Note: Sumotoy in wiki mentioned it as well.

    I was curious, so I took the quick and dirty app, that I had for ILI9341 that has three images built into the program (T4 card, front, back and front of chip...) and draw them on the screen.
    I left the image sized for ili9341 (240x320)... And I did a quick and dirty version of the program...T4_RA8875_pictureEmbed-190902a.zip

    Which draws the actual image real small. So far I don't see anything like a drawRect.
    There is a drawPixels function, which is not working for me.

    The quick and dirty function for outputting the image:
    Code:
    void drawImage(uint16_t image_width, uint16_t image_height, uint16_t *image, uint16_t bgColor)  {
      // first lets fill in part of screen that our image does not cover
      uint16_t start_x = (tft.width() - image_width) / 2;
      uint16_t start_y = (tft.height() - image_height) / 2;
    
      tft.fillRect(0, 0, tft.width(), start_y, bgColor);  // top;
      tft.fillRect(0, start_y, start_x, image_height, bgColor); // left 
      tft.fillRect(start_x + image_width, start_y, tft.width()-(start_x+image_width), image_height, bgColor); // right
      tft.fillRect(0, start_y+image_height, tft.width(),tft.height()-(start_y+image_height), bgColor);  // top;
    
      // now lets draw out each of the lines of the image...
    #if 1
      for (uint16_t y = start_y; y < (start_y+image_height); y++) {
        for (uint16_t x = start_x; x < (start_x+image_width); x++) {
          tft.drawPixel(x, y, *image++);
        }
      }
    #else
      for (uint16_t y = start_y; y < (start_y+image_height); y++) {
        tft.drawPixels(image, image_width, start_x, y);
        image += image_width;    
      }
    #endif
    }
    Edit: Note: Probably related to: https://github.com/sumotoy/RA8875/issues/143 (Image rotation in RA8875 )

  25. #100
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    3,968
    @KurtE

    If I look at the drawRect function in the Adafruit version its function is a bit different than whats in the Sumotoy version - duplicated here so you don't have to go looking - they do it differently for other helpers as well not sure which is faster:
    Code:
    /**************************************************************************/
    /*!
          Helper function for higher level rectangle drawing code
    */
    /**************************************************************************/
    void Adafruit_RA8875::rectHelper(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color, bool filled)
    {
      x = applyRotationX(x);
      y = applyRotationY(y);
      w = applyRotationX(w);
      h = applyRotationY(h);
    
      /* Set X */
      writeCommand(0x91);
      writeData(x);
      writeCommand(0x92);
      writeData(x >> 8);
    
      /* Set Y */
      writeCommand(0x93);
      writeData(y);
      writeCommand(0x94);
      writeData(y >> 8);
    
      /* Set X1 */
      writeCommand(0x95);
      writeData(w);
      writeCommand(0x96);
      writeData((w) >> 8);
    
      /* Set Y1 */
      writeCommand(0x97);
      writeData(h);
      writeCommand(0x98);
      writeData((h) >> 8);
    
      /* Set Color */
      writeCommand(0x63);
      writeData((color & 0xf800) >> 11);
      writeCommand(0x64);
      writeData((color & 0x07e0) >> 5);
      writeCommand(0x65);
      writeData((color & 0x001f));
    
      /* Draw! */
      writeCommand(RA8875_DCR);
      if (filled)
      {
        writeData(0xB0);
      }
      else
      {
        writeData(0x90);
      }
    
      /* Wait for the command to finish */
      waitPoll(RA8875_DCR, RA8875_DCR_LINESQUTRI_STATUS);

Posting Permissions

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