295 Ring osc on VGA

295 : Ring osc on VGA

Design render

How it works

This is a TTIHP0p4 experimental resubmission of the TTGF0p2 version: ttgf0p2-vga-ring-osc

Manually-instantiated ihp-sg13cmos5l 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 20MHz up to ~850MHz (theoretically 3.7GHz but this probably won't work).

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 25-deep inv_2 ring oscillator.
    • 2: Use fixed 25-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_1-based ring oscillator tapped at...
    • 2: => 3 => 3.70 GHz
    • 3: => 5 => 2.22 GHz
    • 4: => 9 => 1.23 GHz
    • 5: => 13 => 855 MHz
    • 6: => 19 => 585 MHz
    • 7: => 25 => 444 MHz
    • 8: => 33 => 337 MHz
    • 9: => 41 => 271 MHz
    • 10: => 57 => 195 MHz
    • 11: => 65 => 171 MHz
    • 12: => 97 => 115 MHz
    • 13: => 161 => 69.0 MHz
    • 14: => 289 => 38.4 MHz
    • 15: => 545 => 20.4 MHz

(NOTE: Frequencies are ROUGHLY estimated, and it's expected that going above 855MHz internally probably won't work).

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 Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_htfab_asicle2 (Asicle v2) tt_um_htfab_caterpillar (Simon's Caterpillar) tt_um_urish_simon (Simon Says memory game) tt_um_microlane_demo (microlane demo project) tt_um_ygdes_hdsiso8_dlhq (ttihp-HDSISO8) tt_um_ygdes_hdsiso8_rs (ttihp-HDSISO8RS) tt_um_YannGuidon_TinyScanChain (TinyScanChain5L) tt_um_MichaelBell_photo_frame (Photo Frame) tt_um_digital_clock_example (7-Segment Digital Desk Clock) tt_um_miniMAC (miniMAC_5L) tt_um_tinymoa_ihp0p4_16x16 (TinyMOA-IHP0P4-16x16) tt_um_glyph_mode_hd (Glyph Mode HD) tt_um_prism_lite (ihp_cmos51_prism) tt_um_htfab_rotfpga2 (ROTFPGA v2) tt_um_SotaSoC (SotaSoC) tt_um_essen (Fast bfloat multiplication) tt_um_calonso88_spi_i2c_reg_bank (Register bank accessible through SPI and I2C) tt_um_urish_usb_cdc (USB CDC (Serial) Device) tt_um_urish_rings (VGA Rings) tt_um_toivoh_demo (Orion Iron Ion [TT08 demo competition]) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_pakesson_glitcher (Glitcher) tt_um_chatelao_fp8_multiplier (OCP MXFP8 Streaming MAC Unit) tt_um_algofoogle_raybox_zero (raybox-zero TTIHP0p4 edition) tt_um_flummer_ltc (Linear Timecode (LTC) generator with I2C control) tt_um_lledoux_s3fdp_seqcomb (Pattern-Guided Arithmetic Optimizations with MLIR) tt_um_snake_game (SnakeGame) tt_um_spongent88 (Spongent-88 Hash Accelerator) tt_um_lledoux_bf16_diminished_kulisch (Pattern-Guided Arithmetic Optimizations with MLIR kulisch bf16) tt_um_float_synth_nikleberg (float_synth) tt_um_silicon_strummer (Silicon Strummer) tt_um_vga_clock (VGA clock) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_algofoogle_vgaringosc (Ring osc on VGA) tt_um_tinymoa_ihp0p4_8x8 (TinyMOA-IHP0P4-8x8) tt_um_tinytapeout_logo_screensaver (VGA Screensaver with Tiny Tapeout Logo) tt_um_lisa (LISA 8-Bit Microcontroller) tt_um_nicklausthompson_twi_monitor (TWI Monitor) Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available