TBC.
Reads data from an SPI flash ROM (or any memory compatible with, say, W25Q10 or above) and displays it on a VGA display.
Drives a display at one of two resolutions (selectable by vga_mode
):
NOTE: Some monitors will also sync 640x480 using the 26.6175MHz clock that's otherwise used for vga_mode 1... they'll get ~63Hz instead of 60Hz. That means if you can get near this frequency, you might find it to be a good middle ground that allows you to switch live between 640x480 and 1440x900. My HP L1908wm monitor works fine this way for clocks in the range of 26.3MHz to 27.0MHz, and might even work slightly beyond that.
The flash memory contents are displayed using two alternating line modes (4 lines each):
These two line modes are timed to line up, so we can check for consistency between them, but note that there is actually expected to be a slight delay in the 'MISO direct' mode because the MISO output data appears on the falling SCLK edge. At 1440x900, this should be apparent.
The reg_outs
signal, if HIGH, specifies that the VGA output signals should be
registered. If LOW, the raw outputs go directly to the VGA display (inc. directly
from the SPI memory when not in a buffered line).
NOTE: This tries to use !CLK
(main clock, inverted) to drive the SPI SCLK directly,
so that we don't need a faster system CLK in order to manage extra states. It keeps
this SCLK
output running constantly, relying on /CS
.
NOTE: Besides the main design, I've got simple loopback test:
Test_in[2:0]
feeds a 3-input logical AND
which outputs to Test_out
It could be interesting, when we get the actual chip back, to compare inputs to outputs on an oscilloscope.
NOTE: The sync polarity of hsync
and vsync
will be determined by vga_mode.
TBC.
Attach an SPI memory chip with some data in it, e.g. SPI flash ROM like W25Q10. Anything that accepts a 24-bit address and supports at least 27MHz reads should be fine. I used a generic 25Q80 (8Mbit) that I pulled off an ESP-01.
Attach a VGA display:
vga_mode
to GND,
and use a 25.000MHz (or ideally 25.175MHz) clock source. If you want to try 1440x900@60Hz mode
instead, strap vga_mode
high and use ~26.6175MHz as your clock source.hsync
, vsync
must be connected to the display; I recommend buffering them (as above)
and then a 100Ω resistor then in series with their respective VGA pins (for safe current
limiting) even though 100Ω is more often done.red
, green
, and blue
, each via a 1kΩ resistor, to their respective VGA colour
channel input pins. It might be pretty dark, but should be safe on Caravel IO pins if you
don't otherwise buffer them.VGA DAC (RGB111 or 222 depth) and SPI flash memory
# | Input | Output | Bidirectional |
---|---|---|---|
0 | In: vga_mode | Out: red[1] | Out: SPI /CS |
1 | In: rst_mode | Out: green[1] | Out: SPI io[0] / MOSI |
2 | In: reg_outs | Out: blue[1] | Out: SPI io[1] / MISO |
3 | In: N/C | Out: vsync | Out: SPI SCLK |
4 | In: N/C | Out: red[0] | Out: Test_out |
5 | In: Test_in[0] | Out: green[0] | Out: SPI /RST |
6 | In: Test_in[1] | Out: blue[0] | Out: SPI io[2] (/WP) |
7 | In: Test_in[2] | Out: hsync | Out: SPI io[3] (/HLD) |