Forum Rule: Always post complete source code & details to reproduce any issue!
Page 25 of 25 FirstFirst ... 15 23 24 25
Results 601 to 623 of 623

Thread: ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

  1. #601
    Whenever I change the spi clock, something changes in the configuration. Is that normal?

    20:04:34.989 -> HX8357 Test!
    20:04:34.989 -> _t3n::begin mosi:11 miso:12 SCLK:13 CS:10 DC:9 SPI clocks: 20000000 2000000
    20:04:34.989 -> T4 setup CS/DC
    20:04:35.601 -> _t3n::begin - completed
    20:04:35.695 -> Display Power Mode: 0x80
    20:04:35.695 -> MADCTL Mode: 0x0
    20:04:35.695 -> Pixel Format: 0x87
    20:04:35.695 -> Image Format: 0x87
    20:04:35.695 -> Self Diagnostic: 0x87
    20:04:35.695 -> Benchmark Time (microseconds)
    20:04:35.695 -> Screen fill 615109
    20:04:36.526 -> Text 126456
    20:04:37.374 -> Lines 187222
    20:04:38.817 -> Horiz/Vert Lines 50861
    20:04:39.194 -> Rectangles (outline) 28441
    20:04:39.523 -> Rectangles (filled) 1486488
    20:04:41.354 -> Circles (filled) 193503
    20:04:41.682 -> Circles (outline) 152359
    20:04:42.060 -> Triangles (outline) 39841
    20:04:42.390 -> Triangles (filled) 491160
    20:04:43.275 -> Rounded rects (outline) 62436
    20:04:43.651 -> Rounded rects (filled) 1622392
    20:04:45.575 -> Done!

  2. #602
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    I will try running one of them.

    But in all cases like this, I would also look for a reset pin on your display. Many cheap ones let these float, so if they are not connected or the like nothing works.
    I see in DEV_Config.h it is pin 8 by default...

    Try making sure you have one defined and it is connected the the Reset signal of your display

  3. #603
    I connected the reset pin of the display to PIN 15 from Teensy. Unfortunately pin 8 is occupied. Of course I defined the pin: #define TFT_RST 15
    Unfortunately I don't know how to find out if the pin on the display is really connected to it.

    Edit: Reset seems to work.
    20:43:25.080 -> HX8357 Test!
    20:43:25.080 -> _t3n::begin mosi:11 miso:12 SCLK:13 CS:10 DC:9 SPI clocks: 30000000 2000000
    20:43:25.080 -> T4 setup CS/DC
    20:43:25.671 -> _t3n::begin - completed
    20:43:25.766 -> Display Power Mode: 0x80
    20:43:25.766 -> MADCTL Mode: 0x80
    20:43:25.766 -> Pixel Format: 0x87
    20:43:25.766 -> Image Format: 0x87
    20:43:25.766 -> Self Diagnostic: 0x87
    20:43:25.766 ->
    20:43:25.766 -> Reset Display
    20:43:25.766 ->
    20:43:25.907 -> After Reset Display:
    20:43:25.907 -> Display Power Mode: 0x80
    20:43:25.907 -> MADCTL Mode: 0x80
    20:43:25.907 -> Pixel Format: 0x87
    20:43:25.907 -> Image Format: 0x3
    20:43:25.907 -> Self Diagnostic: 0x87
    20:43:25.907 -> Done!

  4. #604
    Another question: I need a 4 inch display that works with the Teensy 4.0. Do you have a tip? SPI would be desirable.
    Thanks

  5. #605
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    Again first try running the wave share software with this and see if it works.

    Also If I look at pictures of your module, I am assuming that you changed the dip switches on the display to use SPI pins on 11-13 and not use the ICSP pins?


    It will be interesting to see how different this controller is. I do have their example outputting on T4, looking at its outputs on Logic Analyzer. And I am wondering if some of the basics are different. Example how to output the bounds for writing data to a rectangle.

    Example:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	8 
