AMT630A firmware for mini TFT screens

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

I ran out of ideas...

I was able to fix the frequency, some way. It was an hell because I didn't know exactly how to determine the right frequency, and I don't know if it's really ok, actually.

But I can't get the rid of this double image. I spent the whole afternoon and night trying to discover what's going on with it, but I didn't find where to fix it. I didn't find a parameter that seems to have some kind of influence on it.

I don't even know if it's a frequency issue or a vertical size issue.

Well, it's all for now.
Attachments
9.jpg
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

The basic idea is that your display output has to stay in sync with the incoming video signal, if your input contains 50 frames per second, then output must also draw 50 frames per second.

If the horizontal resolution is doubled, then the dotclock frequency must be also doubled.
If the vertical resolution is also doubled, then dotclock needs to be yet twice higher (ie. 4x higher when both horizontal and vertical reolutions are doubled).
If you can't configure a matching dotclock multplier (eg you need mul2.7, but the hardware can only mul2.5 or mul3 as closest match), then you can fine-tune the timings by decreasing or increasing the horizontal blanking periods.
Vertical blanking needs to be more or less fixed (if you have twice as many visible lines, then you'll also need exactly twice as many blank lines, otherwise the resampling will derail somewhere midframe).

If you don't want to compute and fine-tune it yourself, the firmware for the higher resolution display should contain all required values. I don't remember if I had used the same data structures in my firmware, please check yourself if the disassembly resembles the custom firmware), then try to find similar definitions in the higher resultion firmware (for data structures: better use a hex editor for that, not a disassembler that would try to translate the data to instructions).
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

nocash wrote: Wed Jun 02, 2021 8:03 am The basic idea is that your display output has to stay in sync with the incoming video signal, if your input contains 50 frames per second, then output must also draw 50 frames per second.

If the horizontal resolution is doubled, then the dotclock frequency must be also doubled.
If the vertical resolution is also doubled, then dotclock needs to be yet twice higher (ie. 4x higher when both horizontal and vertical reolutions are doubled).
If you can't configure a matching dotclock multplier (eg you need mul2.7, but the hardware can only mul2.5 or mul3 as closest match), then you can fine-tune the timings by decreasing or increasing the horizontal blanking periods.
Vertical blanking needs to be more or less fixed (if you have twice as many visible lines, then you'll also need exactly twice as many blank lines, otherwise the resampling will derail somewhere midframe).

If you don't want to compute and fine-tune it yourself, the firmware for the higher resolution display should contain all required values. I don't remember if I had used the same data structures in my firmware, please check yourself if the disassembly resembles the custom firmware), then try to find similar definitions in the higher resultion firmware (for data structures: better use a hex editor for that, not a disassembler that would try to translate the data to instructions).
Martin, thank you for your great explanation!

The source is NTSC or PAL signal (generic AV media player or C64). If the tech specifications of the panel are correct, the frame size is 800x480.
The hardware with the original firmware works fine, both NTSC and PAL.
Unfortunately I haven't enough experience in assembly and hardware devices to find the info into the original firmware, even disassembled :-(

The only way I can expect to fix it, is using your source code, that's pretty well documented.

If I understood right, I should modify @@p0Ah and @@p0Fh (or @@yy60 /@yy50 and @@xx60 /@@yy50?) to match the right frequency.
However, I'm having some trouble calculating the right frequency for the above video size/frame rate and how to modify these values.
I'm doing some tests...
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

nocash wrote: Wed Jun 02, 2021 8:03 am If the horizontal resolution is doubled, then the dotclock frequency must be also doubled.
If the vertical resolution is also doubled, then dotclock needs to be yet twice higher (ie. 4x higher when both horizontal and vertical reolutions are doubled).
If you can't configure a matching dotclock multplier (eg you need mul2.7, but the hardware can only mul2.5 or mul3 as closest match), then you can fine-tune the timings by decreasing or increasing the horizontal blanking periods.
Vertical blanking needs to be more or less fixed (if you have twice as many visible lines, then you'll also need exactly twice as many blank lines, otherwise the resampling will derail somewhere midframe).

If you don't want to compute and fine-tune it yourself, the firmware for the higher resolution display should contain all required values. I don't remember if I had used the same data structures in my firmware, please check yourself if the disassembly resembles the custom firmware), then try to find similar definitions in the higher resultion firmware (for data structures: better use a hex editor for that, not a disassembler that would try to translate the data to instructions).
I'm really close to give up...

