Summary of Closed-Caption Decoder using PIC16C84
This article describes a closed-caption decoder project using the Microchip PIC16F628A microcontroller. The device extracts serial data from video signals using internal comparators for peak detection and data slicing. It does not overlay captions on-screen but outputs decoded text via a serial interface. The design evolved from earlier versions using LM1881 sync separators to the more reliable Intersil EL4581C, utilizing various PIC microcontrollers over time to improve performance and reduce component count.Parts used in Closed-Caption Decoder:
- Microchip PIC16F628A
- Intersil EL4581C sync separator
- National Semiconductor LM1881 (alternative)
- Resistor R1
- Capacitor C7
- Microchip PIC16C84 (historical version)
- Microchip PIC16C61 (historical version)
- External dual comparator (historical version)
- Microchip PIC16C56 (experimental version)
- Microchip PIC16C622 (redesigned version)
- Microchip PIC16F648A (development board)
This closed-caption decoder does NOT overlay captions on video (OSD, on-screen display). If you need a device to overlay captions on video, you're going to have to look elsewhere. Zilog and other vendors make chips that do that, but I don't know of any standalone products.
We originally used a common National Semiconductor LM1881 sync separator, but we had problems with it so we switched to the Intersil (formerly Élantec) EL4581C, which is a pin-compatible improved performance part. It can be purchased from Mouser Electronics. If you want to use an LM1881 you may have to change the values of R1 and C7; see the LM1881 datasheet for details.
The earliest version of this closed-caption decoder was developed in 1994 using a PIC16C84 running at 16 MHz (out of spec!) or PIC16C61 and an external dual comparator. Rich Ottosen did an experimental conversion to the PIC16C56.
Shortly after the PIC16C84 version was completed, Microchip introduced the PIC16C622, which was similar to the PIC16C84 but added two internal comparators and was rated for 20 MHz operation. We redesigned the caption decoder to use the PIC16C622 for reduced part count, and the higher operating frequency allowed us to increase the data sampling rate for higher reliability of decoding.
More recently, Microchip introduced the PIC16F628, which in addition to the comparators offers flash program memory, data EEPROM, more timers, PWM, and a USART. This seemed like an ideal part for the caption decoder, so in late 2003 and early 2004 we redesigned the decoder yet again. The current version is intended to run on a PIC16F628A, though for development a PIC16F648A (with more memory) has been used. With a little bit of careful trimming to the code, it may be possible to use a PIC16F627A. The non-A parts may also be usable, though the configuration fuse settings might need to be changed.
- Bill of Materials
- Purchase List
- Parts catalog information (Digikey and Mouser)
- Schematic (PDF)
- Theory of Operation
Download
The source code for this project is available under the terms of the Free Software Foundation's General Public License, Version 2. If you agree to the terms of the license, you may download a copy in either tar or zip format:
- cc628-0.5.tar.gz ( 36K, Tuesday, 04-Jan-2005 01:33:28 PST)
- cc628-0.5.zip ( 37K, Tuesday, 04-Jan-2005 01:34:42 PST)
The source code package also includes the schematics, bill of materials, and theory of operation doucments.
Kevin Timmerman has made substantial improvements to the firmware, which are not yet present in the version available above. Source code and documentation for his version are available at:
Related Magazine Articles
This project was partially inspired by these magazine articles:
- Closed Captions, V-Chips, and Other VBI Data by Gary D. Robson in the January 2000 issue of Nuts & Volts
- "Build the Text Grabber" by Kelly McArthur in the November 1994 issue of Electronics Now.A much larger and more complicated design using an 8031.
- "Exploring the Vertical Blanking Interval" by Mark Barnes, in issue 45 (April 1994) of Circuit Cellar Ink.A "must-read", this is a very good article regarding capturing digital data from video signals.Mark's design is also 8031 based and uses 24 chips, but provides much more functionality. In addition to closed captioning it also decodes network time stamps, World System Teletext (WST), and North American Basic Teletext Specification (NABTS).An earlier PostScript version of the article with additional information on WST and NABT, and source code including new support for VITC is available by FTP from Circuit Cellar Ink in VBI.ZIP.
- Circuit Cellar also published in their May 1993 issue an article on the Motorola MC68HC05CC1 chip, which is a single chip microcomputer specifically designed for closed-caption decoding.
For more detail: Closed-Caption Decoder using PIC16C84
Quick Solutions to Questions related to Closed-Caption Decoder:
- Does this decoder overlay captions on video?
No, this closed-caption decoder does not overlay captions on video. - What chip replaced the National Semiconductor LM1881 in the final design?
The Intersil EL4581C was switched to because it is an improved performance part with better reliability. - How can I use an LM1881 instead of the EL4581C?
You may have to change the values of R1 and C7 if you want to use an LM1881. - Which microcontroller is used in the current version of the decoder?
The current version is intended to run on a PIC16F628A. - Can I use a PIC16F627A for this project?
With careful trimming to the code, it may be possible to use a PIC16F627A. - What license covers the source code for this project?
The source code is available under the terms of the Free Software Foundation's General Public License, Version 2. - Who made substantial improvements to the firmware mentioned in the text?
Kevin Timmerman has made substantial improvements to the firmware that are not yet present in the main download. - Does the PIC16F628 offer features beyond just comparators?
Yes, the PIC16F628 offers flash program memory, data EEPROM, more timers, PWM, and a USART.
Related projects
DHT11 Low Cost Humidity Sensor using PIC16F628A with Proteus Simulation
IntroductionThis microcontroller project demonstrates how to interface a low-cost DHT11 temperature and humidity sensor with a PIC16F628A using a Proteus simulation environment.The...
Beginner Tutorials · PIC16C84Exploring the World of PIC Microcontrollers: An Architectural Overview
A Peripheral Interface Microcontroller (PIC), developed by General Instruments Microcontrollers in 1993, operates under software control and is programmed to execute various...
LCD & Display Projects · PIC16F628AFrequency Counter by PIC16F628
In this project we are building a basic and low cost frequency counter circuit . It can measure from 16Hz to 100Hz...
Communication & Interfacing · PIC18F4520CAN FD Node based on a PIC18 Microcontroller
The introduction sets the stage for an embedded systems project that involves developing a Embedded C CAN FD project using the MCP2517FD...
Communication & InterfacingLAN9662 Gigabit Switch: Optimized for Industrial Ethernet
Introduction It should come as little surprise therefore that one element of what is now more commonly referred to in some circles...
Communication & InterfacingPIC Microcontroller: Fundamentals & Applications for Students
Introduction Microcontrollers are the key components in the embedded systems market. A variety of embedded systems was formed and developed after the...
