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.
Post Reply
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

AMT630A firmware for mini TFT screens

Post by nocash »

AMT630A
The AMT640A is a relative common video controller chip found in cheap mini TFT screens with composite input.
Those screens are often sold as "car rear view monitor" (or by similar names), although they are essentially fully-fledged portable TVs (minus tuner/speaker, and without advanced inputs like S-video or RGB).
The chip contains a 8031/8051 microprocessor, with firmware stored on an external SPI-bus FLASH memory chip.
Theoretically, it could be used as miniture monitor for gaming consoles. Unfortunately, it's working rather disappointing in practice:
  • Display is having some vertical-interlace-style flickering (even on non-interlaced pictures).
  • With 320x240 pix screen, resampling is smeared, possibly a bit uglier than required...
  • For NTSC, one could theoretically leave blank lines (with black borders)
  • For PAL, one could theoretically crop lines (eg. on homecomputers with 200 lines)
  • PAL60 produces wrong colors.
  • PAL60 forgets to update some scanlines (and draws wrong/older lines).
  • Backlight is at max brightness and cannot be changed.
  • Reportedly, signals from C64 aren't recognized (not tested myself yet).
Some of that issues might be firmware related. So I've spent 2-3 weeks on disassembling it: http://problemkaputt.de/amt630a.htm (AMT630A firmware disassembly, for 320x240 pixel 3.5" screen with 4:3 ratio). The disassembly is working as source code and can be re-assembled via no$x51. All code addresses are represented by lablels, so inserting custom stuff in code memory should work (whilst RAM/XRAM addresses are still hardcode, so better don't insert new stuff there; there are unused locations that could be used though).

