Trying to connect 7" 800x480 TFT

Discussion about displays and related hardware including MiSTer filters and video settings.
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Trying to connect 7" 800x480 TFT

Unread post by badvision »

I have a 7" TFT I got for RPI projects originally and am trying to get it working. When I plug it in to windows and macos devices it comes up and reports a fixed framerate of 65.681. I was able to dig further using SwitchResX on the mac and get the timing values:
Mode = 800 x 480 @ 65.681Hz
Pixel Clock............. 32.00 MHz Not Interlaced

Horizontal Vertical
Active.................. 800 pixels 480 lines
Front Porch............. 40 pixels 13 lines
Sync Width.............. 48 pixels 3 lines
Back Porch.............. 40 pixels 29 lines
Blanking................ 128 pixels 45 lines
Total................... 928 pixels 525 lines
Scan Rate............... 34.483 kHz 65.681 Hz
Image Size.............. 108 mm 68 mm
Border.................. 0 pixels 0 lines

Sync: Digital separate with
* Negative vertical polarity
* Negative horizontal polarity

I tried to configure this using the following:
video_mode=800,40,48,40,480,13,3,29,34483

But this only gives me a bunch of garbage. Lowering the horizontal sync values I was able to get some kind of picture, but only the right side of the screen unfortunately using:
video_mode=800,40,48,4,480,13,3,29,34483
In this situation if I increase hbp from 4 to 5 then I no longer get a stable screen. I've tried other combinations of bp/s/bp settings with no luck so far. It seems to tolerate a slower dot clock but that doesn't do anything for the horizontal sync issue.

Thanks in advance if anyone has any tips or guidance for this one.

-Brendan
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

Other useful information I found trying to understand this better:

Fujitsu docs provide a pretty complete description of the timing characteristics: https://www.fujitsu.com/downloads/MICRO ... ev1-20.pdf

Unfortunately there is a mismatch between the abbreviations used in this document and the video_mode specification For example: hact,hfp,hs,hbp,vact,vfp,vs,vbp,Fpix_in_KHz in MiSTer vs thde, thfp, thds .... and even weirder is that Fujitsu doesn't list back porch values -- is that calculated based on something else?

Full detailed specs on the panel itself with the timing characteristics specified in the same manner (abbreviations/terminology) matching Fujitsu: http://www.vslcd.com/Specification/at070tn90.pdf

Less helpful is the manual to the LCD screen. It lists some advice on configuring for linux but the details are pretty scant: https://www.waveshare.com/w/upload/1/19 ... Manual.pdf
Only details of any consequence are the following (which do not map to Mister FPGA anyway)
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1
User avatar
Hectic
Posts: 47
Joined: Tue Jun 09, 2020 3:23 am
Been thanked: 10 times

Re: Trying to connect 7" 800x480 TFT

Unread post by Hectic »

I think the last value has to be pixel clock in kHz not horizontal scan rate.

Try this.
video_mode=800,40,48,40,480,13,3,29,32000
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

No dice, unfortunately the pixel clock doesn't seem to be the issue here. In this configuration I only get a stable frame (but right side only) if the third parameter is 12 or lower. I can set the pixel clock even ten times lower (3200) and it doesn't seem to have any affect on the stability of the frame in this case. Just ten times slower.

