
Daylight Matchstick
VoronDesign/Voron-Hardware
Cool Hardware designed by the Voron Design group

Verilog implementation of PAL, NTSC and SECAM color encoding
Fpga composite video is an open-source printed circuit board by Slamy, from the Slamy/fpga-composite-video repository on GitHub, published under the MIT licence. It is a 2-layer board of 33 × 71.1 mm with 22 parts on 56 nets, routed with 37 tracks and 0 vias.
Its parts include 18 resistors, 3 connectors and 1 capacitor. It belongs with the fPGA and programmable logic boards and the FPGA and CPLD boards of this library.
This project aims to implement an encoder on FPGA basis to convert a digital YUV signal to PAL/NTSC or SECAM composite video.
After having started using a Xilinx Spartan-3AN in 2012, I've decided to port this project to the Tang Nano 9K as it is quite affordable, small and also usable for experimentation on a breadboard so it can be build by everyone.
Compared to other projects using GOWIN FPGAs, this is based on the official GOWIN EDA synthesis tools.
The free educational version should be sufficient here.
Open gowin/testpic_gen.gprj and start the synthesis.
openFPGALoader is required for this
gowin/upload.shopenFPGALoader is required for this
gowin/flash.shUse one of these scripts
tools/vlc_pal.sh
tools/vlc_ntsc.sh
tools/vlc_secam.sh
These were recorded using this USB videograbber and OpenCV.
This picture of a parrot was cropped to fit into 4:3 and is then resized by the Python script to fit into the framebuffer.

PAL is the clear winner here. Reproduced in interlacing mode at a resolution of 720 x 576. It looks a little bit too bright though.

NTSC should show similar results to PAL but sadly doesn't. The color carrier is clearly visible. The used resolution here is 720 x 480. Also OpenCV doesn't scale the output to 4:3 and instead uses square pixels. This is more noticable with NTSC as with PAL where it is the opposite problem.

SECAM is the problem child of this project. The preemphasis (Video and RF) doesn't work correctly, causing some horizontal artefacts in form of the popular "SECAM fire".

From top to bottom we have EBU 75% color bars for NTSC, PAL and SECAM.

This picture clearly shows the problems with SECAM as not the color itself is transmitted but instead the color transition. The preemphasis doesn't fit the deemphasis.

Here EBU 100% to check for edge case problems.
As SECAM continued to cause issues a very specific test was created for analysis. A sepcial test picture with color gradients and multiple color bars. As SECAM doesn't transmit the current color but instead color changes this should help to check various scenarios in one picture.
It also contains a part from my Pong machine I'm currently working one.

Here is the result, received from the USB video grabber:

It doesn't look that bad but SECAM surely has problems with sharp edges when it comes to my implementation.
For some reason my USB video grabber has a 17 degree offset on the color burst. On my TV set this is not the case and the burst must occur with 0 degrees. Please use configure.py and set ntsc_burst_phase to 0 to fix this. The problem should then go away. I don't understand why I have this problem. Maybe someone else has an idea...
System Verilog:
IIR filter design:
PAL/NTSC/SECAM:
PAL:
NTSC:
SECAM:
PSRAM:
YUV Framebuffer formats:
DAC:
Modelsim:
Colorful parrot picture for testing which is published under free license and can therefore be packaged with this project
| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | 120 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal | R9, R10, R11, R12, R14, R15, R16 |
| 7 | 240 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal | R1, R2, R3, R4, R5, R6, R7 |
| 4 | 470 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal | R8, R17, R18, R19 |
| 2 | Conn_01x24 | Connector_PinHeader_2.54mm:PinHeader_1x24_P2.54mm_Vertical | J1, J2 |
| 1 | C | Capacitor_THT:C_Rect_L7.0mm_W2.0mm_P5.00mm | C1 |
| 1 | Conn_Coaxial | Inductor_THT:L_Axial_L9.5mm_D4.0mm_P5.08mm_Vertical_Fastron_SMCC | J3 |

VoronDesign/Voron-Hardware
Cool Hardware designed by the Voron Design group

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

abhishek-kakkar/BeagleLogic
A Software Suite that implements a logic analyzer with the PRU on the BeagleBone / BeagleBone Black.

Chrismettal/flipper-zero-backpacks
Backpack-style addon boards for the Flipper Zero!



CRImier/MyKiCad
My KiCad boards. Can't be bothered uploading individually anymore, so here you go.
It measures 33 × 71.1 mm and has 2 copper layers, 1.6 mm thick.
22 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the Slamy/fpga-composite-video repository on GitHub, at the commit this page was made from: the board is kicad/circuit/circuit.kicad_pcb and its schematic kicad/circuit/circuit.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).