Skip to content

A trivial black & white NTSC signal generator written in verilog.

License

Notifications You must be signed in to change notification settings

infiniteNOP/ntsc_gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A trivial black & white NTSC signal generator written in verilog.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages