614 Ring osc on VGA

614 : Ring osc on VGA

Design render

How it works

Manually-instantiated gf180mcuD inverter cells form a chain out of chain segments of varying lengths, allowing the user to select given points in the overall chain to loop back to produce a ring oscillator. This makes a configurable ring oscillator that is expected to be able to oscillate from about 15MHz up to 350MHz.

This (or an external clock) then can be selected to drive a "worker" module: a counter which counts up to 3000.

Alongside this is a VGA sync generator which takes its pixel colour from whatever is in the upper 6 bits of the worker's counter at the time. The worker is reset during HBLANK of each VGA line.

It's expected that at the faster ring oscillator speeds, the counter will reach its target of 3000 sooner than the width of the VGA line but with some jitter... or the counter/compare logic will break down because it's too fast.

How to test

Set clksel2[1:0] to 0.

Set clksel[3:0] to (say) 10, or anything greater than 1.

Set mode[1:0] to 0 (though these are unused at the time of writing; TBA).

Set vga_mode to 0.

Attach a Tiny VGA PMOD to uo_out.

Supply a 25MHz clock to the system clk, and assert reset for at least 2 clocks.

Expect to see vertical coloured bars on screen, but expect some jitter. Their width should increase as you increase clksel.

Measure the ring oscillator (or rather, the selected clock source) on uio_out[7:4]: uio_out[4] is the raw oscillator output, and the higher bits are the oscillator divided by powers of 2.

More testing notes:

  • When vga_mode==1, clk should be 26.6175MHz (106.47 MHz ÷ 4) to drive a 1440x900 60Hz VGA display.

  • When clksel2 is:

    • 0: Just rely on clksel.
    • 1: Use fixed 5-deep inv_1 ring oscillator.
    • 2: Use fixed 5-deep inv_4 ring oscillator.
    • 3: Use inverted clk.
    • NOTE: options 1 and 2 require clksel > 1 (any value will do) to enable the rings.
  • When clksel2==0 and clksel is:

    • 0: Use clk.
    • 1: Use altclk.
    • For values 2 and above, use an inv_2-based ring oscillator tapped at...
    • 2: => 3
    • 3: => 5
    • 4: => 7
    • 5: => 9
    • 6: => 13
    • 7: => 17
    • 8: => 21
    • 9: => 25
    • 10: => 33
    • 11: => 41
    • 12: => 49
    • 13: => 65
    • 14: => 97
    • 15: => 161

External hardware

Tiny VGA PMOD and a VGA monitor.

IO

#InputOutputBidirectional
0clksel[0]r7IN: clksel2[0]
1clksel[1]g7IN: clksel2[1]
2clksel[2]b7
3clksel[3]vsync
4altclkr6OUT: osc
5mode[0]g6OUT: div2
6mode[1]b6OUT: div4
7vga_modehsyncOUT: div8

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)