Outils pour utilisateurs

Outils du site


NTSC Closed Captioning decoder

A shield to decode Closed Captioning (“line 21” EIA-608) from NTSC Composite Video.

Status

Status du project
Date de début 05/2016
Status Work in progress
Initiateur Magnus

"Shield" description

Circuit description

The idea of this shield is to decode the line 21 closed captioning that is present in many NTSC video signals. To do so, one needs essentially to perform two tasks:

  1. Locate line 21
  2. Slice the bits present in this line

Often, a LM1881 is used for the first part (and probably this is the better way of doing so), but here a different approach is followed. The idea is to use the AVR-internal comparator to find the sync signals and to determine line 21. When the line is found, the threshold of the comparator is changed to slice the bits. This is sketched in the scope picture below: Here, in cyan, an output of the PTL-ino to indicate line 21 is used to trigger. One nicely sees the two bytes of closed captioning signal in yellow. The AVR analog comparator has the nice feature to use the ADC multiplexer to select one of its inputs dynamically. This feature is employed here to supply the SYNC and the DATA thresholds.

Unfortunately, the composite vide signal is bipolar (syncs being negative voltages), and it had to be shifted. This was done by AC-coupling the input and then clamping its most negative part to a given voltage. The latter is generated by two forward-biased diodes.

Altogether, this makes a circuit based on only very basic components that could be easily found in ample quantities here at PTL.

Schematics

  • Input circuit:

  • Thresholds:

NB: Component values to be confirmed

Component Value Function/Comment
VIDEO 75Ω RCA input terminal for composite video signal
R1 75Ω Input termination of composite video signal. Only to be used if the signal is not connected to sth. else (e.g. a projector)
C1 10nF Value not critical
R2 10kΩ Value not critical
D1, D2, D3 1N4148 Type not critical, defines togeterh with R2 the DC operating point
R3 10kΩ Probably not even needed
R4 5kΩ Used to give The input potentiometers a more useful range
SYNC, DATA 10kΩ Value not critical (but adjust R4 accordingly), used to set the levels of the sync and data slicing

Hardware

The Arduino/PTL-ino pin header spacing is a bit non-standard (to say the least). But, ignoring the header with I/Os 9-13 etc., one can get by a standard protoboard (cf. this post).

Here a few pics:

Software

On GitHub!

Examples

Here, a first try with a 2×16 character display. Note to ourselves, this is how to initialize those found in our drawers (see also this instructables):

#define LCD_I2C_ADDR 0x27
#define LED_PIN  3
#define En_PIN   2
#define Rw_PIN   1
#define Rs_PIN   0
#define D4_PIN   4
#define D5_PIN   5
#define D6_PIN   6
#define D7_PIN   7
#define LED_POL POSITIVE
 
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(LCD_I2C_ADDR,En_PIN,Rw_PIN,Rs_PIN,D4_PIN,D5_PIN,D6_PIN,D7_PIN,LED_PIN,LED_POL);

(It's speeded up a bit, and it's subtitled. How quaint! LOL)

Liens externes

projects/electronics/ptl-ino/ntsc_closed_captioning.txt · Dernière modification: 2016/07/22 22:33 par magnustron