Sponsorizzato

GitHub - mogrinz/AMT630A: An Arduino Library for working with the AMT630A chip

0
1

AMT630A OSD

Arduino/ESP32 library for controlling the hardware on-screen display (OSD) engine in AMT630A-based composite-video LCD monitor boards.

Version 0.7.0

Project video

Watch the AMT630A OSD / Robby HUD project on YouTube

Watch on YouTube

The library exposes the AMT630A's five hardware OSD windows as a practical Arduino API for text, custom glyphs, 16-color 4bpp bitmaps, palette animation, opacity/video blending, scaling, blink regions, and window movement. It also includes a Python image converter and optional automation for entering the hidden factory menu on one hardware-tested three-button monitor firmware.

Hardware status: This project is based on hardware testing and reverse engineering of real AMT630A monitor boards. AMT630A products are not all guaranteed to use the same firmware, panel timing, keypad circuit, or exposed I2C connections. Features marked as hardware/firmware-specific should be treated accordingly.

Features

  • Five independently positioned AMT630A OSD windows.
  • LargeFont (16x22 cell geometry) and SmallFont (10x16 cell geometry).
  • Text drawing, foreground/background colors, centered strings, bars, rectangles, and raw glyph IDs.
  • Shared 512-cell Index RAM allocation and inspection helpers.
  • LargeFont custom glyphs stored in Font RAM.
  • 4bpp bitmap resources using 16x22 LargeFont-compatible tiles.
  • 4096-word / 8192-byte Font RAM bitmap allocator.
  • Global 16-entry bitmap palette, RGB helpers, palette-0 transparency, and palette animation.
  • Global OSD/video blending, opacity, and brightness controls.
  • Per-window 1x-4x horizontal and vertical scaling.
  • Hardware blink-region support.
  • Lightweight window movement and batch-update APIs.
  • Python GIF/PNG/JPEG/BMP-to-Arduino bitmap converter with RGB444-aware quantization, shared palettes, memory limits, and preview output.
  • LargeFont and SmallFont character-set browser examples.
  • Optional GPIO-driven factory-menu keypad automation for compatible stock firmware.

Installation

Arduino Library Manager

After this repository has been accepted into the Arduino Library Manager registry:

  1. Open Arduino IDE.
  2. Choose Sketch > Include Library > Manage Libraries... (or open Library Manager in Arduino IDE 2.x).
  3. Search for AMT630A OSD.
  4. Select the desired version and click Install.

Install from ZIP

Download the release ZIP, then in Arduino IDE choose Sketch > Include Library > Add .ZIP Library... and select it.

Install from source

Clone or copy the repository into the libraries directory of your Arduino sketchbook. Restart Arduino IDE if it was already open.

Basic wiring

The library communicates with the AMT630A over I2C. The default ESP32 pins used by begin() are:

Signal Default ESP32 pin
SDA GPIO 21
SCL GPIO 22

Always connect grounds between the ESP32 and monitor electronics. Do not assume every AMT630A monitor exposes the same test pads, voltage levels, supply input, or keypad arrangement; verify your own board before connecting it.

Custom pins and I2C clock can be supplied to begin():

display.begin(21, 22, 100000);

Minimal text example

#include <AMT630A_OSD.h>

AMT630A_OSD display;

void setup() {
  Serial.begin(115200);

  if (!display.begin()) return;
  if (!display.setFontMode(AMT630A_OSD::LargeFont)) return;
  if (!display.configureWindow(0, 160, 44)) return;

  display.setDisplayOrigin(0, 40, 40);
  display.writeString(0, 0, 0, "HELLO", AMT630A_OSD::White);
  display.setVisible(0, true);
  display.forceUpdate();
}

void loop() {
  display.service();
}

Important stock-firmware / C6 ownership note

The AMT630A uses SYS register C6 to select whether the internal 8051 MCU or external I2C controls internal registers. On the hardware-tested monitor, the stock firmware periodically accesses internal video/decoder registers and normally expects MCU ownership. Repeatedly taking external ownership during normal stock-firmware operation was found to eventually freeze the complete display pipeline, including both OSD and live composite video.

The library still uses the external-I2C mechanism because it is how the OSD is controlled. On the tested three-button monitor, entering the hidden factory menu before sustained external OSD activity prevented the observed contention/freeze during long-duration testing. The EnterFactoryMode example automates that procedure using a 74HC4066 connected across the existing keypad switches.

This factory-menu procedure is firmware-specific. It is not automatically invoked by begin() and is not inserted into the other examples. If your monitor has different firmware, validate its behavior independently.

Factory-menu automation

The tested monitor has three physical buttons: Menu, +, and -, implemented as a passive resistor ladder. Three channels of a 74HC4066 can be placed across those button contacts so an ESP32 can electronically press them while leaving the physical buttons usable when the ESP32/4066 circuit is powered.

Tested 74HC4066 mapping:

Button 4066 switch pins 4066 control Example ESP32 GPIO
+ 1, 2 13 5
Menu 3, 4 5 18
- 8, 9 6 19
Power VCC 14, GND 7 3.3 V / GND

The default library sequence is:

Menu, Menu, Menu, -, Menu, +, -, -, +, +, Menu

On the tested firmware, the sequence must finish while Brightness is active and the final Menu press opens the Factory screen. Hardware testing found 100 ms press / 150 ms gap to be the shortest repeatable timing; the example uses 150 ms / 200 ms for margin.

display.configureFactoryMenuControl(18, 5, 19); // Menu, Plus, Minus
display.setFactoryMenuTiming(150, 200);
display.enterFactoryMode();

A custom sequence can be supplied with FactoryMenuStep and setFactoryMenuSequence().

setFactoryOSDCoexistence(true) tells visibility management to preserve OSD-enable/blink bits already set by the stock firmware instead of replacing them. It does not itself enter factory mode.

See examples/EnterFactoryMode.

Fonts and character sets

Font mode is global:

display.setFontMode(AMT630A_OSD::LargeFont);
display.setFontMode(AMT630A_OSD::SmallFont);

Verified cell geometry:

Mode Cell size
LargeFont 16 x 22 pixels
SmallFont 10 x 16 pixels

writeString() maps common ASCII characters into the AMT630A's built-in ROM. writeGlyph() bypasses ASCII mapping and writes a raw 10-bit glyph ID. The bundled LargeFontCharacterSetBrowser and SmallFontCharacterSetBrowser examples let you explore the monitor's ROM from the Serial Monitor. The verified SmallFont ROM mapping used by ordinary ASCII begins around 0x1C0; digits begin at 0x1C1 and letters at 0x1CB.

Windows and Index RAM

There are five hardware OSD windows, but all five share 512 Index RAM cells. Windows may overlap visually; their backing Index RAM allocations must fit in the shared 512-cell pool.

display.configureWindow(0, 160, 66);  // pixels; converted to cells
display.setDisplayOrigin(0, 30, 30);

Inspection helpers:

display.getWindowWidth(0);
display.getWindowHeight(0);
display.getColumns(0);
display.getRows(0);
display.getWindowIndexStart(0);
display.getWindowIndexCells(0);
display.getIndexRAMUsed();
display.getIndexRAMFree();

releaseWindow() frees a window and allows the library to reallocate the remaining Index RAM regions.

Drawing text and cells

display.clearWindow(0);
display.clearRegion(0, 2, 1, 4, 2);
display.fillRect(0, 0, 0, 8, 1, AMT630A_OSD::Blue);

display.setCell(0, 0, 0, glyph,
                AMT630A_OSD::White,
                AMT630A_OSD::Blue);

display.writeGlyph(0, 1, 0, 0x123,
                   AMT630A_OSD::White,
                   AMT630A_OSD::Transparent);

display.writeString(0, 0, 1, "READY",
                    AMT630A_OSD::Green,
                    AMT630A_OSD::Transparent);

display.writeStringCentered(0, 2, "CENTERED");
display.writeBar(0, 0, 3, 75, 100, 10, AMT630A_OSD::Green);

Available text colors are Transparent, White, Red, Green, Blue, Cyan, Yellow, and Black.

Drawing changes the library's RAM copy and marks affected cells dirty. updateDisplay() sends dirty cells; forceUpdate() sends all cells in the requested window(s).

Cerca
Categorie
Leggi tutto
Tech
WordPress ওয়েবসাইট ধীর হলে কী করবেন? কারণ শনাক্ত ও সমাধানের ধাপ - Tech Tips Desk – বাংলা প্রযুক্তি সংবাদ, মোবাইল রিভিউ ও টিপস
স্বাভাবিকভাবে চলার পর হঠাৎ ধীর হয়ে গেলে অনেকেই প্রথমে Cache পরিষ্কার করেন, নতুন কোনো গতি বাড়ানোর...
By Nettumi 2026-09-30 18:35:25 0 2
Nulled
Organto - Organic Food & Farming HTML Template
Organto – Organic Food & Farming HTML Template Free Download. Organto is a Fresh and...
By Nettumi 2026-09-17 18:27:32 0 46
Nulled
ডাক্তার, ওষুধ ও হাসপাতাল খুঁজুন এক ক্লিকেই | Techtunes | টেকটিউনস
অ্যাপল মানুষকে ফিরিয়ে নিচ্ছে হাত ঘড়ির যুগে… অসামান্য প্রাযুক্তিক উৎকর্ষতায়! একটি Apple...
By Nettumi 2026-09-21 05:26:13 0 30
Hacking Course
Bkash এর QR হ্যাকিং টেকনিক
Bkash এর QR হ্যাকিং টেকনিক! এই আর্টিকেলটি লেখা কতোটা যুক্তিগত বা নৈতিক হচ্ছে সেটার বাইরে...
By Nettumi 2026-09-25 16:55:59 0 20
Nulled
মিউজিক প্রেমিদের জন্যে সুখবর | Techtunes | টেকটিউনস
তৈরী করুন উইন্ডোজের লাইভ সিডি এস এম মেহেদী আকরাম
By Nettumi 2026-09-25 03:20:36 0 14
‎ ‎ ‎
Nettumi https://nettumi.com