I tried many different values of multipliers and dividers in order to match the frequency. I can get a really narrow image, replicated up to 4 times horizontally... or a larger image, displayed twice on the screen; a specific multiplier/divider setup results in a clear and stable image, but it's displayed twice on the screen.

I tried to compare the original firmwares and the hacked ones to see if I can discover the way to make it to work (or, at least, to patch the original firmware in order to display the Commodore 64 signal correctly). I've run out of ideas. The fact is: I haven't a real expertise on that, so my chances to fix it without some help are limited, unfortunately. Too bad, it seems to me I'm close to fix it, but I'm stuck at this point and I can't find the info I need to do the job.
Attachments
fuzzy image, with flickering lines
fuzzy image, with flickering lines
fuzzy image, with flickering lines
fuzzy image, with flickering lines
fuzzy image, with flickering lines
fuzzy image, with flickering lines
sharp image, no flickering, but still displayed twice
sharp image, no flickering, but still displayed twice
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: AMT630A firmware for mini TFT screens

Post by calima »

The cvt tool on Linux should help you with the values.
Mohit
Posts: 6
Joined: Wed May 19, 2021 1:10 am

Re: AMT630A firmware for mini TFT screens

Post by Mohit »

giobbi wrote: Tue Jun 01, 2021 7:46 am
nocash wrote: Fri May 21, 2021 5:37 pm The 8pin SPI FLASH chips are more or less all the same, and should be all working (in theory).
The voltages may differ though, and there seem to be at least two different pin-out schemes.
Well, and there may be some more or less subtle differences, about write sector size, max MHz, or 2bit-data mode support, I don't have a list of which chips work how.
Martin, some updates from the 5 inches display I just received.

1) The panel doesn't work properly with your firmware. As I can see, it hasn't the specs for the 800x480 panel type. I tried to understand how to change the 480x272 value into 800x480, but I hit my head against some hex values I don't understand.
I think I should change some values in the resolution_io_list_for_480x272, mode_ratio_io_list_480x272_wide and mode_ratio_io_list_480x272_narrow sections, but I don't know what are the correct values (I suppose it's not just a matter to replace 480 with 800 and 272 with 480...)

2) I did a little try before to dump the original firmware (attached) and replace it with yours. It keeps the settings (brightness, contrast, etc.) even if you power off and on again, so it seems to me the MK chip is capable to store the setting.

I'm totally lost because I don't know how to set the panel inside your firmware, LOL. Please let me know if you want I make some tests...

Giovi
Same issue I faced and till now can't able to fix the thing. I already give up on this better I am using 480×272 only
Attachments
IMG_20210517_100327.jpg
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

calima wrote: Thu Jun 03, 2021 12:35 am The cvt tool on Linux should help you with the values.
Well, I haven't Linux here. I already tried to find a cvt tool or some chart or datasheet with some equations that could help me to understand something about the frequency used for WVGA @ 800x480 resolution, but I had no luck (nor I had with some empiric tests I did changing the frequency settings from inside the firmware).

If I understood a little about what I've read, the display controller takes a video signal (whatever) and convert it to the right frame size for the panel resolution, established by firmware (the same controller can manage many different frame sizes and rates and at the same time can output to many different panels with different ratio, size and resolution). So it seems to me my troubles come because I can't adjust the converted input signal to the right output size; according to the Martin's explanation (of course if I understood him!) this should be done by adjusting the output signal frequency to match the panel resolution.
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

Mohit wrote: Thu Jun 03, 2021 9:30 am Same issue I faced and till now can't able to fix the thing. I already give up on this better I am using 480×272 only
Did you try the firmware I attached in my previous message? It's the original firmware that came with my 5" monitor. It works fine (it doesn't work with the Commodore 64, though) and could fix your problem too.

http://forums.nesdev.com/download/file.php?id=21221
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

I eventually found the frequency should be between 22 and 24 MHz; at least this is how I get the whole image (not duplicated).
However, even with many tests, fine tuning the frequency by the three dividers and the multiplier, I can't get the rid of it.
It's a standard NTSC image from an old media player.

Martin, aka no_cash, told me to fine-tune the timings by decreasing or increasing the horizontal blanking periods, in case I can't get the right frequency value that matches the incoming signal. Too bad I don't understand for sure what is the parameter inside his firmware. It seems that many parameters have some influence on that.

So i'm at a dead point (and honestly I'm tired of that, LOL... next step, gasoline and a match)
Attachments
14.jpg
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

