You may think that your modern TV doesn't accept NTSC signal and you are probably wrong. Check for YPbPr input at the back. The green connector is probably also an NTSC composite input. It is the case with my 3 years old RCA TV and was the case with the Toshiba previous one.
So how simple it could be to generate color NTSC composite? Look at the schematic below.
The external oscillator is required to have a stable and precise chroma reference signal. The chosen one run at 8 times the chroma frequency. As PIC core divide the clock signal by 4. The CPU is running at 2 times the chroma frequency. This simple circuit can generate 6 colors.
colors | chroma output | video_y output |
---|---|---|
black | hi-z | hi-z |
white | hi-z | Vdd |
yellow | phase:180° | Vdd |
mauve | phase:0° | Vdd |
blue | phase:0° | hi-z |
dark green | phase:180° | hi-z |
The dark-green color is almost unusable as it is too close to black. It require a TV with a good contrast. So I didn't used it in the game.
The final result look like this:
All the source code and KiCAD project is on the Github repository.
This is coded in assembly to optimize the code. The final code use 54% of the 2Kword flash memory and 63% of 256 bytes of available RAM. So there is plenty of space.
Finally a short demo video. My camera doesn't capture de colors very well. the mauve look whitish.
An interesting read, the story of breakout game on wikipedia
Thanks,