+41 22 566 01 87
+41 22 566 01 87
|Status du project|
|Date de début||05/2016|
|Status||Work in progress|
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:
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.
NB: Component values to be confirmed
|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|
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 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);