Size:	85.5 KB 
ID:	19416
    It shows like: 0x2a 0 0 0 0 0 1 0 df 0x2b ...
    It is like the min/max values are 4 bytes each but only probably lower byte of each 0-1df would be my guess.

  6. #606
    Quote Originally Posted by KurtE View Post
    Also If I look at pictures of your module, I am assuming that you changed the dip switches on the display to use SPI pins on 11-13 and not use the ICSP pins?
    Yes i did.

    I will try the wave share software again

    Looks crazy what you're doing.

  7. #607
    Quote Originally Posted by sepp89117 View Post
    I will try the wave share software again
    The program (Waveshare GraphicsTest) outputs information via serial monitor. The display remains white.

    21:16:33.194 -> Benchmark Time (microseconds)
    21:16:33.194 -> Screen fill 798811
    21:16:34.501 -> Text 29693
    21:16:37.700 -> Lines 623475
    21:16:41.316 -> Rectangles (outline) 37110
    21:16:42.014 -> Rectangles (filled) 1947188
    21:16:44.635 -> Circles (filled) 225063
    21:16:45.010 -> Circles (outline) 267299
    21:16:45.803 -> Done!
    21:16:45.803 -> 3928639

  8. #608
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    Note: I could be completely off here, but some of their stuff looks WRONG...

    In particular: look at LCD_Driver.cpp at the function

    Code:
    void LCD_WriteData(uint8_t Data)
    {
        LCD_DC_1;
        LCD_CS_0;
        SPI4W_Write_Byte(Data >> 8);
        SPI4W_Write_Byte(Data & 0XFF);
        LCD_CS_1;
    }
    You pass in a byte so the firsrt write will always be 0... followed by the real bytes...
    what happens if you get rid of that first write?
    Code:
    void LCD_WriteData(uint8_t Data)
    {
        LCD_DC_1;
        LCD_CS_0;
        SPI4W_Write_Byte(Data);
        LCD_CS_1;
    }
    Again this is their library. So again make sure your CS, DC, SPI... RESET all match the pin numbers in their config file

  9. #609
    Good morning from Germany! It seems we are working with different libs. Sorry that I have not clearly stated what I am working with. The display on the Mega worked with the lib available here: https://github.com/MHotchin/Waveshar...ree/master/src
    Later I will look at the lib you looked at.

  10. #610
    Quote Originally Posted by KurtE View Post
    Note: I could be completely off here, but some of their stuff looks WRONG...

    In particular: look at LCD_Driver.cpp at the function

    Code:
    void LCD_WriteData(uint8_t Data)
    {
        LCD_DC_1;
        LCD_CS_0;
        SPI4W_Write_Byte(Data >> 8);
        SPI4W_Write_Byte(Data & 0XFF);
        LCD_CS_1;
    }
    KurtE -- while their driver leaves a lot to be desired, in this particular case I don't think LCD_WriteData() is actually wrong. Inefficient and inconsistent, perhaps! LCD_WriteData() is generally used for 8bit ILI9486 register accesses via a 16-bit 8080 (parallel) interface, so that function is just zero-padding the bus. It would have been clearer if they had deliberately shown a MSB forced to 0x00, rather than copying & pasting the same half-word SPI code used elsewhere. To perform the actual 16-bit RGB565 SPI accesses, the full 16-bit data is generally driven by the LCD_Write_AllData() API, which does indeed accept a uint16_t.

    BTW, the "Waveshare_ILI9486" library was just my quick GFX-style wrapper upon the official driver. MHotchin has provided an alternate rewrite that is more efficient & GFX-API complete (I have proposed merging the libs & retain his updates to avoid confusion).

  11. #611
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    But again have you tried the changes I suggested to see if anything shows up using the Teensy?

    Again why I asked was if you look back a few postings to #605 you will see the Logic analyzer output, which if you remember I mentioned looked wrong! With that change it looks more like:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	4 
