| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .. | ||
| boards | ||
| src | ||
| CMakeLists.txt | ||
| genfont | ||
| prj.conf | ||
| README.md | ||
videogen, a composite video generator
videogen generates ZX81-like composite video.
Characteristics
- 24 rows of 32 characters, i.e. 192 lines
- 128 characters, 64 normal and 64 reversed
Timing:
- Based off a 6.5 MHz clock
- Line width: 64 us
- HSYNC: 5 us
- VSYNC: 400 us
Timing details:
- PAL non-interlaced is 312 lines
- 8 lines of sync
- 16 unspecified lines
- 288 display lines
- "Text safe" area is 230 lines
- 1.7 us front porch before HSYNC
- 5.7 us back porch after HSYNC
- 32 8 bit characters on 6.5 MHz is 39 us
Signal levels:
- -0.3 V sync, 0 V black, 0.7 V white
- DC coupled seems to be fine
- A possible circuit using open drain
- Another
See ZX81 Video Display System or Batsocks for more.
Method
Use TIM1. CH2 is on the same trigger set as SPI TX, so CH2 can trigger the first write and SPI TX all following writes.
Signal looks like it would benefit from a front and a back porch.
SPI clock is 48/7 or ~6.86 MHz. A SPI byte is ~1.17 us, so there are ~54.9 bytes/line.
Front porch is black and 1.65 us, so 2 bytes.
Back porch is black and 5.7 us, so 5 bytes.
HSYNC is 4 us, so 4 bytes.
v1 using 16 bit SPI takes 105 us to render and write a line. Writing is 27*16 bits = 63 us, so the render is 42 us.
Rendering at -O2 gives 86 s, so the render time is 23 us.
PC6 is MOSI, PD2 is SYNC.