-
Notifications
You must be signed in to change notification settings - Fork 274
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
ST7796S Support #160
Comments
This page here seems to indicate that this controller will work quite well: They list a maximum SPI speed of 125MHz. I don't know for sure if that will apply to the display I have purchased, but it leaves me optimistic. They also have examples for how to get this display working on the Raspberry Pi, so that's another good sign. |
I got the screen yesterday. I was hoping I'd at least get a good head start from the info on the page linked to above: http://www.lcdwiki.com/MHS-4.0inch_Display-B But no such luck. I'm still optimistic that it will be a good starting point for me, though perhaps the display controller datasheet will prove more useful in the long run. I tried using the pre-built images they provide on the page, but I wasn't able to get anything besides a white screen, and sometimes when I restarted, I'd manage to get a bit of noise on the screen. Aside from that though, no progress. I'm still learning how SPI displays work, but I started digging into config.txt, and it looks like it gets setup on this line:
Digging around yields the device tree files, One thought that I had is that maybe the screen I got can't handle the extremely high SPI bus speed that the pre-built image is configured to (125MHz). They're getting 50FPS without any extra tricks. I'm not sure where I'd go to turn down the bus speed, but hopefully I can figure it out. |
I was able to decompile the dtb and dtbo files using dtc |
I was able to fix this problem in my latest commit. If I use the following cmake options, everything displays correctly:
I'm actually quite pleasantly surprised. The display seems to run just fine at 100MHz (400MHz/4), and could maybe be driven even faster (I haven't played around with the divisor settings too much. However, I'm still having a few more issues. I'm getting all kinds of ghosting and mild tearing when things are in motion. I suspect that the Pi is perhaps handing over data faster than the controller is putting it out onto the LCD? Honestly, it's hard to say. @juj perhaps you might have a better idea as to what's causing the problems? The pi seems to be pushing out 60fps without any major hiccups. I'm including some pictures of this behavior: As you can see in the following photo, if the game is paused, the display looks flawless otherwise: I really hope we can figure this out, since this is a very affordable display, and it's 4" and 480x320! It would be perfect for so many portal raspberry pi projects. |
I was able to fix the tearing issues by using the frame rate values from the device tree files linked above. All my changes are on the latest commit on the fork I made. Just tested with a clean build on my Pi and I was able to use the display without any issues. Here's the options I used for CMAKE with the latest commit:
Once my pull request gets approved, this issue should be resolved. |
Thanks for working on that support. I went ahead and ordered the same display from AliExpress, it will take some weeks to arrive. It does look like an impressive 480x320 display controller, probably on the level of the Tontec one that is no longer in sale. |
hello @furrysalamander and @juj great work! i have buy this screen and i try with the ILI9486 (in the tittle its wrote ST7796S/ILI9486) but it doesnt work (white screen only and backlight ok) so i read the item description on Aliexpress and its a ST7796S : ST7796S i finally make some search and find your post...so start from the beginning, delete the folder and clone your repo instead of juj's one. I have a white screen again, that doesnt miror the HDMI screen. The screen turn black after sometimes because of the backlight control who seems to work. i have this warning : Performance warning: using slow memcpy_to_dma_and_prev_framebuffer_in_c() function. Check conditions in display.h that enable OFFLOAD_PIXEL_COPY_TO_DMA_CPP and configure to use that instead. I have make it works for a ILI9341 3.5" and 2.8" without issue and follow this post ST7735r where the autor say to add this line Sorry for my poor knowledge...is there some more settings to do please? I dont find a ST7796S.h or .cpp ...dont understand. i have try Please can you help me a little please...so frustrating to have this screen blank...i use a RPI zero W and the last RaspiOS lite image. I just open a webpage in chromium in kiosk mode (Homeassistant Dashboard of my HA server). Can you just explain if i have to make some more settings and where please? here is the ouput : Thanks |
Hello @juj @furrysalamander I tried setting up as you did, with a rpi 3b+ and thesame display (4.0" SPI TFT module ST7796 320x480), But it starts up shows metric at the top and nothing else, then after a while trips off |
Can you please tell me how to do this? I have the same display practically trying to do the same thing but none of the display library's im using are working |
I just purchased a 4" 480*320 ST7796S Based Display off AliExpress (link). I'm hoping to use it in a project my club is building. It doesn't look like the board has shift registers on it, so I imagine that's probably a good sign for getting high SPI clock speeds.
I found the datasheet for this display controller here:
https://www.displayfuture.com/Display/datasheet/controller/ST7796s.pdf
I'm hoping that it will be fairly similar to the ST7789 or the ST7735 so that a port will be fairly easy.
The text was updated successfully, but these errors were encountered: