Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ili9488 cannot be full screen #22

Open
shangjiazi opened this issue Apr 11, 2023 · 20 comments
Open

Ili9488 cannot be full screen #22

shangjiazi opened this issue Apr 11, 2023 · 20 comments

Comments

@shangjiazi
Copy link

I have an esp32 and ili9488 connected in parallel, which have successfully lit up with your code, but did not fill the entire screen. When I tried to modify the resolution and chip model, it went black. Requesting help, what file should I use to make the screen full and display? thank you

@bradmck
Copy link
Contributor

bradmck commented Apr 12, 2023

I'm not sure if this will help you, but you can try the code I talk about in this post: Issue 15

You'd want to use the user_build_flags option and then specify all of the parameters needed for your display.

@shangjiazi
Copy link
Author

shangjiazi commented Apr 14, 2023

Thank you for your reply. I conducted the experiment using this method. When I set it to ST7789 and set the pixel size to 170 * 320, it is displayed normally. But it doesn't apply to my screen. My screen is ILI9488. When I changed to ILI9488 and changed the pixel size to 320 * 480, it turned black,... If I only change the pixels, it will also fail, and if I only change the chip model, it will also fail.

This is the code that failed me:

display:
  - platform: tdisplays3
    id: disp
    update_interval: 1s
    rotation: 270
    user_build_flags:
      - USER_SETUP_LOADED=1
      - ILI9488_DRIVER
      # - INIT_SEQUENCE_3
      # - CGRAM_OFFSET
      # - TFT_RGB_ORDER=TFT_RGB
      # - TFT_INVERSION_ON=1 
      - TFT_PARALLEL_8_BIT
      - TFT_WIDTH=320
      - TFT_HEIGHT=480
      - TFT_CS=33
      - TFT_DC=15 
      - TFT_RST=32 
      - TFT_WR=4
      - TFT_RD=2 
      - TFT_D0=12 
      - TFT_D1=13 
      - TFT_D2=26 
      - TFT_D3=25 
      - TFT_D4=17 
      - TFT_D5=16 
      - TFT_D6=27 
      - TFT_D7=14 
      - LOAD_GLCD=1 
      - LOAD_FONT2=1 
      - LOAD_FONT4=1 
      - LOAD_FONT6=1 
      - LOAD_FONT7=1 
      - LOAD_FONT8=1 
      - LOAD_GFXFF=1 
      - SMOOTH_FONT=1

@shangjiazi
Copy link
Author

tft-spr
I have found the problem and successfully displayed it by replacing the original "spr" with "tft" at the marked position. I am a novice, may I ask what the problem is?

@patfelst
Copy link

I think you need to add expose_tft_objects: true like this:

display:
  - platform: tdisplays3
    id: disp
    update_interval: 1s
    rotation: 270
    expose_tft_objects: true

@patfelst
Copy link

@guillempages
Copy link
Collaborator

@shangjiazi I don't have an ILI9488 display to test, and I'm not sure exactly how it works. Maybe it doesn't have sprite support, and that's why the "spr" calls do not work?

@bradmck
Copy link
Contributor

bradmck commented Apr 15, 2023

I'm surprised the current version of this repo works at all since it's using hard-coded driver, pins, etc. I suggested my branch just since it lets you custom define all of the device settings and therefore may just work with any display supported by the current TFT_eSPI. I also don't have one of these and am not sure why the spr calls don't work. I'm curious though, how's the refresh drawing directly to the TFT? Does it flash at all?

And did you try using the ST7789 driver with 320 * 480?

@patfelst
Copy link

Did you have the USER_SETUP_ID set to 146 as indicated (here)? In your code above you show it set to 1.

Also on the TFT_eSPI github page it says:

  1. Support for the ESP32-S2, ESP32-S3 and ESP32-C3 has been added (DMA only on ESP32 S3 at the moment).

I don't know if DMA works with ESPHome.

@shangjiazi
Copy link
Author

Why TFT_ WIDTH=170 can only be 170, "sprite" can only work properly, I don't know where the error is? Very distressed

@guillempages
Copy link
Collaborator

guillempages commented Apr 16, 2023 via email

@shangjiazi
Copy link
Author

@guillempages Another interesting thing to discover is that if you still fill in the size of "ST7789" after "spr. createSite" in "tdisplay_s3. h", it will still display normally. Do you need to modify it somewhere to make it full screen?
22222222222222
333333333333

@shangjiazi
Copy link
Author

@guillempages I don't think it's a memory issue. If I change it to 171, it will also fail. Can only be 170. Among these programs, where else is there a fixed area related to "st7789" that needs to be modified?

@bradmck
Copy link
Contributor

bradmck commented Apr 16, 2023

Have you used this board/display with any basic Arduino/PlatformIO sketches (with TFT_eSPI)? On your question of where the dimensions are set.... If you are using my Beta branch there's only one spot that I set the width and height, and that's only if you don't specify user_build_flags:. That's in the display.py file:

        cg.add_build_flag("-DTFT_WIDTH=170")
        cg.add_build_flag("-DTFT_HEIGHT=320")

@shangjiazi
Copy link
Author

@guillempages You are right, asking the spirit to create a 320 * 480 does require a lot of memory, so I can only add "spr. setColorDepth (1);" to reduce memory usage. It successfully displayed. Thank you for your help. The success of ILI9488 means that this great library will support many TFT parallel port screens

@bradmck
Copy link
Contributor

bradmck commented Apr 19, 2023

@shangjiazi - I'm working to add a color_depth: option to my Beta branch but I'm a bit of an idiot with this stuff so it's not quite working yet. :) I'll reply here when that's ready if you're interested in testing. My beta branch is the one that also allows specifying user_build_flags for the TFT_eSPI library.

@bradmck
Copy link
Contributor

bradmck commented Apr 20, 2023

My Beta branch now supports a color_depth: option. Valid choices are 1, 4, 8, and 16. Default is 8. I've done very little testing but it seems to work.

@shangjiazi
Copy link
Author

@bradmck It has been tested and it has been successful. excellent. Suggest renaming your "Beta branch" to make it more widely known. It does not fully support "tdisplays3" and "ST7789", and all "tft_espi" serial ports are supported

@bradmck
Copy link
Contributor

bradmck commented Apr 21, 2023

@shangjiazi - I'm glad that worked for you but I'm not quite ready with that branch. In theory since you can specify your own settings for TFT_eSPI it's quite possible that it will work with any display supported by that library. But I don't have any other displays to test with at this point. I'm not sure what you mean by your reference to "serial ports are supported"? It technically should work for both serial and parallel displays.

@shangjiazi
Copy link
Author

@bradmck Nice to have a conversation with you again. Your code has indeed helped me a lot and has become my pleasure. I have made modifications to my code. Due to memory issues, you have added the "color_depth:" setting to the original code. I have made new progress again because memory cannot create 320 * 480 "eSprines", but two 320 * 240 "eSprines" can be created. It can achieve 8-bit 'color_depth', and we only need to_ display_ S3. h Create two eSpites and let it determine which "eSpite" to push to.

I am using translation software to communicate with you, hoping to arouse everyone's interest.

@clowrey
Copy link

clowrey commented May 4, 2023

I'm curious what display board do you have there? Or is it something custom?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants