611 Video mode tester

611 : Video mode tester

Design render

Video mode tester peripheral

Author: htfab

Peripheral index: 28

What it does

There is quite some variability between screens (and VGA/HDMI adapters) in the set of VGA timing configurations they support.

Due to constraints and optimization pressures, VGA designs on Tiny Tapeout typically use a single resolution that cannot be changed without a respin. It would therefore be useful to gather some crowdsourced information on what VGA modes are well supported among the community.

This peripheral facilitates gathering that information.

It allows setting the horizontal and vertical timing parameters (visible pixels, front porch, sync pulse, back porch) and displays a simple test pattern on the screen. There is a thin white border along the screen edges to quickly check whether anything was cut off.

Each phase (visible pixels, front porch, sync pulse, back porch) is described by its length in pixels (a 13-bit integer) and 3 single-bit flags. Internally all 4 phases are identical and the flags are the mechanism to differentiate their behaviour:

  • bit 15: keep hsync/vsync high during this phase
  • bit 14: allow data on the r/g/b pins during this phase
  • bit 13: advance to the next line/frame at the end of this phase

For instance, a video mode with positive hsync/vsync polarity could use flags 010 for the visible pixels, 000 for the front porch, 100 for the sync pulse and 001 for the back porch.

Register map

Address Name Access Description
0x00 DATA R/W Horizontal visible pixels, high byte (incl. flags)
0x01 DATA R/W Horizontal visible pixels, low byte
0x02 DATA R/W Horizontal front porch, high byte (incl. flags)
0x03 DATA R/W Horizontal front porch, low byte
0x04 DATA R/W Horizontal sync pulse, high byte (incl. flags)
0x05 DATA R/W Horizontal sync pulse, low byte
0x06 DATA R/W Horizontal back porch, high byte (incl. flags)
0x07 DATA R/W Horizontal back porch, low byte
0x08 DATA R/W Vertical visible pixels, high byte (incl. flags)
0x09 DATA R/W Vertical visible pixels, low byte
0x0a DATA R/W Vertical front porch, high byte (incl. flags)
0x0b DATA R/W Vertical front porch, low byte
0x0c DATA R/W Vertical sync pulse, high byte (incl. flags)
0x0d DATA R/W Vertical sync pulse, low byte
0x0e DATA R/W Vertical back porch, high byte (incl. flags)
0x0f DATA R/W Vertical back porch, low byte

How to test

To use the universally supported 640x480 @ 60 Hz video mode, we would like to set

  • Horizontal visible pixels: 640 (high byte 2, low byte 128)
    • 0x00: 66 ("visible" flag adds 64)
    • 0x01: 128
  • Horizontal front porch: 16 (high byte 0, low byte 16)
    • 0x02: 0
    • 0x03: 16
  • Horizontal sync pulse: 96 (high byte 0, low byte 96)
    • 0x04: 128 ("sync" flag adds 128)
    • 0x05: 96
  • Horizontal back porch: 48 (high byte 0, low byte 48)
    • 0x06: 32 ("advance" flag adds 32)
    • 0x07: 48
  • Vertical visible pixels: 480 (high byte 1, low byte 224)
    • 0x08: 65 ("visible" flag adds 64)
    • 0x09: 224
  • Vertical front porch: 10 (high byte 0, low byte 10)
    • 0x0a: 0
    • 0x0b: 10
  • Vertical sync pulse: 2 (high byte 0, low byte 2)
    • 0x0c: 128 ("sync" flag adds 128)
    • 0x0d: 2
  • Vertical back porch: 33 (high byte 0, low byte 33)
    • 0x0e: 32 ("advance" flag adds 32)
    • 0x0f: 33

After setting the pixel clock to 25 MHz and writing these registers the test pattern should appear on the screen connected to the Tiny VGA PMOD.

External hardware

Tiny VGA PMOD

IO

#InputOutputBidirectional
0TinyVGA red 1
1TinyVGA green 1
2TinyVGA blue 1
3TinyVGA vsyncspi_miso
4TinyVGA red 0spi_cs_n
5TinyVGA green 0spi_clk
6TinyVGA blue 0spi_mosi
7TinyVGA hsync

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_htfab_asicle2 (Asicle v2) tt_um_urish_simon (Simon Says memory game) tt_um_dlmiles_ringosc_5inv (Ring Oscillator (5 inverter)) tt_um_rejunity_vga_logo (VGA Tiny Logo) tt_um_rejunity_sn76489 (Classic 8-bit era Programmable Sound Generator SN76489) tt_um_wokwi_392873974467527681 (PILIPINAS_IC) tt_um_wokwi_442081253563458561 (PRISM 8 with TinySnake) tt_um_waferspace_vga_screensaver (Wafer.space Logo VGA Screensaver) tt_um_rejunity_z80 (Zilog Z80) tt_um_MichaelBell_tinyQV (TinyQV Risc-V SoC) tt_um_calonso88_spi_i2c_reg_bank (Register bank accessible through SPI and I2C) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_gf0p2_faust_top (Silly-Faust) tt_um_htfab_cells (Cell mux) tt_um_zedtc1_top (Zedulo TestChip1) tt_um_essen (2x2 MAC Systolic array with DFT) tt_um_BLE_RX (SCµM-BLE-RX) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_schoeberl_wildcat (Wildcat RISC-V) tt_um_vga_clock (VGA clock) tt_um_digital_clock_example (7-Segment Digital Desk Clock) tt_um_rejunity_vga_test01 (VGA Drop (audio/visual demo)) tt_um_a1k0n_nyancat (VGA Nyan Cat) tt_um_proppy_megabytebeat (megabytebeat) tt_um_javibajocero_top (MarcoPolo) tt_um_kercrafter_leds_racer (LEDs Racer) tt_um_noritsuna_CAN_CTRL (CAN Controller for Rocket) tt_um_algofoogle_raybox_zero (raybox-zero TTGF0p2 edition) tt_um_flummer_ltc (Linear Timecode (LTC) generator) tt_um_dlmiles_bad_synchronizer (Example of Bad Synchronizer) tt_um_multi_bit_puf_wrapper (One Bit PUF) tt_um_algofoogle_vgaringosc (Ring osc on VGA) tt_um_lisa (LISA 8-Bit Microcontroller) tt_um_mmorri22_lockpick_game (Notre Dame - Lockpick Game TT Example) tt_um_simple_riscv (Simple RISC-V) tt_um_mmorri22_cse_30342 (Notre Dame - CSE 30342 - DIC - Advanced FSM Final Project Example) tt_um_zacky1972_PVTMonitorSuite (PVTMonitorSuite) tt_um_SophusAndreassen_dogbattle (Dog Battle Game) tt_um_frequency_counter (Frequency Counter SSD1306 OLED) tt_um_wokwi_445338187869298689 (WokwiPWM) tt_um_kbeckmann_flame (Flame demo) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_spi_cpu_top (Super-Simple-SPI-CPU) tt_um_urish_usb_cdc (USB CDC (Serial) Device) tt_um_htfab_vga_tester (Video mode tester) tt_um_dlmiles_ddr_throughput_test (DDR throughput and flop aperature test) tt_um_dlmiles_loopback (GF180MCU loopback tile with input skew measurement) tt_um_thezoq2_quickscope (Quickscope) tt_um_MATTHIAS_M_PAL_TOP_WRAPPER (easy PAL) tt_um_htfab_rotfpga2 (ROTFPGA v2)