I would be also interested in dumps from other firmware versions...
  • firmware for screens other than 320x240 pixels
  • firmware for 16:9 wide screens
  • firmware with infrared IR input support
  • firmware with volume control support
  • AMT630 firmware (to see if it's similar/compatible to AMT630A)
  • other older/newer firmware revisions
  • etc.
That stuff would help on finding which I/O ports have which functions (eg. for changing the screen resolution/resampling).

More notes on the hardware's component list and on SPI FLASH dumping are at the bottom of the disassembly. The AMT630A spec sheet doesn't contain any info about I/O ports, but the disassembly should explain the coarse functionality of the ADC, PWM, OSD registers, as well as SPI busses for FLASH (and LCD). For the composite to LCD video conversion, there are a lot of fixed initialization values - which, one could try to change them & see what happens...
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: AMT630A firmware for mini TFT screens

Post by lidnariq »

A random source claims it is a clone of the MST703, for which I was able to find a datasheet that includes register definitions... in case that helps.

I've also been able to find a reference schematic on baidu ("AMT630_CAR_V3.4") , but they won't let me download it without logging in :/
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

Yes, I know that claim about AMT630 being a MST703 clone.... if the AMT630 is working similar to AMT630A then it's nonsense: The AMT630A registers at FB00h-FFFFh don't match up with the MST703 datasheet at all.

Apropos registers. The AMT630A spec sheet claims that it has some "standard" stuff like timer2 and watchdog. I know some 8031 variants with watchdogs at either SFR register FFh, or A6h. But the AMT630A seems to have the watchdog controlled via SFR registers B9h, BAh, BBh, BCh, BDh, and BEh. Are that really standard registers used in other 8031 variants, too?
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: AMT630A firmware for mini TFT screens

Post by TmEE »

The jittery vertical lines are this sort of thing : http://www.lagom.nl/lcd-test/inversion.php

If you're lucky there's a small pot that allows to change the bias point and make both sides equal and reduce the flicker effect (it will not however completely fix it).

There are also some other controllers out there which require external MCU to do the work, and some do have their registers all available in a datasheet. I have one such somewhere and one day when I'm no longer lazy I'll write up a new MCU that enables RGB input (or very least YC) and adjusts geometry and timings etc. to suit particular machines.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: AMT630A firmware for mini TFT screens

Post by calima »

If you manage to make it work, I'd get one, and probably many others too. Lots of sales for the chinese :P
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

Got a new firmware update finished. The original firmware code is used only for initializing some I/O ports, and then it's jumping to my own custom code, which is experimental stage at the moment: It's going right to a debug menu allowing to test various hardware functions; memory dump, color changes, bitmap rendering at different font widths/color depths, flipping I/O bits, ADC button reading, etc.

Apart from the newly added firmware code, the disassembly of the original code is a bit more complete (with symbolic names for all used hardware registers), the rev-engineered hardware registers are now also described in a fullsnes/gbatek-style document, and after getting bored of reflashing the firmware, I've also emulated the amt630a hardware in no$x51.

And... I guess now somebody will shout "I knew it, I really really knew it, I knew that he would port the game to the AMT630A" - there's also a Magic Floor version included in the firmware. It's been helpful to get familar with the odd OSD video memory addressing, and it's been a bit challenging to get it working with 3-button keypad (it's using MENU to toggle horizontal/vertical direction, and tapping/holding Plus or Minus for short/long moves - which, I thought it would become rhetorically (un-)playable, but it's actually working quite well, apart from the buttons being quite small).

http://problemkaputt.de/amt630a.htm - new AMT630A firmware disassembly with added custom source code
http://problemkaputt.de/x51.htm - AMT630A emulator/debugger
http://problemkaputt.de/x51specs.htm - specifications for AMT630A memory map and hardware registers

For fixing the original firmware issues: I've found a bit that makes it recognize C64 video signals (another approach without firmware pataching, discovered by other people would be using an external sync separator, and then merging the extracted sync signal back to the C64 composite signal). Displaying PAL60 is possible, but it's still a bit flimmering, and the PAL60 patch will make it incompatible with NTSC signals (and might currently even screw up PAL50, though that would be fixable). And the painfully bright backlight, I got it dimmed using a PWM signal with 50% duty, which is looking much more moderate. And, if I have measured it properly, it seems to have dramatically reduced the power consumption from 1.17W to 0.05W for the backlight (plus 0.28W for the remaining hardware).

Ah, and here are some pictures showing the original 3.5inch screen with dangling cables in the weird case with 16:9 form factor, and my own case with rear sockets and true 4:3 form factor.
Attachments
630side.jpg
630rear.jpg
630ori35.jpg
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: AMT630A firmware for mini TFT screens

Post by lidnariq »

Is the backlight CCFL or LED? I'm having difficulty coming up with obvious explanations for why 50% duty would consume 1/26th the current, even assuming some kind of boost converter
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

I don't know what happened there, or if I screwed up generating an exact 50% duty signal, or failed on measuring the amperes. What I can tell for sure is that the backlight is darker, and that the screen doesn't warm up any longer, so I've definetely saved some energy.

And, what I've noticed is that 50% isn't always 50%. The backlight stays black when using duty=0080h/total=0100h, but it's neatly dimmed when using duty=0800h/total=1000h (ie. same signal 16x slower). Maybe something is clipping too short pulses (and if my current pulses are still too short, then I might be effectively below 50%). The PWM cycles are counted in in 26MHz units, so total=100h should be 101kHz, and total=1000h should be 6.3kHz.

I have no idea which PWM rate would be optimal for backlights, the datasheet for the backlight driver is confusing me (as far as I understand one can use PWM or analog/resistor for selecting the brightness, and the datasheet says that the advantage would be that PWM works without needing PWM for generating the analog level... or something like that).

The backlight driver is a 6pin "7001" (seems to be Micrel MIC3287 or compatible).
The display is "Tianma TM035KDH03" (which is said to have a WLED backlight).
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: AMT630A firmware for mini TFT screens

Post by tepples »

nocash wrote:I have no idea which PWM rate would be optimal for backlights
Optimal at least for light pen use with Zapper-style hit detection would be 15.7 kHz, same as SDTV line rate. Because all the rows are lit, you won't get the positional output that things like Operation Wolf rely on. But at least we can see some ducks die.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: AMT630A firmware for mini TFT screens

Post by lidnariq »

The display's datasheet claims each strand of LEDs wants ≈20mA at ≈6×3.3V, or roughly 20V; at peak power that should be roughly 400mW ... I guess 800mW for both strands? Obviously running the LEDs hotter does make them brighter (at the cost of shortening their lifetime)... Theoretically the current-setting resistor should be 6 ohms.

Assuming that the MIC3287's datasheet is representative, it says that
1. PWM dimming control is implemented by applying a PWM signal to the EN pin, as shown in Figure 1. The MIC3287 is turned on and off by the PWM signal. With this method, the LEDs operate with either zero or full current. [...] Typical PWM frequency should be between 100Hz and 10kHz.
Even though the boost converter says it operates at 1.2MHz, it takes many cycles for the output voltage to stabilize; the reference schematic uses a 10µH inductor and 220nF capacitor and that has a time constant of roughly 70kHz . So the system can't really respond faster to perturbation than that... which doesn't really explain why 101kHz almost doesn't work at all. (Of course, maybe the actual board here uses parts with a slower time constant)
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: AMT630A firmware for mini TFT screens

Post by mikejmoffitt »

I have a display with one of these controllers, and it's a nice 640x480 one that'll take VGA. I hoped to modify the firmware to have it line double a 15KHz RGB source instead.

The flickering I think is a result of the LCD itself, not the display controller. I am pretty sure a regular progressive scan is sent to the LCD.
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

tepples wrote:Optimal at least for light pen use with Zapper-style hit detection would be 15.7 kHz ... at least we can see some ducks die.
Uhm, I am feeling a bit uneasy about that game, I get the idea about shooting enemies because they are ugly, dangerous, or guilty... but shooting cute harmless innocent ducks just for the fun of it - that's about the scariest killing game that I could think of (next to PSX fishing games).
Technically, yeah, the 15.7kHz backlight might work for early lightgun games (ie. those that display a white rectangle at the target location), I guess, for distinguishing between TV and normal light sources, that games check for 15.7kHz light flashes, and/or for no light during vblank? The latter would be more difficult.

Oh, and another unexpected side effect would be classic 15.7 kHz noise. I've just noticed that I am hearing some feeeep sound on my PC's speakers, especially with higher backlight duties in 70%...99% range (and the sound it goes off when using 100%). The PC and TFT screen are sharing the same GND, and also the same 5V supply. Easiest workaround would be to use some higher/inaudible PWM rate like 30kHz.

And I am wondering, what is better for backlights: A constant HIGH duty, or a constant TOTAL duty? At the moment, my PWM output uses constant TOTAL (6.3kHz), and the backlight slider allows to change the HIGH duty from 0% to 100%, one small problem is that 1%..13% are leaving the screen completely black.
Ie. instead of dimming by decreasing the HIGH time, it might be better to maintain some fixed HIGH time, and instead increase the LOW time?
mikejmoffitt wrote:I have a display with one of these controllers, and it's a nice 640x480 one that'll take VGA. I hoped to modify the firmware to have it line double a 15KHz RGB source instead.
The flickering I think is a result of the LCD itself, not the display controller. I am pretty sure a regular progressive scan is sent to the LCD.
Are you sure that you have VGA input... on these AMT630A chips? As far as I know they support composite only (and maybe S-Video, at least on older AMT630's).
The flickering occurs on the floor cells in Magic Floor SNES version. On the other hand, the Magic Floor AMT630A version doesn't flicker. So the TFT seems to be okay, but the displaying the AV signal is somewhat unstable. Not sure what is happening there, the theory about interlace might be wrong, maybe the thing is permanently trying to re-calibrate itself to the incoming signal, or maybe the SNES signal itself is unreliable (gotta check back if the game has similar flicker on a real CRT).

---

Btw. can somebody recommend an audio amplifier for the two speakers? I have 5V power supply, and the speakers are around 1W each, and it would be nice to some volume regulator that could be driven via PWM, and, some way to force the amplifier to low power standby mode (or automatically having near zero power consumption when receiving "nothing" on the L/R audio inputs).

What I have at home is a TDA1308 Class-AB stereo headphone driver (might be a bit weak, but maybe better than raw unamplified audio), and two mono LM386N-1 amplifiers (which might be more suitable). The TDA and LM's don't have a volume regulator input though.
And the speakers are two "VECO 35KN04" ripped from some old dead notebook. I've somehow managed to find some specs on http://www.veco.com.tw/cgi-bin/product-search.cgi (despite of 99% broken links at veco.com.tw):

Code: Select all

  Model   Dimension     Impedance  Power Rating  Fo          SPL        Frequency  Material   Material  Type
          Dia. x Depth  +/- 15%    Mini-Watts    Lowest      Normal     Range      of         of        Out-looking
                                                 Resonant    Power      SPL-10 db  Diaphgram  Frame
                                                 Frequecy    Input/     Hz.
                                                 +/- 20%     0.5 meter
                                   Normal  Max.              db
  -----------------------------------------------------------------------------------------------------------------
  35KN08  35x16x4.2     8          1000    1500  650         82         400~4000   Cloth      ABS       Square
So 35KN08 would be 35x16x4.2mm, 8 ohms, and, hmmm, 1000-1500 "mini watts", whatever that is, probably milliwatts.
And mine are 35KN04, which should translate to same size, 4 ohms, and... maybe similar watts.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: AMT630A firmware for mini TFT screens

Post by lidnariq »

nocash wrote:And I am wondering, what is better for backlights: A constant HIGH duty, or a constant TOTAL duty? At the moment, my PWM output uses constant TOTAL (6.3kHz), and the backlight slider allows to change the HIGH duty from 0% to 100%, one small problem is that 1%..13% are leaving the screen completely black.
Ie. instead of dimming by decreasing the HIGH time, it might be better to maintain some fixed HIGH time, and instead increase the LOW time?
Unfortunately, it depends on the boost converter that's used to drive the backlight itself.

But, given your previous observation that too-high PWM frequencies cause the backlight to not light, I wouldn't be surprised if the boost converter consistently takes some small number of microseconds after its ENABLE input goes true before the output voltage is high enough to light the LEDs.

So ... yeah, your guess of only adjusting the off time sounds good to me.
Btw. can somebody recommend an audio amplifier for the two speakers? I have 5V power supply, and the speakers are around 1W each, and it would be nice to some volume regulator that could be driven via PWM, and, some way to force the amplifier to low power standby mode (or automatically having near zero power consumption when receiving "nothing" on the L/R audio inputs).
Quickly looking through digikey's selection for audio amplifiers with both volume control and standby or shutdown modes, the first cheapest options are: LM4811, TDA8551, MAX9723, TPA6130, TPA2028, LM48824, TPA6140, LM4875, and AN7510. All of these are 1 to 2 USD in qty 10, although obviously availability and pricing for you will vary.
Bipsiljo
Posts: 2
Joined: Mon Feb 19, 2018 7:31 am

Re: AMT630A firmware for mini TFT screens

Post by Bipsiljo »

Dear nocash.

I want to ask few questions, if you can reply, i will be happy.

I have an electronic device, it's sizes are 25 mm x 25 mm about, it has 2 side PCB, one side is AMT630 + 25S40 flash and other side is V399 + 24C32 flash and some resistors and capacitors, etc... Device has a 12.00 MHz crystal on it. It has auto select for PAL and NTSC cameras.

I am connecting 5.8 GHz AV wireless Receiver to my device IN ports (Video signal and Ground) and OUT ports (5V, Ground, D- and D+) to Android phones with micro USB, with a Google Play app, it shows Video on the phone's screen. (V399 is for USB connection) Device is working good on 640 x 480 resolution as well. But I have problem with BLUE SCREEN (when no signal from AV Receiver)

My questions :

1) I think so, there are 3 type AV input sensitivity level og AMT630 (FE15h - IO_AV_ctrl_sensitivity_0 , max, med and low) What is the advantage of mid and high? High level can be good solution for to boost of weak signal of AV Receiver's Video signal.

2) AV Receiver produce its own static snow when get "no signal" from AV Transmitter. For to eliminate the BLUE SCREEN, can i use AV Receiver's SNOW SIGNAL on the Phone's screen?.

