application note 1

  The I2C (Inter Integrated Circuit) interface is used by many semiconductor manufactures to provide a simple two wire control interface for a variety of chip and module applications.   This application note describes an adapter design which accepts serially generated I2C data from an ANC-3052B card to control the video processing.   The adapter's electronics converts standard NTSC composite video into a scan doubled digital video output to directly drive a VGA or RGB type monitor.   This is commonly done to match the 60 Hertz scan rate on a computer type monitor when it is desirable to view NTSC video.   In general, the doubling also makes a better quality video image when the output is to a large screen monitor or television.   Nowadays, most of the large screen televisions have this scan doubling circuitry within them to improve the picture quality.   While the video signal's output from this unit is perfectly good for experimenting and personal use, it would not be suitable for generating broadcast quality video.   Some applications include:

  • PC based video postproduction - in which the computer monitor (or often now, a 2nd computer monitor) is also the preview display for the work in progress.
  • Instructional programs - where a computer is connected to a VCR to play short video segments directly on the computer display as part of the lesson.
  • In motion picture and video production - where synchronizing the 35mm camera shutter, or video camera, with the video source signal is desirable to eliminate the 'flickering video display' from a scene being shot that has a computer monitor as part of the sequence.   This distracting effect is observable in many low budget films and most video productions (and will be more annoying now that you know why it occurs, and that it is relatively easy to fix).
  • Security camera output display - here a computer monitor on a receptionist's desk can be switched to display a remote video camera's output fixed onto a loading dock or doorway for example.

  The analog electronics consists of a now discontinued Sony Semiconductor highbred video control module (sbx1762).   The part may be available on the surplus electronics market and current video processing chips are available from Philips Semiconductor to perform the same video control functions using an I2C interface as the Sony module did.   The real purpose of this application note (besides drawing interest to our single board computer products) is to show how a process that might require many hours of engineering time can be written quickly in BASIC and implemented using off-the-shelf hardware.

  The Sony module accepts NTSC RS170 level composite video and converts it into the 3 discrete digital outputs for representing red, green and blue (RGB) data.   These 3 data streams are then read into a dual port RAM buffer which stores and reads out the color data at twice the NTSC frame rate of 30 frames / second for the non-interlaced signal most VGA type monitors require.   The scan doubled digital output is then fed into a 3 channel digital-to-analog converter, along with the generated horizontal and vertical synchronization data to produce the finished digital video signal.   A simple protocol, based on a I2C signal interface, has been implemented to allow the user to control how the video signal is processed by the Sony module (hue, saturation, etc.).   The Antona ANC-3052B provides the control electronics used to initialize commands and accept user entered modifications.   An EPROM on the ANC-3052B card contains the BASIC program and initial color setup data while a simple 3 button / 4 LED interface to ANC-3052B allows the user to change any of the color processing values by generating the I2C control sequences to the Sony module.

  The operation is self starting after powerup.   The user presses the 'mode' button to advance through the 4 color parameters that can be modified (represented by the 4 LEDs).   When the desired mode has been selected, the user presses the '+' or '-' buttons to increase or decrease the current mode value.   This design is offered as a starting point for the designer to use as a guide for engineering similar equipment and is not supported by Antona Corporation.

I2C Waveform

  In the waveform above you can see how the BASIC program generates the DATA and CLOCK signal to control the I2C functions. The START sequence is signaled by dropping the DATA line and then the CLOCK line.   In the above example the 1st bit is a '1' and 2nd bit is a '0'.   The program steps the DATA byte out to the sbx1762 module's SDA line while the CLOCK line signals that the next bit is ready to the module's SCL input line.   When the 8th data bit is output, a 9th 'ACK' bit which is a '1' is output.   The 'ACK' bit (sent from the module as a '0' when the data byte has been received correctly) is not checked.   Depending upon your specific application, you may want to add this step to the BASIC program.   The STOP state is signaled by dropping the CLOCK line and then the DATA line.   When this step is performed the module executes whatever command or mode was being transmitted.   The important concept here is that the process as described, is the same for any I2C device.

Schematics

  These 2 sheets show the complete hardware to build the NTSC to digital video adapter.   The first schematic shows the user interface electronics and I2C interface connected to the ANC-3052B.   The second schematic shows the Sony sbx1762 module, the control timing electronics, the dual port RAM and the DAC (digital to analog) conversion electronics.   This is the schematic for the prototype so the schematic part designations have no particular significance other than to show what section of a multi-section part was used for a specific function.

  You can click on the thumbnail images below to display a full size schematic of the electronics.   It may then be saved to disk or printed (set your printer for landscape).   If you are using Netscape, just position the mouse over the full size schematic sheet and click the right-hand mouse button.   Now select 'Save Image As...', point to an appropriate sub directory on your hard drive and press the 'save' button on the display.

Thumbnail I2C Schematic Thumbnail Scan Schematic

BASIC Program

  The BASIC program listing is the complete tested and working application software to perform the entire ANC-3052B I2C to Sony sbx1762 control Application.   The program lacks range checking so when a value is exceeded, it 'rolls around' to the value at the opposite end of the range instead of not accepting the value change.   You can copy and use this software as a basis for your own I2C transmit program.

Gate Array Logic (GAL) Equations

  This specific NTSC to digital video application uses 2 gate array devices to perform some of the 'glue' logic necessary in generating the digital video output signal waveforms for synchronization and direction control of the Sony sbx1762 digital output stream.   You can copy and use these GAL equations as a basis for your own project.   Both GALs perform the same basic digital phase-locked loop function.   They generate all the control signals for the scan doubler by using the outputs from the Sony module.   The first GAL ( VID1 ) handles memory management for the 3 channels of 8 bit data into and out of the dual port RAM buffer.   It also generates the 2X vertical synchronizing signal used by the monitor.   There are 2 separate dual port RAMs so that while one is being filled with the video frame data, the 2nd buffer is being read out twice at 60 frames per second.   The 2nd GAL ( VID2 ) generates the 2X horizontal and blanking signal.   These 2 signals, with the vertical sync from the VID1 GAL and the 3 channels of analog color data are all of the control synchronizing signals needed by the monitor to correctly display and position the video information.   Individual video monitors have slightly different sync requirements so VID1 and VID2 also have bit switch inputs that allow the designer to experiment with video positioning.   Take a look at the GAL equations to determine the exact effect each of the switch settings has.


Related Links Back to Homepage

  If you need more information on Antona's products and services, please Contact Us for a quick response.


Updated 07/29/06 23:00

Copyright © 1998-2006 Antona Corporation, L.A., CA., U. S. A.