All the same thank you for jumping in so quickly to have a go at it. It's a very confusing problem. I don't have much more in the way of specs other than the board has a TI driver chip TFP401APZP -- no idea about the panel itself (it's stuck to the driver board with pretty strong adhesive). Looking at the data sheet from TI, there doesn't seem to be any limiting factor there. The driver is supposed to have some protection against horizontal jitter, but that isn't telling me much in this case.
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

The only other bit that caught my attention is in the modeline and report from SwitchResX is that it specifies -hsync and -vsync in both cases -- but is there any way to control sync polarity from MiSTer configuration?
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: Trying to connect 7" 800x480 TFT

Unread post by morf77 »

Not sure if this will work but worth trying:

Code: Select all

video_mode=800,32,72,104,480,3,10,9,33000
I got this modeline from:

Code: Select all

$ cvt -v 800 480 65.681
Warning: Aspect Ratio is not CVT standard.
Warning: Refresh Rate is not CVT standard (50, 60, 75 or 85Hz).
# 800x480 65.22 Hz (CVT) hsync: 32.74 kHz; pclk: 33.00 MHz
Modeline "800x480_65.68"   33.00  800 832 904 1008  480 483 493 502 -hsync +vsync
Then converted it using the link in my signature.

For a CVT standard 60 Hz this would give:

Code: Select all

video_mode=800,24,72,96,480,3,10,7,29500
Another one I got from using https://arachnoid.com/modelines/index.html using the exact 65.681 hz refresh rate:

Code: Select all

video_mode=800,24,80,104,480,1,3,15,33040
Some other ones from googling 800x480 modelines:

Code: Select all

video_mode=800,24,72,128,480,1,2,22,36000

Code: Select all

video_mode=800,40,128,88,480,10,2,33,33450
The latter is based on a -hsync and -vsync modeline.

Hoping one of these will work for you...
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

Thanks Morf77, unfortunately those just showed a white screen. As with my other attempts if I changed the horizontal/backporch settings low enough I would get half a screen again but nothing better. The only thing that seems to vary in these tests is sometimes I get a messed up left edge and other times I don't -- but it always seems to cut out right in the middle of the screen. Again, I've hooked this up to a windows machine and a macbook and both detect the resolution and display without issue.
20210503_162121.jpg
20210503_162121.jpg (373.43 KiB) Viewed 4769 times
20210503_161747.jpg
20210503_161747.jpg (301.37 KiB) Viewed 4769 times
User avatar
morf77
Posts: 63
Joined: Fri Aug 28, 2020 1:42 pm
Has thanked: 12 times
Been thanked: 24 times

Re: Trying to connect 7" 800x480 TFT

Unread post by morf77 »

video_mode = 2 and video_mode = 6 also don't work? 240p video_mode?
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

I tried the standard modes and none worked. Some progress has been made though!

This mode is displaying a full screen but every other column is white. Still, it is some kind of progress at least.

Code: Select all

video_mode=800,70,48,10,480,13,3,29,34483
Thanks again for all the advice folks!
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: Trying to connect 7" 800x480 TFT

Unread post by aberu »

badvision wrote: Tue May 04, 2021 2:17 am I tried the standard modes and none worked. Some progress has been made though!

This mode is displaying a full screen but every other column is white. Still, it is some kind of progress at least.

Code: Select all

video_mode=800,70,48,10,480,13,3,29,34483
Thanks again for all the advice folks!
How far did you get with this? Did you improve on it any?
birdybro~
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

Unfortunately no, I hit a dead-end. But I wanted to at least post my partial progress in case someone with a better idea can draw some ideas from it. I feel like there's something to that negative hsync that is critical to the whole thing working, and I'm not sure if that is supported or not.
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: Trying to connect 7" 800x480 TFT

Unread post by aberu »

Well, I'll be going down this similar path shortly, testing out an 800x480 Adafruit 7" non-touchscreen today, gotta fine tune it. We'll see if we can make it work!
birdybro~
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: Trying to connect 7" 800x480 TFT

Unread post by aberu »

Success!

Adafruit 7" non-touch 800x480 video mode is the following:

Code: Select all

video_mode=800,70,48,10,480,13,3,29,34483
birdybro~
badvision
Posts: 34
Joined: Mon May 03, 2021 1:48 pm
Has thanked: 4 times
Been thanked: 15 times

Re: Trying to connect 7" 800x480 TFT

Unread post by badvision »

Wow, so the settings I tried and failed with worked for you? Well I'm glad the effort wasn't a complete waste then. I suppose it helps I was assuming (and it seems incorrectly) that my generic god-knows-what screen was using the same hardware as the Adafruit one. Unfortunately the driver board is glued to the screen and I don't feel like trying to dismantle it to get all the part numbers. Well, congrats on getting your screen working! :D
kunst
Posts: 3
Joined: Sun Jul 11, 2021 8:33 am

Re: Trying to connect 7" 800x480 TFT

Unread post by kunst »

Hi there, I was having a similar problem to you, see my thread:

viewtopic.php?f=33&t=2938

For me it worked using the following:

dvi_mode=1
video_mode=800,40,48,40,480,13,3,29,32000
Post Reply