3) If it is not possible, can i use AMT630's generated SNOW SCREEN?

I don't need OSD, my only problem is Blue Screen. I am using your No$x51 emulator as well, it show SNOW Screen (that i want) on and under the OSD band, when your BIN code animate.

Many thanks for your help.
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

Your device doesn't have any LCD screen at all - and instead it's having USB video output? Interesting to know. I wasn't aware of the AMT630's being used that way, but now that you mentioned it, I've found some webpages about AV to USB video grabbers with AMT630(A) chips.

What is the problem with BLUE screen? It's showing up fine - and you just want it to show the SNOW effect instead of the BLUE screen? If your firmware works similar as mine: Try the secret key combos: Menu,+,-,-,+,+ or Menu -,+,+,-,- that should get you to the Version and Factory Menu screens. EDIT: If you do have any buttons on the video grabber device at all?

Be careful with changing some of the factory settings. Best scribble down the original settings on a piece of paper before messing atound with them (in case there are any calibration values in there). And don't change the KEYpad type (that'll make the keypad input nonfunctional, unless you do actually connect the newly selected keypad hardware, or until you reflash the firmware chip). Apropos firmware - any chance that you could dump the flash chip(s)?

Not sure what port FE15h is doing, or if I've really named it properly when calling it IO_AV_ctrl_sensitivity_0. I guess it does just help on recognizing the incoming AV signal, it isn't directly related to BLUE-or-SNOW, but it might effect Signal-or-NoSignal, and maybe also the appearance of Snow (it looks as if the Snow is generated by digital random generator, but rather by amplifying analog noise from the AV inputs). For the other register, I've just observed that changing to 00h (or the power-up default value A1h) helps on reducing power by 2mA in standby mode, whilst using setting 00h outside of standby mode does produce oddly different gray snow when having NoSignal.

