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

Re: AMT630A firmware for mini TFT screens

Post by nocash »

You do probably have dozens or hundreds of computers and consoles that are capable driving SPI devices. But if you need suggestions:
DIY: Wire the SPI chip to your VIC-20 or the like.
PAY: Buy a Raspberry Pi or whatever else that comes bundled with SPI flash tools.
homepage - patreon - you can think of a bit as a bottle that is either half full or half empty
Mohit
Posts: 6
Joined: Wed May 19, 2021 1:10 am

Re: AMT630A firmware for mini TFT screens

Post by Mohit »

Anyone who can help me with this issue I have a amt630a display driver board it's works fine with 480×272 resolution display but when I connect a 800×480 resolution display it's behaving like this. Any solution would be very helpful please help me to fix the issue if possible.
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 »

nocash wrote: Mon Apr 26, 2021 8:48 pm You do probably have dozens or hundreds of computers and consoles that are capable driving SPI devices. But if you need suggestions:
DIY: Wire the SPI chip to your VIC-20 or the like.
PAY: Buy a Raspberry Pi or whatever else that comes bundled with SPI flash tools.
@nocash,

thanks for the info and your superb work on the firmware. I eventually discovered my eprom programmer can manage some way the spi flash memory (why, oh why, I didn't check it at first?) so I uploaded your firmware. It's a 4:3 display; I dumped the original firmware; it's different from the engels you put into the zip on your site, I can upload here if you want.

C64 is working fine, but I have a couple of issues (well, sort of):

1) it doesn't save your preferences. It always ask to choose the display type and starts with the default setup. I'm not sure if I'm doing something wrong. I also figured if I need to pull high or low some pin somewhere, but I didn't find anything on your site and/or the forums (possibly the info was there and I didn't see it).

2) the diag menu is brutally on the left of the monitor, so you can't see any reference about the selected item.

3) the brightness change very a little until 99%, but it has a dramatic change when you set it to 100%. Since I use it at 100%, it's not an issue for me, actually.
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

Congrats! Yes, post a copy of the firmware dump.

With the different display manufacturers, resolutions, and button boards, I am quite surprised that my firmware is working at all without modification.

For saving settings: What name is printed on your FLASH chip, what is it's size, in bits or bytes, how is the write protect /WP pin wired up, does your programming tool include options for write protecting sections of the FLASH memory?

Brightness: Don't know what is wrong, or if it's supposed to be like that (the effect may depend on whether the picture contains colors with medium brightness, or also depend on the current contrast setting). If it's looking okay at 100% then it isn't much of a problem.

Horizontal position: Sounds as if you have a slightly different LCD screen, what name/part number is printed on the back of the LCD, how many pins does the connector have, what does my firmware display as PANEL TYPE setting?
The diag screen is more for reverse engineering, so you won't really need that. I guess the OSD layer with Brightness/Contrast/etc. settings is also a bit more on the left than it should (as compared to how it looks like in the emulator)? But is still visible well enough, including the ">" shaped arrow symbol?
And most importantly, is the composite picture well centered in middle of screen?
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: Fri May 21, 2021 5:06 am Congrats! Yes, post a copy of the firmware dump.
Ok! I have two 4.3" monitors actually, so I will refer to the 1st and the 2nd, just to avoid confusion. In the attached zip file you can find both firmware, that seems to be different (at least at a quick binary comparison between the two files).

