forked from infiniteNOP/ntsc_gen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
60 lines (44 loc) · 2.15 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
This is a crude NTSC generator, which I wrote in order to provide rudimentary
graphics capabilities for my nopCPU project. It is capable of generating
a black-and-white 320x240 video signal, and requires a 2-bit-wide and
76800-words-deep memory module (For details, read comments inside gen.v).
In order to use this in a real circuit, configure dacout to use
3.3V logic levels, and build the following circuit:
|----|
--dacout(1)--|270Ω|---|
|----| |
|
|
|
|----| |
--dacout(0)---|680Ω|--|-----TV in---
|----|
(Best viewed using a monospace font)
The required voltages are generated via a resistive divider that is formed
with the video input's internal 75Ω impedance.
Supported colo(u)rs:
2'b01: Black
2'b10: Gray
2'b11: White
WARNING: DO NOT attempt storing 2'b00 in the pixel memory, as doing so will
make the generator output sync levels prematurely, and, as such, will confuse
your TV, and make it produce garbled frames. THIS IS NOT A BUG!
Copyright (C) 2016 John Tzonevrakis. For details, please read the COPYING file.
PLEASE NOTE THAT I AM NOT RESPONSIBLE FOR *ANY* DAMANGES THAT MIGHT ARISE AS
A RESULT OF USING THIS MODULE, INCLUDING DAMAGES TO LIFE AND/OR PROPERTY!!!
TODO:
(1) Test it with an actual TV (Timing looks OK in simulation :>)
(2) Implement a proper character generator for this thing
(3) Add colo(u)r!
Due to the wide variety of FPGA vendors and synthesis tools, I cannot provide
specific instructions on synthesizing and using this piece of code. However,
please do keep in mind that this generator has been designed for use with a
10 MHz clock. Any different frequency will result in timing errors.
If all you want is to test the timing of the module, you will need iverilog
and a vcd viewer (in my opinion, gtkwave is quite a fine tool for this job).
Invoke iverilog in the following way:
iverilog gen_tb.v gen.v -o ntsc_gen
Then, run ntsc_gen, and stop it after the desirable amount of time units
has passed, by pressing CTRL+C and then typing "finish" in the command
prompt that appears.
That's all folks, have a lot of fun!