.
I need a little help by some of you that has some tech knowledge about assembler. I tried to patch the original 5" TFT firmware in order to allow, at least, the Commodore 64 mode.

From the AMT630A patched firmware by @nocash:

Code: Select all

;FE42h.bit5=C64 does PERFECTLY SHOW C64 IMAGE !!!
apply_allow_c64:
 mov  dptr,xram_sett_allow_c64
 movx a,[dptr]
 jz   a,@@this   ;a=00h=allow C64
 mov  a,20h      ;a=20h=reset/default
@@this:
 mov  dptr,IO_AV_secret_control
 movx [dptr],a
 ret
Looking at the .sym file, it seems to me that
xram_sett_allow_c64 = 0710h
IO_AV_secret_control = FE42h
----------------------

he also left an easy routine in the original disassembled firmware (engels.a22), but I don't know if this simpler routine works too...

Code: Select all

unlock_C64_video:
   mov  dptr,0FE42h
   mov  a,00h     ;change from 20h to 00h (clear bit5)
   movx [dptr],a
   ret
I know the patched firmware enables the C64 mode in the 5" TFT display too, you can see it even if the firmware doesn't work well with its resolution. So it's just a matter of how to patch it.

Just for test, I got a point into the 5" TFT original firmware and I patched the hex code starting at 0085hex address, simply modifying the values of another similar code already existing in the firmware:

Code: Select all

assembler --------    ----how I translated it in the hex file
mov  dptr,0FE42h   90 FE 42
mov  a,00h             74 00
movx [dptr],a         F0 
of course it doesn't work.

Does anybody here know where I'm wrong and how I could fix it (or could kindly fix it for me) ?
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

90 FE 42 74 00 F0, yes, that looks right. You didn't say where you did "insert" that opcodes though. Quick checklist: Make sure that your patch does get executed, and that it doesn't smash the original code (and don't change values in A and DPTR if the original code still needs that values), make sure that the orignal code doesn't overwrite the Port FE42h value after you had changed it. And, if you are implementing the patch as a subroutine, don't forget to add the CALL and RET opcodes accordingly.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty
Marnov042
Posts: 1
Joined: Sat Aug 27, 2022 5:15 am

Re: AMT630A firmware for mini TFT screens

Post by Marnov042 »

Hi, i am not sure that this thread is active, but i would want to ask for help with emulation of amt630a, i have downloaded the no$x51 from http://problemkaputt.de/x51.htm (first link) and frimware from http://problemkaputt.de/amt630a.htm, and runned it in the emulator, the AMT630A.BIN shows just black screen and nothing else, AMT630A.A22 does the same, and ENGELS.A22 shows black screen witb av1 text in right top corner and the it goes away, can you help to reach something like this? https://i.hizliresim.com/z0MaYD.jpg
btw i am running windows 10.
Boris-leo
Posts: 2
Joined: Thu Mar 18, 2021 1:41 pm

Re: AMT630A firmware for mini TFT screens

Post by Boris-leo »

... Strange people.
I'm wrote:
Boris-leo wrote: Wed Apr 07, 2021 5:45 am I have: controller board on AMT630A. Two SPI Flash dumps for resolution 800*480 (LCD panel like AT070TN92) and 1024*600 (LCD panel NETRON - the same AT070TN92 but resolution 1024*600). Both dumps working perfect with appropriate LCD's.
For those who got fucked with the birth of firmware with a resolution of 800x480 - go here and download. I read them from finished factory products. These firmwares for LCD displays TTL 50 pins 8 bits/color.
Discoordination
Posts: 1
Joined: Wed May 03, 2023 3:27 am

Re: AMT630A firmware for mini TFT screens

Post by Discoordination »

Hello. Does anyone know how to make this chip work with the SECAM color system? Support is indicated in the datasheet, I also found registers in which there is a mention of secam, but I tried to write something into them and did not get a positive result. I only managed to check the setting of the fifth bit in the FE2A register when applying the secam. There is no check for this bit in the display code, but I added my own and it works. That is, I just check in a loop for the setting of this bit, and until it is set, the display will not start. And when the secam is applied, the display starts up, which means that the chip sets this bit. But I can't figure out how to get the chip to decode secam.
Attachments
registers_AMT630A.txt
(21.56 KiB) Downloaded 51 times
20230430_190120.jpg
20220520_185352.jpg
Post Reply