---

Btw. does anybody know how to deal with the russian http://remont-aud.net/dump/car_audio/ca ... nitors/356 ? Going by the word "dump" in the URL, that page seems to have firmware dumps for dozen(s) of AMT630 and AMT630A displays? Using translate, the separate pages are saying that one must register & login & solve some electronics test before being allowed to download "the file" (which might be a firmware dump... which would be actually interesting).

The registration form is in russian, and it looks rather indiscrete (like asking for the name & nationality of your grandmother), and it's announcing severe punishments in case of incorrect answers, and seems to want to enter cyrillic text for the captcha. Fortunately, there are fake accounts, like this:
user: nbm
pass: bugmenot
That did actually work for me. The problem is that it does no longer display the public webpage at all once when logged in (least allowing to download the damn files), instead it did merely say "technical work under way" in russian. Some hours later it changed to saying that "you belong to a group of members that is not allowed to view this page" also in russian.

So, logging in seems to make things worse and just adds further restrictions. Maybe passing that electronic test would unlock those restrictions... though, once when logged in, it doesn't even show the link for getting to the damn test anymore (when not logged in, it's saying one must register and login before allowing to accomplish the damn test).

Looking at other forums that are discussing AMT630(A) chips, most of the western world is annoyed by that russian page prohibiting to download their firmware dumps - suckers - then on other hand, maybe it'd be time for some non-russians to do their dumps instead of complaining about it ; )

---

So far, I've my own firmware for 320x240 pixel Tianma 3.5" display. And also got another dump for a 480x272 pixel Innolux 4.3" (and 5") display. The 2nd dump did help to track down settings for different resolutions (though I still haven't completely figured out which value is having which effect on horizontal and/or vertical AV and/or TFT timings/scalings).

And the Innolux dump also contained code for Infrared support - it seems to support a few nonstandard codes for NEC protocol only. Going by the datasheet, the hardware should also support the more standarized Philips RC-5 protocol, but I don't know how to implement that in software yet (nor what kind of IR components it would require to be connected to the REMOTE pin).
Post Reply