(I also bought a 5" one from China, it will arrive in a couple of weeks more or less.)

Albeit they are identical, the inside board is slightly different. They come without the three buttons panel, but there's the connector on both boards. I made two panels, however on the first display works flawless with the three resistors (4.7k, 2.2k, 1k) while the 2nd one has some strange behavior (yesterday at night I discovered if you put a 2nd 1k resistor in parallel with the 4.7k resistor it works more or less... I will do further investigations later).

Worth to mention they act the same with your 630A.bin firmware.

I can post some good pictures of both boards if you think it could be of some interest. I just modded both to work with 5v instead of 12v (I planned to power it through the video output connector of the C64, directly - it has 5v at pin #8)

nocash wrote: Fri May 21, 2021 5:06 am With the different display manufacturers, resolutions, and button boards, I am quite surprised that my firmware is working at all without modification.

For saving settings: What name is printed on your FLASH chip, what is it's size, in bits or bytes, how is the write protect /WP pin wired up, does your programming tool include options for write protecting sections of the FLASH memory?
The spi flash is labeled as MK 25D40B TIG (i guess it's TIG... slightly bad printed) on the 1st board, and BergMicro 25Q40ASTIG on the 2nd board. I programmed both using the MACRONIX MX25L4005 config on my programmer.
nocash wrote: Fri May 21, 2021 5:06 am Brightness: Don't know what is wrong, or if it's supposed to be like that (the effect may depend on whether the picture contains colors with medium brightness, or also depend on the current contrast setting). If it's looking okay at 100% then it isn't much of a problem.
I just discovered they have a different behavior. The first one has a big difference between 99% and 100%, while the 2nd one works in a more linear way. Not a real problem, really.
nocash wrote: Fri May 21, 2021 5:06 am Horizontal position: Sounds as if you have a slightly different LCD screen, what name/part number is printed on the back of the LCD, how many pins does the connector have, what does my firmware display as PANEL TYPE setting?
The 1st lcd display hasn't any part number or name printed. The display name (at least the one shown in the display menu) is Innolux 480x272.
I didn't disassemble the 2nd one: it has a flipping display that close like a book, so I didn't plan to open it yet, but I can do if you need to know (albeit I suspect it's the same panel). Both panels have a 40 pins connector.
nocash wrote: Fri May 21, 2021 5:06 am The diag screen is more for reverse engineering, so you won't really need that. I guess the OSD layer with Brightness/Contrast/etc. settings is also a bit more on the left than it should (as compared to how it looks like in the emulator)? But is still visible well enough, including the ">" shaped arrow symbol?
And most importantly, is the composite picture well centered in middle of screen?
The image is perfectly centered in the middle, both at 4:3 and 16:9 format (the 16:9 format is just a stretched image).
The OSD menu is a little on the left too, but still visible (the ">" arrow is on the very left border of the panel, slightly out of range).

I have to admit I didn't find yet a way to emulate the menu panel on the No$x51 :oops: but I was playing with it right now, I was trying to find a way to avoid the initial question "choose your display type" on your firmware. Unfortunately I don't know much of assembler-like languages, so I'm suffering a little here LOL
Attachments
mine original - two unit - display 4-3 inches.zip
(45.89 KiB) Downloaded 225 times
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

A little update: after few test I've found the menu panel in the 2nd monitor doesn't work as espected: it requires a 3.3k resistor instead of the 4.7k to work. So we have:

- 3.3k = key minus (-)
- 2.2k = key menu
- 1k = key plus (+)

I suppose you can use a 3k, 2k and 1k respectively; I got those 3 SMD (332, from an old board and they work fine. Just in case somebody has the same problem...
---------------------------------------

It seems to me the fact it asks to choose the panel every time the monitor is powered up (of course not to mention the fact it doesn't save the settings) is that your firmware just know the 320x240 tianma panel. So I was looking where and how to set up my panel model as known panel in the firmware to avoid the initial menu. Any clue about where to declare it inside your firmware ?

-------------
BTW: ABOUT THE 2nd monitor I have (see previous message): if you do a wrong choice when, at the very beginning, it asks to select the panel with +/-, you can't recovery from your mistake. I.e. if you press the "+" key when you should have pressed the "-" there's no way back: pressing the "-" has no more any effect, the display fade to white and you better should praise it didn't write your choice in the flash rom LOL

However there isn't any clue for that choice: it doesn't show the panel name or another info to help you.
--------------
about the diag menu: if you scroll it using the h-scroll test, it become completely visible at 001D (and perfectly aligned with the left border of the 4:3 image at 0055).
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

Display: You seem to have confused "aspect ratio 4:3" with "4.3 inch" in an earlier post. As far as I understand now, you have 16:9 wide screen display with 4.3 inch. I wish I would have one of those, too, even if it's just for testing, or a display with yet higher resolution : )

Flash: The "MK 25D40B" cannot save settings, but the "BergMicro" chip can save settings? Are you sure, or is it the other way around?
Asking because I have a (working) "MK 25D40" here, which should be more similar to your "MK 25D40B".
If you have selected the wrong panel type: Hold down the middle button on power-up to get back to the panel selection screen.

Button/resistors: Don't know why it requires 3.3K instead of 4.7K, maybe they have intentionally wired something differently to make the board incompatible with other boards. You could also change the min/max value in my source code's "keypad_16h_info" table instead of using different resistors, but if 3.3K works for you then that's fine, too.
Over here (unrelated to your issue), the 1K ohm "+" button is behaving erratically, half of the time it's randomly triggering one of the other two buttons, I haven't used the display for a while, but it did work perfectly stable some years ago, I am a bit puzzled why it stopped working now, maybe it just caught dirt on the contacts.

OSD position: Search these two lines in the source code:

Code: Select all

  @@xb60 equ 00006h ;06h+0           ;IO_60HZ_xloc_osd_lsb
  and
  @@xb50 equ 00006h ;06h+0           ;IO_50HZ_xloc_osd_lsb
And change 00006h to something around 00018h. For 60Hz you might need an even bigger value (at least it's so on the tianma display).
The 00006h is based on what was found in the disassembly of the original firmware, but I think nobody has ever tested/confirmed if that values are actually looking good.
After changing the source code: Use "Assemble File" in no$x51 to create the binary file. Oh, and for emulating it: Load the binary in no$x51, or assemble the source code, then use cursor keys and space for keypad input (it will emulate a tianma 4:3 display though).

To preset a default panel type: There is no intended way to do that... look at "@@prompt_panel_type:" and either change the code in that location, or prevent that code to be executed... basically you would need to insert this somewhere...

Code: Select all

 mov  dptr,xram_sett_panel_type
 mov  a,1           ;INNOLUX 480*272
 movx [dptr],a
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: Fri May 21, 2021 4:04 pm Display: You seem to have confused "aspect ratio 4:3" with "4.3 inch" in an earlier post. As far as I understand now, you have 16:9 wide screen display with 4.3 inch. I wish I would have one of those, too, even if it's just for testing, or a display with yet higher resolution : )
Sorry for that. Yes I have a couple of these 4.3 inches - 16:9 ratio monitors (plus a 5" on the way from China. I can't wait for to open this one too :) ).
Flash: The "MK 25D40B" cannot save settings, but the "BergMicro" chip can save settings? Are you sure, or is it the other way around?
Asking because I have a (working) "MK 25D40" here, which should be more similar to your "MK 25D40B".
I'm not sure the BergMicro can save settings; I assume it can't, since it doesn't write them with your software.I didn't check it before to upgrade the firmware, so I can't confirm.

Any idea / list about what spi chip will save settings?

BTW out of curiosity: I got an MX 25L4005AM2C-120 chip from an old PC motherboard. It's a little bit fatter (larger) than the 25D40, but it fits someway in the board. Looking at the datasheet, it seems to be compatible in most data, but the clock is different (85 Mhz) from the 25D40 (75 MHz). I programmed it with your firmware but the display refused to boot. So I was wondering if there's any compatibility issue or, due to the bigger size, I didn't solder it perfectly.
If you have selected the wrong panel type: Hold down the middle button on power-up to get back to the panel selection screen.
Thanks, I didn't know. Valuable info!
Button/resistors: Don't know why it requires 3.3K instead of 4.7K, maybe they have intentionally wired something differently to make the board incompatible with other boards. You could also change the min/max value in my source code's "keypad_16h_info" table instead of using different resistors, but if 3.3K works for you then that's fine, too.
Over here (unrelated to your issue), the 1K ohm "+" button is behaving erratically, half of the time it's randomly triggering one of the other two buttons, I haven't used the display for a while, but it did work perfectly stable some years ago, I am a bit puzzled why it stopped working now, maybe it just caught dirt on the contacts.
That's nice: in the 2nd monitor, the 1k resistor doesn't work really fine, sometimes it has some strange behavior. Since it works enough for test, I planned to get the rid of it later. However, using a normal, 1k 1/4w resistor applied manually, it seems to work ok, so I believe I have an issue with the button or the SMD resistor. Will check it later.
OSD position: Search these two lines in the source code:

Code: Select all

  @@xb60 equ 00006h ;06h+0           ;IO_60HZ_xloc_osd_lsb
  and
  @@xb50 equ 00006h ;06h+0           ;IO_50HZ_xloc_osd_lsb
And change 00006h to something around 00018h. For 60Hz you might need an even bigger value (at least it's so on the tianma display).
The 00006h is based on what was found in the disassembly of the original firmware, but I think nobody has ever tested/confirmed if that values are actually looking good.
After changing the source code: Use "Assemble File" in no$x51 to create the binary file. Oh, and for emulating it: Load the binary in no$x51, or assemble the source code, then use cursor keys and space for keypad input (it will emulate a tianma 4:3 display though).
Thank you! I will do a try. Eventually I had discovered that the cursors and the space keys serve as panel emulation, LOL.

To preset a default panel type: There is no intended way to do that... look at "@@prompt_panel_type:" and either change the code in that location, or prevent that code to be executed... basically you would need to insert this somewhere...

Code: Select all

 mov  dptr,xram_sett_panel_type
 mov  a,1           ;INNOLUX 480*272
 movx [dptr],a
Great! That's wonderful, I was trying to understand how to modify the code messing around the @@prompt_panel_type source code, but I didn't discover how to do that yet.

If I can abuse of your patience... I wish to put a couple of defaults settings that would be really useful (at least for me):

backlight = 100%
aspect ratio = 16:9

It would be great if you can pinpoint me in the right direction...

Talking in a less specific way, it would be fine to know how to set the defaults for the menu items; especially how the image settings like brightness, contrast, saturation, etc. could be set as default. This would help a lot if your spi chip can't save the settings: in fact you will probably almost never need to change them later, especially if you plan to use your display for a specific purpose (like C64, as in my case). Well, just a thought...

Ok, time to modify the firmware, will tell you later the results :)
Last edited by giobbi on Fri May 21, 2021 5:39 pm, edited 2 times in total.
nocash
Posts: 1405
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: AMT630A firmware for mini TFT screens

Post by nocash »

giobbi wrote: Fri May 21, 2021 5:17 pmI'm not sure the BergMicro can save settings
Didn't you say that you had entered the wrong panel type setting on that BergMicro board, and it did then save that setting?

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.
giobbi wrote: Fri May 21, 2021 5:17 pm If I can abuse of your patience... I wish to put a couple of defaults settings that would be really useful (at least for me):
backlight = 100%
aspect ratio = 16:9
Well, just initialize the corresponding "xram_sett" variables as described in previous post.
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: Fri May 21, 2021 5:37 pm Didn't you say that you had entered the wrong panel type setting on that BergMicro board, and it did then save that setting?
I think you are talking about I mentioned the fact if you do a wrong choice at the beginning there's no recovery. I was speaking generally; in my case they don't write the setting, so it's just a matter of power off/power on. Sorry for the misunderstanding.
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.
ok.
Well, just initialize the corresponding "xram_sett" variables as described in previous post.
Great, it worked flawless in the No$x51 simulation! Ok, time to compile and to warm the iron! Stay tuned...
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

Of course nothing is easy.... LOL

Code: Select all

; Suggested by NOCASH to set panel_type = innolux 

; jne  a,lcdspi_NV3035C,@@prompt_panel_type 
; clr  a   
  
 mov  dptr,xram_sett_panel_type  ; settings panel type       
 mov  a,1           ;INNOLUX 480*272    
;mov  a,0           ; TIANMA 320X240 
 movx [dptr],a  
  
 mov  dptr,xram_sett_backlight   ;Settings Backlight
 mov  a,100
 movx [dptr],a
  
 mov dptr,xram_sett_ratio       ;Settings Mode/Ratio (16:9 or 4:3)
 mov  a,1
 movx [dptr],a
 
 sjmp @@have_detected_panel_type 
I removed the call to @@prompt_panel_type, since I suppose it's not needed.
It seems to work fine on the simulation (but I need to keep the tianma setup (mov a,0) or the No$x51 doesn't work properly) but it has a strange behavior on the startup with my monitor. Blame on me :oops:

I posted a small clip on youtube that shows clearly what's going on (and you can also see my 1k button sometimes doesn't work too, LOL): https://youtu.be/T54CNSKraio

Where I went wrong?

At least it applies the settings (backlight and ratio) correctly!
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

I did some steps ahead and, at least, I solved in some (questionable) way my problem.

I've realized that in the No$x51 I was having the same problem, but it was hidden by the use of the different panel (innolux) that causes a white screen in the emulator.

So I messed up a bit the source code, and I eventually found a config that works also in the real monitor (it just does a couple of annoying display on-display off at the beginning). Respect the code I posted above, I added some instructions after the settings commands (panel type, backlight and ratio) and before to call @@have_detected_panel_type:

Code: Select all

 
 mov  dptr,xram_sett_panel_type  ; settings panel type       
 mov  a,1           ;INNOLUX 480*272    ; --> a,0 = TIANMA 320X240 
 movx [dptr],a  
  
 mov  dptr,xram_sett_backlight   ;Settings Backlight
 mov  a,100
 movx [dptr],a

 mov dptr,xram_sett_ratio       ;Settings Mode/Ratio (16:9 or 4:3)
 mov  a,1
 movx [dptr],a
 
 call switch_screen_and_backlight_on
 mov  a,64h                             ;\delay 100 (allow input_selector to find something)
 call firm_wait_a_milliseconds          
 call apply_settings_to_IO_ports        
 call switch_screen_and_backlight_on
 call firm_do_save_settings

 sjmp @@have_detected_panel_type  
 
 
I guess that some of the instructions above is not needed there; particularly the fact the display switches on, off and on again issue is probably due to the first call at switch_screen_and_backlight_on... but it's a step ahead, indeed. Now when you power the monitor, the display switches on without to ask anything...

------------------------------------------------------------------------------------

A question, out of curiosity, for future use:

I've seen the 5 inches display I'm waiting from China has a resolution of 800 * 480. The firmware knows two panels (and two different resolutions), innolux and tianma:

Code: Select all

 mov a,1   ;INNOLUX 480*272    
;mov a,0   ;TIANMA 320*240 
 
do you know if the firmware should automatically detect the new panel, so "1" will be a correct choice?

------------------------------------------------------------------------------------

EDIT: another question.
I've seen in your firmware a note about the option for using AV1 and AV2 ad Luma an Chroma from an S-Video source. AFAIK the AMT630A can just manage composite video. Is there any workaround by firmware?
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

A great thing I just discovered it works with VIC-20 too!

Image

While I was replacing the broken CRT in my SX64, I used an external adapter to fix the Commodore sync problem; but it worked with the C64 only, not the VIC-20.

The image is a little fuzzy, but I think it's due to the same VIC-20 character font (probably replacing the VIC-20 Char Rom with the C64 Char Rom the image quality would be improved a lot). And the picture above is quite worse than you really see.

One more reason to say thanks! and congrats! to @nocash for his incredible work!!!

I will check with the other 8-bit computers, 16, 116 and Plus/4, but I'm quite confident they will work flawless.
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

aarkay_14 wrote: Sun Jan 17, 2021 5:12 am Dear people who know how to program the SPI for this small LCD! May I ask you to kindly let me know how to program AMT630a? I have an SPI programmer tool but what pins do I connect to and what software to use?

-Rama
I have a cheap Genius 540 programmer (similar to the TLL86). I removed the SPI chip from the TFT board, I made a little adapter out of a small pcb and 8 pins (my programmer accept the DIP only). Pin #1 of the spi to the pin #1 in the programmer, and so on.
I programmed it with the Macronix MX 25L4005 settings (it's the most similar option in the programmer software).
Before to erase the chip I read its content, to be sure the programmer can manage it and also to save the original firmware.
Then I programmed the chip, desoldered from the adapter I made and soldered it again on the TFT board. A little tricky but with some patience it wasn't hard to do.

The chip is the 8 pin chip on the board, probably labelled like 25x40, something like this. Beware, you could find two chips with eight pins; the other one is the voltage regulator (it could be labelled as XL1509... or not, those boards a slightly different among them).
giobbi
Posts: 28
Joined: Sat Apr 24, 2021 11:33 am

Re: AMT630A firmware for mini TFT screens

Post by giobbi »

tonycheunghkg wrote: Thu Apr 09, 2020 4:18 am Hi,
I've found the schematics from supplier https://tigermagnetics.com/zip/AMT630_d ... matics.rar. If I remove all Buck convertor IC and peripherals of XL1509 may I give to board 5V ? Image
I just removed the XL1509 and shortcut pin #1 and #2. Now the board works with 5v. I planned to power the TFT directly from the pin #8 of the video connector of the Commodore 64 (but I still need to verify if it will not drain too much current).
Post Reply