Size:	65.0 KB 
ID:	19421

    Now you see the: 2a followed by 4 bytes (2 bytes for x Start, 2 bytes for x end) followed by 0x2b again 4 bytes (y start, y end) followed by 2c (write memory)...
    This is the same as I see for ILI9488, ILI9341, H8357, ST7789. ST7735 is similar except as both directions are less than 256, the X and Y coordinates are one byte each...

    And note from the sources, I suspected this when you look at the code that outputs it:
    Code:
    void LCD_SetWindow(POINT Xstart, POINT Ystart,	POINT Xend, POINT Yend)
    {
        //set the X coordinates
        LCD_WriteReg(0x2A);
        LCD_WriteData(Xstart >> 8);	 				//Set the horizontal starting point to the high octet
        LCD_WriteData(Xstart & 0xff);	 				//Set the horizontal starting point to the low octet
        LCD_WriteData((Xend - 1) >> 8);	//Set the horizontal end to the high octet
        LCD_WriteData((Xend - 1) & 0xff);	//Set the horizontal end to the low octet
    
        //set the Y coordinates
        LCD_WriteReg(0x2B);
        LCD_WriteData(Ystart >> 8);
        LCD_WriteData(Ystart & 0xff );
        LCD_WriteData((Yend - 1) >> 8);
        LCD_WriteData((Yend - 1) & 0xff);
        LCD_WriteReg(0x2C);
    }

  12. #612
    Quote Originally Posted by KurtE View Post
    But again have you tried the changes I suggested to see if anything shows up using the Teensy?
    Yes, now i did. I tested the "ImpulseAdventure / Waveshare_ILI9486" lib with the Teensy.
    Before that, I adjusted the pins in DEV_Config.
    Code:
    //LCD
    #define LCD_CS 10
    #define LCD_CS_0        digitalWrite(LCD_CS, LOW)
    #define LCD_CS_1        digitalWrite(LCD_CS, HIGH)
    
    #define LCD_BL 16
    
    #define LCD_RST 15
    #define LCD_RST_0       digitalWrite(LCD_RST, LOW)
    #define LCD_RST_1       digitalWrite(LCD_RST, HIGH)
    
    #define LCD_DC 9
    #define LCD_DC_0        digitalWrite(LCD_DC, LOW)
    #define LCD_DC_1        digitalWrite(LCD_DC, HIGH)
    The display remains white. The code is running

    Edit: Same with
    Code:
    void LCD_WriteData(uint8_t Data)
    {
        LCD_DC_1;
        LCD_CS_0;
        SPI4W_Write_Byte(Data);
        // SPI4W_Write_Byte(Data >> 8);
        // SPI4W_Write_Byte(Data & 0XFF);
        LCD_CS_1;
    }
    Last edited by sepp89117; 03-20-2020 at 05:48 PM.

  13. #613
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    6,331
    Sorry, not sure what else definitive to try at this point.

    Again sort of drawing at straws. For example how is your backlight setup? It appears like it is setup to do PWM on pin 9 by default. And at least looking at output on Arduino mega it has a duty cycle of about 40% Again I believe you said you connected it through resistor. So probably not issue, but...

    I would probably experiment with adding more delays in the init code.
    Example in the LCD_InitReg, what happens if you add something like a delay(1) after each command group:

    Code:
        LCD_WriteReg(0XF9);
        LCD_WriteData(0x00);
        LCD_WriteData(0x08);
        delay(1);
    
        LCD_WriteReg(0xC0);
        LCD_WriteData(0x19);//VREG1OUT POSITIVE
        LCD_WriteData(0x1a);//VREG2OUT NEGATIVE
        delay(1);
    
        LCD_WriteReg(0xC1);
        LCD_WriteData(0x45);//VGH,VGL    VGH>=14V.
        LCD_WriteData(0x00);
        delay(1);
    
    ...
    Maybe also in a few places in the LCD_Init method which calls the initReg... It already has some delays,
    but maybe it needs another delay after the turn on display call...

    Again the issue could be that the timings are way different

  14. #614
    Hi there

    a good idea with the delays but unfortunately it doesn't work.

    Today I had the idea to connect an ili9341. Without changes to the code or lib. Lo and behold, the display shows at least reaction. Of course, the configuration and the resolution are not correct, but it reacts continuously. I don't get anything from the ili9486, just white.
    I'd say it's broken if it wouldn't work with the mega 100% ...
    PS: I also tried the ICSP header on the ili9486 board a few days ago with the toggle switches. Because these are used on the mega. Of course it didn't work either.

    I will now take a closer look at the ili9486 board. I suspect the trap is there.

  15. #615
    Is it a problem that I have not connected CS from the Touch and CS from the SD card?
    Because, of course, SD card, touch and display are connected to the same MISO and MOSI. However, I only use the display for testing.
    Maybe the shift registers cannot work without the CS of the other two?

  16. #616
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,932
    Yes, the CS line must be properly driven high to silence devices on the common bus and pulled low to actually communicate to a single selected device. If those lines are floating either or both could be ignoring or talking uncontrollably if not properly controlled on each transaction.

    This link has some details that may help: pjrc.com/better-spi-bus-design-in-3-steps/

  17. #617
    Okay thanks. I have already installed a pullup. Not working.

    But graphicstest output changes to
    10:39:43.406 -> ILI9488_t3n: (T4) SPI automatically selected
    10:39:43.406 ->
    10:39:43.406 -> MOSI:11 MISO:12 SCK:13
    10:39:43.406 -> ILI9488 Test!
    10:39:43.406 -> Display Power Mode: 0xFF
    10:39:43.406 -> MADCTL Mode: 0xFF
    10:39:43.406 -> Pixel Format: 0xFF
    10:39:43.406 -> Image Format: 0xFF
    10:39:43.406 -> Self Diagnostic: 0xFF
    Last edited by sepp89117; 03-21-2020 at 09:40 AM.

  18. #618
    Thank you! I will now put the display in the trash.
    I connected it again to the mega. It worked and suddenly stopped. Now nothing works anymore.

    I have now ordered an ST7796S. As I read, it should be controlled just like an ILI9342. Delivery time can be 4 weeks.
    https://www.amazon.de/gp/product/B07...?ie=UTF8&psc=1

  19. #619
    Quote Originally Posted by KurtE View Post
    Again why I asked was if you look back a few postings to #605 you will see the Logic analyzer output, which if you remember I mentioned looked wrong! With that change it looks more like:
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	4 
Size:	65.0 KB 
ID:	19421

    Now you see the: 2a followed by 4 bytes (2 bytes for x Start, 2 bytes for x end) followed by 0x2b again 4 bytes (y start, y end) followed by 2c (write memory)...
    This is the same as I see for ILI9488, ILI9341, H8357, ST7789. ST7735 is similar except as both directions are less than 256, the X and Y coordinates are one byte each...
    The use of the pair of 74HC4094 shift registers to emulate a SPI interface on the 8080-16 wired ILI9486 makes things interesting. Without access to the full schematic (in particular the wiring involving WRX & SCLK at the ILI9486 interface) it’s hard to confirm, but my thought was that your proposed change may indeed still shift & present the same values into D[7:0] as in the original code but I wasn’t confident yet that we’d see WRX latch at the same time as with the original code.

    As you said, there’s no substitute for trying it out on the hardware I should have access to the Waveshare & T4 on Monday evening and so may be able to take a look later if there was still any interest (though perhaps less so now that sep89117 has indicated concerns over his particular module).

    Thanks again KurtE for sharing your ideas on the setup

  20. #620
    I am sure that the display is broken. It was suddenly white and flickered slightly. I tried everything to get it back ...
    If it helps you, I can tell you the imprint on the registers.

  21. #621
    Senior Member JarkkoL's Avatar
    Join Date
    Jul 2013
    Posts
    112
    Quote Originally Posted by sepp89117 View Post
    Another question: I need a 4 inch display that works with the Teensy 4.0. Do you have a tip? SPI would be desirable.
    Thanks
    I got this 3.5" 480x320 TFT working with Teensy 4.0. It's 8-bit parallel though not SPI.

  22. #622
    Hello everybody!
    Coincidentally, is anyone interested in an image editing program that can import from C as well as export to C? So it specializes in graphics creation for Arduino based systems.
    I have been working on it for a few days now and would be happy to find beta testers
    It is written with C# .NET in Visual Studio. I can of course provide the source code and also a compiled executable for Windows.
    Click image for larger version. 

Name:	Capture 2020-03-25 170049.png 
Views:	4 
Size:	62.2 KB 
ID:	19480
    I also developed a new type of Exprt to C. With simple bitmaps (many pixels with the same color) it can save up to 99% memory (bitmaps like the one in the picture as an example). It is rather unsuitable for images with color gradients or strong noise.

    I am looking forward to your feedback

  23. #623
    Senior Member JarkkoL's Avatar
    Join Date
    Jul 2013
    Posts
    112
    What I do with images, is to save them in png/jpg/etc from Photoshop and have a command line tool to convert the file to .h in given format.

Posting Permissions

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