Information in this document is provided in connection with Conexant Systems, Inc. (“Conexant”) products. These materials are provided by
Conexant as a service to its customers and may be used for informational purposes only. Conexant assumes no responsibility for errors or
omissions in these materials. Conexant may make changes to specifications and product descriptions at any time, without notice. Conexant
makes no commitment to update the information and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future
changes to its specifications and product descriptions.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document. Except as provided in
Conexant’s Terms and Conditions of Sale for such products, Conexant assumes no liability whatsoever.
THESE MATERIALS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, RELATING TO SALE
AND/OR USE OF CONEXANT PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR
PURPOSE, CONSEQUENTIAL OR INCIDENTAL DAMAGES, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR
OTHER INTELLECTUAL PROPERTY RIGHT. CONEXANT FURTHER DOES NOT WARRANT THE ACCURACY OR COMPLETENESS OF
THE INFORMATION, TEXT, GRAPHICS OR OTHER ITEMS CONTAINED WITHIN THESE MATERIALS. CONEXANT SHALL NOT BE LIABLE
FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUES
OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS.
Initial Release
Engineering changes
Conexant products are not intended for use in medical, lifesaving or life sustaining applications. Conexant customers using or selling Conexant
products for use in such applications do so at their own risk and agree to fully indemnify Conexant for any damages resulting from such
improper use or sale.
The following are trademarks of Conexant Systems, Inc.: Conexant
publication are for identification purposes only, and may be trademarks of third parties. Third-party brands and names are the property of their
respective owners.
Macrovision
For additional disclaimer information, please consult Conexant’s Legal Information posted at www.conexant.com
reference.
Reader Response: Conexant strives to produce quality documentation and welcomes your feedback. Please send comments and suggestions
to [email protected]. For technical questions, contact your local Conexant sales office or field applications engineer.
Production Data Sheet
ii
is a registered trademark of Macrovision Corporation.
and the Conexant C symbol. Product names or services listed in this
which is incorporated by
Conexant102284B
8/3/05
Page 3
CX25840/1/2/3
Video Decoder and Broadcast Audio Decoder
Conexant Systems’ CX25840, CX25841, CX25842, and CX25843 video decoders
provide fourth-generation video and second-generation broadcast audio decoding
technology in a highly integrated, single-chip analog audio/video capture solution.
The product is ideal for digital video systems that need to digitize analog audio/video
content.
With numerous input ports and configurable output ports for 4:2:2 digital video and
linear PCM audio, the CX25840/1/2/3 can be used to capture video and audio from TV
tuners, DVD players, video cameras, VCRs, game consoles, or any other sources of
composite, Y/C or interlaced component standard-definition video. The level of audio
and video integration offered by the CX25840/1/2/3 removes the need for any
additional broadcast audio decoding and processing chip.
Worldwide decoding for all common video and broadcast audio standards is included
along with processing functions such as high-quality, five-line adaptive comb
filtering, arbitrary horizontal and 5-tap vertical scaling, hue, brightness, saturation,
and contrast controls. The audio path includes two assignable stereo processing units
for control of volume, three-band equalization, balance, and an automatic volume
control function.
The CX25840/1/2/3 has multiple power-down modes to fit your application and power
budget. It is available in a lead-free 80-pin, 12x12 mm TQFP package.
Distinguishing Features
Integrated video and audio decoding
Worldwide video standards—NTSC (M, J,
4.43), PAL (B, D, G, H, I, M, N, Nc),
SECAM (K, L),PAL-60
Worldwide audio standards—BTSC, EIAJ,
A2, NICAM, FM/AM, High-deviation FM
Full 10-Bit ADCs and data path
Flexible video input mux supporting
composite, S-Video, and component
inputs with integrated anti-alias filtering
Five-line adaptive comb filter for NTSC and
PAL
Flexible video output port—27 MHz ITU-R
BT.656; VIP1.1, VIP2, or SPI video with
separate syncs for square pixel rates
Macrovision
Programmable VBI data slicer for data
services such as closed caption, WSS, and
program guides
Power-up configurable two-wire serial
command interface or two-wire VIP1.1 or
VIP2 host port interface
Multiple audio outputs—serial audio
interface or embedded as ancillary data in
the video stream
AC’97 Audio codec interface
Flexible sample rate conversion on all
audio inputs and outputs
Hardware interrupt to eliminate polling
Auto-detection and configuration for audio
and video
Fast locking mode for security camera
applications
Auxiliary clock output—for providing an
oversample audio clock. The PLL can be
locked to the video or used as a general
purpose PLL output
Infrared transmit and receive logic
Internal voltage regulation for single
1. PRGMx pins are labeled with their default reset functions; however, they can be programmed to provide any of the
following internal functions: horizontal active, vertical active, Cb flag, 10-bit video data bits[1:0],
GPIO, or AC'97 link signals.
Conexant Systems’ CX25840, CX25841, CX25842, and CX25843 video decoders
provide fourth-generation video and second-generation broadcast audio decoding
technology in a highly integrated, single-chip analog audio/video capture solution,
which removes the need for any additional broadcast audio decoding and processing
chips.
Worldwide decoding for all common video standards is common among all of the
models, along with processing functions such as high-quality, five-line adaptive comb
filtering, arbitrary horizontal and 5-tap vertical scaling, hue, brightness, saturation,
and contrast controls.
The part number differences provide affordable options for providing regional audio
support. The CX25840 (with no DBX), and CX25841 (with DBX), support both the
North American (BTSC) and Japanese (EIA-J) markets, respectively. The CX25842
supports the European market. And finally, for the customer who wants a single chip
to address all worldwide broadcast standards, there is the CX25843. This device
provides highly integrated, single-chip analog, A/V capture solutions ideal for digital
video systems that support worldwide broadcast analog A/V content. Tabl e 1 -1
provides part number definitions.
Table 1-1.Part Number Definitions
Part Number
CX25840X
CX25841X
CX25842X
CX25843X
102284BConexant1-1
Production Data Sheet
8/3/05
Worldwide Audio
Decoding
All are pin-to-pin compatible with each other, and are available in a lead-free 80-pin,
12x12 mm TQFP package.
A2, NICAM, FM, AM
Audio Decoding
BTSC (with DBX), EIA-J
Audio Decoding
BTSC (without DBX),
EIA-J Audio Decoding
Page 14
Functional OverviewCX25840/1/2/3 Data Sheet
1.1.1Video Features
1.1.1.1Analog Video Inputs
The CX25840/1/2/3 integrates two high-performance 10-bit Analog-to-Digital
Converters (ADCs) and provides a full 10-bit data path through the video decoder to
maintain optimum end-to-end video quality. Eight analog inputs are provided with
flexible analog muxing that can be configured for one or a combination of the
following audio and video inputs:
Eight composite inputs
Four Y/C inputs
Two composite with one Y/C, one YPbPr, and one sound IF
Four composite with four sound IF
One composite with two YPbPr and one sound IF
Time multiplexing the various inputs to the chroma/sound ADC allows for the
simultaneous digitalization of Pb and Pr inputs in component mode, or chroma with
sound-IF for supporting Y/C sources with broadcast audio. All video inputs have
integrated anti-alias filters, eliminating the need for external filter components.
1.1.1.2Integrated Clamping and Automatic Gain Control
DC restoration and Automatic Gain Control (AGC) are provided to compensate for
sources with differing average picture levels. Manual gain control is also supported.
Gain values can be read from and written to the device, allowing for the calibration of
each input and facilitating fast switching from one source to another.
1.1.1.3Flexible Decoder Rates
The video data path includes a sample rate converter to enable multiple pixel rates and
to track any timing fluctuations that may be present within the video source. With the
sample rate converter, the user can program the device to decode video at output pixel
rates of either 13.5 MHz for an ITU-R BT.656 compliant output stream or at
12.27 MHz and 14.75 MHz for NTSC and PAL/SECAM square pixel rates,
respectively. The sample rate converter with internal FIFO monitors the horizontal
timing of the input source to create a fixed number of samples per line. It controls a
PLL to slowly adjust the FIFO level such that short-term jitter in the input source is
filtered out of the digitized video stream. This provides stable video data and output
clocks, even with sources like VCRs that can have inherently unstable timing.
1.1.1.4High Performance Filtering
Luma/chroma separation of composite video sources is accomplished through a 5-line
adaptive chroma comb filter for NTSC and PAL standards. The adaptive comb filter
looks across five lines of incoming video and determines which of the five lines are
appropriately correlated enough to average together. Depending on the amount of
correlation among the lines, two or three lines are averaged together to form the
resulting combed filtered line. In the case where no correlation exists between lines,
the decoder automatically falls back to chroma band-pass and luma notch filtering.
The output of the chroma comb filter is also remodulated and fed back into the luma
channel. The result is a high quality image with reduced cross-chrominance and crossluminance artifacts—such as dot crawl, hanging dots, rainbow effects—that restore
full bandwidth to luminance data from composite sources. Additionally, we have a
1-2Conexant102284B
Production Data Sheet
8/3/05
Page 15
CX25840/1/2/3 Data SheetFunctional Overview
SECAM “Bell” filter to improve SECAM luminance and chroma separation. This is
because SECAM uses an FM modulated signal carrier that is always present,
regardless of whether or not there is color information being broadcast. This results in
a visible artifact in the luminance at the carrier frequency. To eliminate this effect, an
“Inverse Bell” filter is applied at the encoder to attenuate color frequencies near the
Dr and Db carriers. Thus, if little or no color information is present in the signal, the
carriers will be reduced in amplitude.
1.1.1.5Video Processing Functions
Back-end video processing functions include contrast, brightness, hue, saturation, and
scaling. In addition, the luma data path provides white crush compensation for sources
that exceed sync tip to white level ratios. The decoder also provides four sets of
selectable peaking filters for sharpening the image. The luma data output range is
selectable so that luma codes can be limited to the nominal ITU-R BT.656 code range,
or can support values below black level, or can use the entire 10-bit range of values
where 0 is black level, and 1023 is nominal white. Additional chroma functions
include AGC to compensate for attenuated color subcarriers, a color killer for true
black and white sources, and coring for limiting low-level chroma noise.
1.1.1.6High Quality Scaling
Arbitrary horizontal and vertical scaling is available, from full resolution down to an
8:1 ratio (icon size). Scaling can be accomplished in both VIP and BT.601 square
pixel formats. To maintain a high quality scaled image, multi-tap polyphase
interpolation is used. The horizontal luma scaler uses 6-tap, 63-phase FIR
interpolation between horizontal source samples, while the horizontal chroma scaler
uses 4-tap, 63-phase interpolation. Line store memory is integrated into the decoder
so that the vertical scaler—depending on the horizontal scaling ratio—can use from
2-tap to 5-tap, seven-phase interpolation between lines.
1.1.1.7Configurable Pixel Output Interface
The pixel output format is user-configurable and can conform to 4:2:2 ITU-R BT.656
with embedded timing codes, VIP1.1 or VIP2 with embedded timing codes, or SPIcoded video samples with separate sync signals. The pixel output interface can also be
set up for 8-bit or 10-bit sample widths, where 8-bit data is derived from the rounded
10-bit value. In addition to providing decoded video data during the active region, raw
sample data can be obtained during the horizontal region of the vertical blanking
interval. The raw data is from the luma/composite ADC after it has been sample-rate
converted and 2x upsampled. This data can be used for capturing high-bit rate VBI
services like Teletext for later use by software decoders. The pixel output port also
makes use of ancillary data streams by inserting sliced VBI data during the horizontal
blanking interval.
102284BConexant1-3
Production Data Sheet
8/3/05
Page 16
Functional OverviewCX25840/1/2/3 Data Sheet
1.1.1.8Vertical Blanking Interval Data Slicing and Decoding
An integrated VBI data slicer supports a variety of data standards: WST, Closed
Caption, WSS, VITC, as well as programming guide information like Gemstar 1x,
Gemstar 2x, and VPS. Decoded data for closed caption, WSS, and Gemstar services is
available through either a register read or can be inserted as ancillary data within the
ITU-R BT.656 data stream. For high-bit rate services such as WST, NABTS, VPS,
and VITC, data is provided on the pixel output port and can be inserted as ancillary
data as well. There is independent control of what data service is to be sliced/decoded
for every line of each field in the vertical interval. Programmability is also provided
such that custom data slicing can be accomplished for data services that do not
comply with one of the standards already supported.
1.1.2Audio Features
1.1.2.1Stereo Broadcast Audio Decoding
The CX25843, CX25842, CX25841, and CX25840 integrate a stereo broadcast audio
decoder capable of demodulating all of the most common worldwide audio standards:
BTSC, EIAJ, A2, NICAM, FM (standard and high-deviation modes), and AM. The
sound IF output from the tuner interfaces directly with the CX25840/1/2/3,
eliminating the need for external sound demodulation chips. Dual language,
subchannel, and Secondary Audio Formats (SAP) are also supported for broadcasts
that transmit multilingual capability. Simultaneous dual language can be supported
with different languages on each channel of the stereo left/right pair. The audio
decoder has automatic standard detection and configuration through an on-board
microprocessor so that no user intervention is necessary to set up the decoder for the
various standards. This is especially useful in geographic regions where different
audio standards may be received on a channel-by-channel basis.
1.1.2.2Audio Interfaces
Demodulated broadcast audio is available through two interfaces, serial audio output
or embedded in the ITU-R BT.656/VIP pixel port as ancillary data. The serial audio
output port can supply audio samples from the broadcast decoder or from the serial
audio input port. An internal sample rate converter allows for selection of 32 kHz,
44.1 kHz, 48 kHz, or 96 kHz sample rate for easy system integration. This sample rate
conversion is available for both the serial audio (input and output) and BT.656/VIP
interfaces, independent of one another. In the BT.656/VIP mode, audio samples are
embedded into the video stream and are tagged as ancillary data during the horizontal
blanking interval. This allows for the capture of audio samples on systems that do not
provide serial audio interfaces. The CX25840/1/2/3 also provides a serial audio input
and an AC’97 link interface for extensible baseband audio capture and playback.
Adding an AC’97 audio codec provides support for multiple audio inputs and outputs
for systems that require a broad range of audio interfaces. The serial audio interfaces
support programmable master/slave modes and 16- to 32-bit sample widths.
1-4Conexant102284B
Production Data Sheet
8/3/05
Page 17
CX25840/1/2/3 Data SheetFunctional Overview
1.1.2.3Audio Processing
In addition to the demodulation of broadcast audio in the CX25840/1/2/3, premium
functions such as three-band equalization, volume, balance, mute, and automatic
volume control are independently available on both the broadcast audio and serial
audio data streams. The audio samples can also be locked to the incoming video
stream to ensure that the audio samples are rate-matched to the video, eliminating the
need for MPEG encoders to drop or repeat frames in order to keep the video and audio
in sync. The entire audio data path is a minimum of 16 bits wide to maintain CD
quality performance levels throughout the audio signal chain.
1.1.3Communication and General Features
Communication with the device is configurable through a pin strap option at power-up
reset. Two methods of communication are available: either a 400 kHz two-wire serial
command interface or a 2-bit VIP host port interface. A hardware interrupt pin is
available along with a maskable interrupt status register so that the device can notify
the system when internal events occur without the need to implement polling
schemes.
Other convenience features consist of the following:
Programmable infrared transmitter/receiver logic, able to modulate or demodulate
low data rate consumer remote control protocols
General purpose I/O pins
Power-down pin or register-controlled power-down levels
Single 3.3 V power supply configuration available with an external pass transistor
PLL output for either supplying a video locked 256x/384x oversample audio clock
or a general purpose user programmable clock for minimizing PCB component
count
Small package size: a 80-pin, 12x12 mm TQFP
All parts are only available in a lead-free package, beginning with -23. Starting
with -24, this is indicated with a “Z” following the dash number, i.e., “-24Z.”
102284BConexant1-5
Production Data Sheet
8/3/05
Page 18
Functional OverviewCX25840/1/2/3 Data Sheet
1-6Conexant102284B
Production Data Sheet
8/3/05
Page 19
2
Pin Descriptions
2.1Pin Descriptions
See Table 2 -1 for pin descriptions.
Table 2-1. Pin Descriptions (1 of 4)
Pin NamePinDirTypeDescription: {20} ADC Analog
CVBS{1:3}/Y{1:3}58, 60, 61IAsComposite or Luma signal input to ADC1. The signal passes through on-chip
analog multiplexers before passing through a gain stage, an anti-alias filter stage,
and into ADC1. Unused inputs should be left floating.
S2D_NEG{1:2}59, 68IArNegative input of single-to-differential converter. Tie to analog ground through AC
63, 65, 67IAsChroma, Sound IF, or Pb signal input to ADC2 or Luma, Composite signal input to
ADC1. This signal passes through on-chip analog multiplexers before passing
through a gain stage, an anti-alias filter stage, and into either ADC1 or ADC2. In
color component (Pb, Pr) input mode, the Pb component should be connected to
one of these pins, and the Pr component should be connected to the Pr{1:2} pins.
Unused inputs should be left floating.
69, 71IAsChroma, Sound IF or Pr signal input to ADC2 or Luma, Composite signal input to
ADC1. This signal passes through on-chip analog multiplexers before passing
through a gain stage, an anti-alias filter stage, and into either ADC1 or ADC2. In
color component (Pb, Pr) input mode, the Pr component should be connected to
this pin, and the Pb should be connected to a Pb{1:2} pin. Unused inputs should be
left floating.
nominal.
coupling capacitor for common mode noise rejection. The capacitor should match
the value used on the analog inputs.
102284BConexant2-1
Production Data Sheet
8/3/05
Page 20
Pin DescriptionsCX25840/1/2/3 Data Sheet
Table 2-1. Pin Descriptions (2 of 4)
Pin NamePinDirTypeDescription: {10} Crystal and PLLs
XTI74IAs28.63636 MHz crystal oscillator input, or single-ended clock oscillator input. Used
for PLL clock reference and ADC sample clock.
XTO75I/OAsCrystal buffer return, or DC reference input for single-ended clock oscillator mode.
VAA_XTAL76IApCrystal oscillator power. VAA_XTAL = 3.3 V nominal. Couple to VAA.
VSS_XTAL73IApCrystal oscillator ground. Couple to VSS_A.
VPP{0:1} 48, 49OApInternal PLL power decoupling node. Decouple through 0.1uF capacitor to ground.
VSS_PLL50IApShared PLL ground. Couple to VSS_A.
VDDO_PLL47IDpOutput pad ring power for PLL_CLK/PRGM7 pad. Isolated from the rest of the pad
ring for noise immunity. VDDO_PLL = 3.3 V nominal. VDDO_PLL should be
connected to analog supply if PLL_AUX_CLK pin is providing a sample clock for an
external ADC or DAC. If PLL_CLK/PRGM7 pin is used as a digital output, then
VDDO_PLL should be connected to a digital supply. Refer to footnote (1) of
Section 4.5 for more information.
VSSO_PLL45IDpOutput pad ring ground for PLL_CLK/PRGM7 pad. Isolated from the rest of the pad
ring for noise immunity. Couple to VSS_A. VSSO_PLL should be connected to
analog ground if PLL_AUX_CLK is providing a sample clock for an external ADC or
DAC. If PLL_CLK/PRGM7 is used as a digital output, then VSSO_PLL should be
connected to digital ground.
PLL_CLK/PRGM746ODGeneral purpose output clock from a second PLL or can also be used for 256x (or
384x) oversampled clock for external Sigma-Delta Audio ADCs and DACs. This PLL
can optionally be locked to the video pixel rate for video-locked audio clock.
Pin NamePinDirTypeDescription: {12} Digital Power Supply
REG_IN51IAsRegulator In. An internal regulator monitors this voltage level from the emitter/drain
of an external voltage drop transistor.
REG_OUT52OAsRegulator Out. An internal 1.2 V regulator drives this signal out to control the base/
gate of an external voltage drop power transistor. When using an externally
provided 1.2 V for VDD tie REG_OUT to REG_IN.
VDD {1:6}6, 14,
20, 31,
38, 80
VSS {1:6}5, 13,
19, 30,
37, 79
VDDO{1:3}11, 28, 77IDpI/O pad ring power, VDDO = 3.3 V, nominal.
VSSO{1:3}12, 29, 78IDpI/O pad ring ground.
IDpDigital core power. VDD = 1.2 V, nominal. Connect to regulator-generated voltage
REG_IN pin or external power supply.
IDpDigital core ground.
2-2Conexant102284B
Production Data Sheet
8/3/05
Page 21
CX25840/1/2/3 Data SheetPin Descriptions
Table 2-1. Pin Descriptions (3 of 4)
Pin NamePinDirTypeDescription: {4} Control interface: Serial or VIP Host Port
SER_CLK/HAD[0]16I/OOdSerial communications clock or VIP host address/data bit 0. Used for accessing
internal registers.
SER_DATA/HAD[1]15I/OOdSerial communications data or VIP host address/data bit 1. Used for accessing
internal registers.
CHIP_SEL/VIPCLK/
VIPCLK
VRESET/HCTL/
PRGM3
Pin NamePinDirTypeDescription: {12} Video Output Signals
PIXCLK36ODPixel clock. Operates at 27.0 MHz and for square pixel formats, 29.5 MHz (625-line)
VID_DATA[7:0]24 25,
HRESET/PRGM221I/ODHorizontal reset timing indication is the default pin function. Alternatively, the pin can
FIELD/PRGM122I/ODField indication is the default pin function. Alternatively, the pin can be programmed
DVALID/PRGM023I/ODData valid indication is the default pin function. Alternatively, the pin can be
17IDSerial communications mode chip select. Selects 7-bit serial chip address:
0: 1000100 (0x88 write, 0x89 read)
1: 1000101 (0x8A write, 0x8B read)
VIP host port clock in VIP host mode.
Can also be configured for GPIO and video timing control if interrupt not needed. In
VIP Host port mode, this also acts as the VIRQ_N signal. Also acts as a pin strap
option during reset. If the IRQ_N pin is low during the deassertion of RESET_N the
device will respond to the alternate two-wire serial communications address:
0x8C/0x8D when CHIP_SEL/VIPCLK/VIPCLK pin is low
0x8E/0x8F when CHIP_SEL/VIPCLK/VIPCLK pin is high
If the pin is high during the deassertion of RESET_N the device will respond to the
default two-wire serial communications addresses:
0x88/x89 when CHIP_SEL/VIPCLK/VIPCLK pin is low
0x8A/0x8B when CHIP_SEL/VIPCLK/VIPCLK pin is high
18I/OD, RIn VIP host port mode acts as control pin that is used to begin, end, or throttle data
transfers. VIP host port available only on CX25837. When the device is in serial
communications mode the pin acts as VRESET or can be configured for alternate
pin functions.
and 24.545 MHz (525-line).
ODEight most significant bits of rounded video data. Data is output in a YCrCb 4:2:2
26, 27,
32, 33,
34, 35
format. For 10-bit mode, the fractional, least significant two bits can be programmed
to be output on any of the PRGMx pins
be programmed to function as a different video timing control; least significant video
data bits or GPIO. See Ta ble 2 -2 and Figures 2-1 and 2-2 for the available
programmable alternative functions.
to function as a different video timing control; least significant video data bits or
GPIO. See Table 2 -2 and Figures 2-1 and 2-2 for the available programmable
alternative functions.
programmed to function as a different video timing control; least significant video
data bits or GPIO. See Ta ble 2 -2 and Figures 2-1 and 2-2 for the available
programmable alternative functions.
Pin NamePin DirTypeDescription: {2} Infrared
IR_TX/PRGM68OD, RInfrared remote control transmit output. Can also be configured for GPIO and video
timing control if infrared control is not needed. Also acts as a pin strap option during
reset. If the pin is low during the deassertion of RESET_N the device will boot-up in
VIP host port communications mode. If the pin is high during the deassertion of
RESET_N the device will boot-up in two-wire serial communications mode.
IR_RX/PRGM59IDInfrared remote control receive input. Can also be configured for GPIO and video
timing control if infrared control is not needed.
102284BConexant2-3
Production Data Sheet
8/3/05
Page 22
Pin DescriptionsCX25840/1/2/3 Data Sheet
Table 2-1. Pin Descriptions (4 of 4)
Pin NamePinDirTypeDescription: {4} Chip Control
IRQ_N/PRGM410OD, RInterrupt output, active low. Can also be configured for GPIO and video timing
control if interrupt not needed. In VIP Host port mode, this also acts as the VIRQ_N
signal. Also acts as a pin strap option during reset. If the pin is low during the
deassertion of RESET_N the device will respond to the alternate two-wire serial
communications address:
0x8C/0x8D when CHIP_SEL/VIPCLK/VIPCLK pin is low
0x8E/0x8F when CHIP_SEL/VIPCLK/VIPCLK pin is high
If the pin is high during the deassertion of RESET_N the device will respond to the
default two-wire serial communications addresses:
0x88/x89 when CHIP_SEL/VIPCLK pin is low
0x8A/0x8B when CHIP_SEL/VIPCLK pin is high
RESET_N2IDGlobal chip reset, active low.
SLEEP3IDA logic high state on this pin puts the chip in power-down mode.
TEST1IDPuts chip in test mode. Pin is tied low for normal operation.
Pin NamePin DirTypeDescription: {6} Serial Digital Audio
SA_BCLK_IN43I/ODSerial audio bit clock for input data.
SA_WCLK_IN42I/ODSerial audio word/framing clock for delineating input sample boundaries.
SA_SDIN44IDSerial audio data input.
SA_BCLK_OUT41I/ODSerial audio bit clock for output data.
SA_WCLK_OUT40I/ODSerial audio word/framing clock for delineating output sample boundaries.
Active resistive pullup
Open-drain pads with glitch filters
Analog signal
Analog power or ground
Digital power or ground
Analog reference, for connection to external component
Digital Signal
= 4 mA unless otherwise noted.
OL
2-4Conexant102284B
Production Data Sheet
8/3/05
Page 23
CX25840/1/2/3 Data SheetPin Descriptions
The following set of common pins are multifunctional and can have signals routed in
and out. Tabl e 2-2 lists these common pins. Figure 2-1 shows the registers to which
any signal can be routed. In addition, the SA_SDIN and SA_SDOUT pins can be
routed to the registers in Figure 2-1.
Figure 2-1 shows the signals that can be routed to any pin in the common list. The
CHIP_SEL/VIPCLK/VIPCLK pin can also be routed to the signals in Figure 2-2.
Refer to Section 3.14, I/O Pin Configuration, for details.
The CX25840/1/2/3 integrate all Analog Front-end (AFE) functions required for
filtering, gaining, clamping, and digitizing an analog video signal. The AFE is
comprised of the following blocks:
Three analog muxes
Clamping and impedance boosting circuitry
Three single-ended to differential converters
Three Variable Gain Amplifiers (VGA)
Three anti-alias filters
A bandgap reference
Two Analog-To-Digital Converters (ADC)
A crystal oscillator amplifier
Two Phase Locked Loops (PLL)
A block diagram of the signal flow through the analog subsystem is shown in
Figure 3-1.
Figure 3-1. AFE Overview
IN1
IN2
IN3
IN4
IN5
IN6
IN7
IN8
102284BConexant3-1
Production Data Sheet
8/3/05
CH1
-12dB ... +6dB 0dB ... +6dB
CH2
-12dB ... +6dB 0dB ... +6dB
CH3
-12dB ... +6dB 0dB ... +6dB
Filter
Tuning
Filter
Tuning
Filter
Tuning
11
ADC1
11
ADC2
102267_001
Page 28
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
The AFE receives eight video inputs that are multiplexed to produce inputs for the
three analog channels: CH1, CH2, or CH3. Each analog channel has a variable gain
amplifier and anti-alias filter that can be independently configured. The CH1 signal is
routed through ADC1, while CH2 and CH3 can be statically shared or timemultiplexed on Miscellaneous Chip Control.
After the input mux, the video signal is clamped to the midpoint of the single-todifferential amplifier for DC restoration. Next, the signal is converted from singleended to differential, and then amplified or attenuated through the two gain stages.
The gain settings for the VGA come from the video decoder feedback loop, although
this can be disabled and a manual gain value set instead.
The output of the VGA is then low-pass filtered prior to the ADC to prevent highfrequency noise near the sampling frequency from being aliased back onto the signal
by the sampling process. The bandwidth of the anti-alias filter is programmable for
either 8 MHz, half this bandwidth, or completely bypassed.
ADC1 then samples the DC-restored and gained differential video waveform using
the external crystal frequency. Miscellaneous Chip Control also samples its
differential inputs at the crystal frequency, but the video input can be enabled to time
multiplex between the CH{2} and CH{3} inputs. An internal mux switches between
the two channels fast enough to support the sampling of the Pb and Pr chroma signals
of an interlaced component video input through one ADC.
The clock for the video decoder’s digital domain comes from a fractional PLL that
converts the crystal frequency to a clock that is a multiple of the video pixel rate. For
example, in ITU-R BT.656 mode, the internal clock runs at 8 times the 13.5 MHz
pixel rate, 108 MHz. The digital logic adjusts the frequency in small increments to
track the field rate of the decoded video signal, producing a video-locked clock.
Additionally, a second PLL output, AUX_CLK, is provided and can be used as a
video-locked oversample audio clock reference for any external audio components.
This clock would usually be programmed to be either 384 or 256 times the audio
sample rate, but may be any desired multiple of the audio sample rate. The PLL can
also be used as a general clock source, unlocked to the video input and programmable
to any arbitrary frequency.
A bandgap design is used as an internal voltage reference generator. Its output is
connected to a pin for external filtering. Another circuit converts this bandgap
reference voltage to a precision current reference. This circuit relies upon an external
high-precision resistor connected to the IREF pin to generate this current.
3-2Conexant102284B
Production Data Sheet
8/3/05
Page 29
CX25840/1/2/3 Data SheetDetailed Functional Description
3.2Video Mux Inputs
3.2.1General Muxing Scheme
The analog front-end of the decoder supports up to eight composite video inputs (In1–
In8), four S-Video inputs, or two component inputs. Analog muxes connect the inputs
to CH{1}, CH{2}, or CH{3} so that any one of eight inputs can be connected to
CH{1}, any one of inputs In4, In5, or In6 can be connected to CH{1} or CH{2}, and
any one of inputs In7 or In8 can be connected to CH{1} or CH{3}. The muxes are
controlled through the Video Input Control register (0x103) with bits CH{1}_SRC,
CH{2}_SRC, and CH{3}_SRC, as shown in Tables 3 -1 through 3-3.
Table 3-1. Muxing Scheme for CH{1}
Video Input Control (0x103)
CH{1}_SRC Bits [2:0]
000In1
001In2
010In3
011In4
100In5
101In6
110In7
111In8
Table 3-2. Muxing Scheme for CH{2}
Video Input Control (0x103)
CH{2}_SRC Bits [5:4]
00In4
01In5
10In6
Input Connected to CH{1}
Input Connected to CH{2}
11None
Table 3-3. Muxing Scheme for CH{3}
Video Input Control (0x103)
CH{3}_SRC Bits [7:6]
00In7
01In8
10None
11None
102284BConexant3-3
Production Data Sheet
8/3/05
Input Connected to CH{3}
Page 30
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Although it is possible to connect inputs In4–In8 to two channels simultaneously, this
is not recommended.
When an internal input is not connected to any channel, it is connected to a voltage
approximately one half of the supply voltage through a high resistance. The maximum
allowed input signal amplitude is 2.0 Vp-p.
3.2.2Configuring for Composite Inputs
In this usage scenario, up to eight composite inputs can be connected to the decoder.
As shown in Figure 3-1, it is possible to connect all eight composite inputs to CH{1}
so that only one ADC is being used. Since Miscellaneous Chip Control is not being
used, it can be turned off to conserve power. It is important to note that although
inputs IN1 through IN8 can be connected, only one input can be active at any one
time.
To configure the decoder to accept one of eight possible composite video inputs using
just one ADC, the Video Input Control (0x103) register must be programmed as
described in Tab le 3-4.
Table 3-4. Example Composite Mux Configuration
Active InputControl BitsBit Value
CVBS {1}
CVBS {2}001
CVBS {3}010
CVBS {4}011
CVBS {5}100
CVBS {6}101
CVBS {7}110
CVBS {8}111
CH{1}_SRC
CH{3}_SRC10 OR 11
CH{2}_SRC11
000
3-4Conexant102284B
Production Data Sheet
8/3/05
Page 31
CX25840/1/2/3 Data SheetDetailed Functional Description
3.2.3Configuring for S-Video
It is possible to configure the input mux to accept an S-Video input source. In this
case, two channels of the AFE must be used. The luma portion of the S-Video input
must be routed to CH{1} and the chroma signal routed to CH{2} or CH{3}. There are
enough inputs and analog channels to support multiple S-Video inputs. For example,
up to four S-Video inputs can be connected at the same time by using inputs In1 to In4
as luma inputs and In5 to In8 as chroma inputs, as shown in Table 3-5.
Table 3-5. Example S-Video Mux Configuration
Active InputControl BitsBit Value
Y1CH{1}_SRC000
C1CH{2}_SRC01
Y2CH{1}_SRC001
C2CH{2}_SRC10
Y3CH{1}_SRC010
C3CH{3}_SRC00
Y4CH{1}_SRC011
C4CH{3}_SRC01
To configure the rest of the AFE for S-Video mode, see Section 3.4.1.
3.2.4Configuring for Component Video
In this scenario, the input mux is used to route component video, YPbPr signals to
each of the analog channels. To support component video, all three channels of the
AFE are used. CH{1} handles the luma (Y) signal, and CH{2} and CH{3} handle the
Pb and Pr color-difference signals. The chroma inputs are time-multiplexed to carry
out dual sampling using Miscellaneous Chip Control. A total of two component inputs
can be supported, although only one can be active at any time. For example, In1 and
In2 are Y inputs, In4 and In5 are Pr inputs, and In7 and In8 are Pb inputs. The Video
Input Control (0x103) register must be programmed as shown in Table 3 -6 .
Table 3-6. Example Component Video Mux Configuration
Active InputControl BitsBit Value
Y1CH{1}_SRC000
Pr1CH{2}_SRC00
Pb1CH{3}_SRC00
Y2CH{1}_SRC001
Pr2CH{2}_SRC01
Pb2CH{3}_SRC01
To configure the rest of the AFE for component video mode, see Section 3.4.1.
102284BConexant3-5
Production Data Sheet
8/3/05
Page 32
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.2.5Configuring for S-Video and Sound IF Audio
In this scenario, the input mux is used to route S-Video and the Sound IF audio
source. In this case, all three channels of the AFE are used. As shown in Ta bl e 3 -7 , the
luma portion of the S-Video input must be routed to CH{1}, the chroma portion of the
S-Video input must be routed to CH{3}, and the Sound IF audio of the tuner input
must be routed to CH{2}.
Table 3-7. Example S-Video and 2nd IF Mux Configuration
Active InputControl BitsBit Value
Y1CH{1}_SRC000
C1CH{3}_SRC00
2nd IF 1CH{2}_SRC00
Y2CH{1}_SRC001
C1CH{3}_SRC01
2nd IF 2CH{2}_SRC01
Table 3 -8 summarizes the state of the AFE control bits for S-Video and Sound IF
operation. Figure 3-2 shows the S-Video and Sound IF Audio Interface.
Table 3-8. AFE Configuration for S-Video and Sound IF Input
Control BitsValue
INPUT_MODE10
CLAMP_SEL_CH{1}0
CLAMP_SEL_CH{2}1
CLAMP_SEL_CH{3}0
DUAL_MODE_ADC21
HALF_BW_CH{2}/3CH{2} = 0 (Chroma input on analog CH3)
CH{3} = 0 (Sound IF input on analog CH2)
DROOP_COMP_CH{2}/3CH{2} = 0 (Chroma input on analog CH3)
CH{3} = 0 (Sound IF input on analog CH2)
CLAMP_EN_CH{2}/3CH{2} = 0 (Chroma input on analog CH3)
CH{3} = 0 (Sound IF input on analog CH2)
AUD_IN_SEL1
VGA_SEL_CH{2}/3CH{2} = 0 (Chroma input on analog CH3)
CH{3} = 0 (Sound IF input on analog CH2)
3-6Conexant102284B
Production Data Sheet
8/3/05
Page 33
CX25840/1/2/3 Data SheetDetailed Functional Description
Figure 3-2. S-Video and Sound IF Audio Interface
1 µF
Luma
75 Ω
1 µF
Chroma
75 Ω
120 pF
Sound IF
Analog Channel 1
Analog Channel 2
Analog Channel 3
ADC 1
ADC 2
102284_062
102284BConexant3-7
Production Data Sheet
8/3/05
Page 34
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.3Analog Channel
The features described in this section are automatically configured by default, but
they can be manually configured as described below.
3.3.1Input Impedance
Each of the video inputs should be AC-coupled to the source. The minimum size of
the coupling capacitor depends on the input resistance of the first circuit block of the
signal channel. This resistance is nominally 15 kΩ
capacitor values, an active impedance boosting circuit can be activated by setting
signal DROOP_COMP_CHx to logical 1 in the AFE Control 3 register (0x106). This
increases the resistance value to the 70 kΩ–200 kΩ range. It is not recommended that
impedance boosting be used without analog clamping, because the boosting circuit
may add an offset to the signal, and this offset voltage can be as high as 200 mV. The
offset can be eliminated with clamping. For most video applications, the
DROOP_COMP_CHx bit should be enabled to use the recommended 1 µF ACcoupling value. Impedance boosting should not be used in sound IF inputs.
. To allow smaller coupling
3.3.2Clamping
Since the video inputs are AC coupled, the sync and back-porch levels of the signal at
the channel input varies with the overall average picture level. This requires extravoltage head room, which reduces the maximum achievable signal-to-noise ratio, both
in the ADC and the analog signal processing blocks before it. Therefore, the analog
subsystem provides a clamping feature to force the sync voltage to a predefined level.
The clamping circuit is by default enabled, but can be disabled by setting the
CLAMP_EN_CHx bit in the AFE Control 2 and 3 (0x105 and 0x106) registers to 0.
When the clamp is enabled, it pulls the input voltage toward the desired level. A clamp
strobe from the digital logic is activated during the sync pulse and remains clamped
for a minimum of 1 µs per line. Since the channel gain is variable, the clamping level
seen at the ADC output depends on the gain settings. To provide a suitable clamping
level across different gain settings, the clamping level can be set with signal
CLAMP_LEVEL_CHx[2:0] according to Ta ble 3 -9 .
Table 3-9. Clamping Levels
CLAMP_LEVEL_CHx
000 –1.05 V –160 (out of ADC range)
001 –0.80 V0
010 –0.606 V124
Clamp Voltage (relative to
mid-level)
Clamp Code (when gain is
set to 0 dB)
011 –0.460 V218
100 –0.348 V289
101 –0.264 V343
110 –0.2 V384
1110 V512
3-8Conexant102284B
Production Data Sheet
8/3/05
Page 35
CX25840/1/2/3 Data SheetDetailed Functional Description
3.3.3Negative Reference Input
The signal inputs are single-ended, but to reduce the effect of board-level noise, the
negative input terminal of the first gain stage can be taken out of the chip and
grounded on the PCB. This external board connection must be AC coupled.
3.3.4Variable Gain Amplifiers
The variable gain is realized in two stages. The first stage has a gain range from
–12 dB to +6 dB in 6 dB steps, and the second stage covers the 6-dB range between
the first stage steps by providing 16 linear steps. In addition, the digital control can
enable an extra 12 dB of gain by setting the signal EN_12DB_CHx to 1 in the AFE
Control (0x104) register. Normally, the video decoder automatically chooses the
correct gain value, depending on the amplitude of the input signal. However, if manual
control over the gain is desired, the value can be programmed through the
VGA_GAIN bits in the VGA Gain Control (0x488) register. It is also necessary to
disable the automatic function of the VGA by setting the VGA_AUTO_EN bit in the
Digital Front-End (DFE) Control (0x48B) register to 0. The possible gain settings are
shown in Tab le 3 -1 0.
Table 3-10. Gain Settings (1 of 3)
Gain[5:4]Gain[3:0]Gain
000.25
010.265625
020.28125
030.296875
040.3125
050.328125
060.34375
070.359375
080.375
090.390625
0100.40625
0110.421875
0120.4375
0130.453125
0140.46875
0150.484375
100.5
110.53125
102284BConexant3-9
Production Data Sheet
8/3/05
Page 36
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Table 3-10. Gain Settings (2 of 3)
Gain[5:4]Gain[3:0]Gain
120.5625
130.59375
140.625
150.65625
160.6875
170.71875
180.75
190.78125
1100.8125
1110.84375
1120.875
1130.90625
1140.9375
1150.96875
201
211.0625
221.125
231.1875
241.25
251.3125
261.375
271.4375
281.5
291.5625
2101.625
2111.6875
2121.75
2131.8125
2141.875
2151.9375
302
312.125
3-10Conexant102284B
Production Data Sheet
8/3/05
Page 37
CX25840/1/2/3 Data SheetDetailed Functional Description
Table 3-10. Gain Settings (3 of 3)
Gain[5:4]Gain[3:0]Gain
322.25
332.375
342.5
352.625
362.75
372.875
383
393.125
3103.25
3113.375
3123.5
Anti-alias Filtering
3.3.5Anti-Alias Filtering
Anti-aliasing filtering is integrated within the analog input channels of the device.
The anti-alias filter is designed to reject frequencies within 6 MHz of the sampling
frequency to prevent these frequencies from producing aliases in the pass band. The
cutoff frequency is set to 8 MHz to provide the flattest possible response for PAL, and
the stop band is defined as 22.0 MHz and above where the signal is attenuated at least
25 dB. Although not shown, the time-domain impulse response avoids ringing so that
sharp luma transitions do not create ringing in the filter output. Furthermore, the
delay through this filter differs by no more than 6 ns across the range from 3.0 MHz to
5.0 MHz.
The filter is automatically tuned to the correct –3 dB frequency by using the ADC
clock as a reference. Nominally, this is about 1/3 times the ADC clock frequency. To
allow sampling at half-rate, the filter bandwidth can be halved by setting
HALF_BW_CHx to 1 in the AFE Control 1 register (0x104). Alternatively, the filter
can be completely bypassed by setting BYPASS_CHx to 1 in the AFE Control 3
(0x106) register.
3133.625
3143.75
3153.875
102284BConexant3-11
Production Data Sheet
8/3/05
Page 38
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Table 3 -1 1 provides a summary of the anti-alias filter characteristics. Figure 3-3
illustrates a transfer function of the realized filter.
Figure 3-3. A Transfer Function of the Realized Filter
5
0
–5
–10
–15
Gain
–20
–25
–30
–35
0.1 dB
–40
3-12Conexant102284B
Production DataSheet
10
6
7
10
Frequency
10
8
102284_003
8/3/05
Page 39
CX25840/1/2/3 Data SheetDetailed Functional Description
3.3.6Channel Performance
The RMS noise voltage in the ADC input depends on the f ilter bandwidth, gain
setting, and temperature. The worst-case noise voltages (not including the ADC noise)
for different bandwidth settings are shown in Table 3 -1 2.
The total harmonic distortion in the ADC input is always smaller than –65 dBFS.
3.3.7Analog to Digital Converter
Specifications for the ADC are listed in Ta ble 3 -1 3.
Table 3-13. ADC Specifications
ParameterSymbolMinimumTyp
Sample FrequencyFs27.029.5MHz
Differential Input Voltage
Range
Input BandwidthFb12MHz
Output Word WidthR11bits
Integral LinearityINL+
Differential LinearityDNL+
SINAD55dB
Input CapacitanceCiTBDpF
The second ADC (Miscellaneous Chip Control) can be configured to sample either
CH{2} or CH{3} at nominal clock rate, or it can be put in dual mode, in which
samples are alternated between CH{2} and CH{3}. Channel selection is controlled by
signal CH_SEL_ADC2: 0=CH{2}, 1=CH{3}, and dual mode is enabled by setting
DUAL_MODE_ADC2 to 1. These control bits are found in the Miscellaneous Chip
Control Configuration (0x102) register.
The ADC is fed a buffered version of the crystal frequency, where it then generates a
clock that is 5 times the crystal clock. This clock is generated using a DLL-based
clock multiplier.
Maximu
m
Vin 1.6V p-p
1.0LSB
0.7LSB
Units
102284BConexant3-13
Production Data Sheet
8/3/05
Page 40
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.4Digital Video Processing
The CX25840/1/2/3 integrate all mixed-signal integrated circuit functions required for
decoding broadcast video television standards. They decode all common broadcast
analog video formats—(all NTSC, PAL, and SECAM variations) in addition to the
nonbroadcast NTSC-4.43 and PAL-60 formats.
The devices decode standard-definition baseband video, formatted as either a
composite video baseband signal (CVBS), S-Video (Y/C) format, or as component
(YPbPr) format.
For composite video inputs, excellent luma/chroma separation is achieved through the
use of an adaptive 5-line comb filter.
All video formats are decoded to either a 10-bit or 8-bit ITU-R BT.656 digital video
stream with embedded sync bytes, VIP 2 scalable digital video stream, or as SPIcoded video stream with separate sync pins.
3-14Conexant102284B
Production Data Sheet
8/3/05
Page 41
CX25840/1/2/3 Data SheetDetailed Functional Description
Figure 3-4 illustrates the video decoding functions and data flow.
Figure 3-4. Video Decoder Functional Block Diagram
Audio Samples
VBI FIFO I/F
VBI
Slicer
Luma AdjustBack Porch
Low Pass Filter
(Scaling Dependent)
Luma Datapath
Back Porch Removal
Adjust
Discrete Timing
Control (SPI)
Brightness
Contrast
Peaking
White Crush
Luma
Output Formatter
Vertical Scaling
Horizontal Scaling
Chroma Datapath
SECAM Bell Filter
656/VIP
Output
Saturation
Chroma Killer/AGC
SECAM
Demodulator
U/V
NTSC/PAL
Hue Adjust
U/V
Sync, Field
Strobes
Clocks
Resets
.
Test Bus
.
Muxing
.
.
Macrovision
Detect
and
Frame
Store
Interface
PLL Freq.
Control
Default
PLL Freq.
Luma/Composite
Chroma Remod
Luma Comb Filter
Y/C Separation
Line Store
Sample Rate Convert, Horizontal Timing Loop
Digital Front End (AGC, DC-Restore)
From
Luma ADC
Clamp Control
Chroma Comb Filter
Chroma Demod/SC Gen
Chroma/UV
VGA Gain,
From
Chroma ADC
Misc. Control
Misc. Status
VBI FIFO I/F
vsync
Global Timing Control
Video
Registers
Timing
Regs
Video
Timing
Generator
APB+
IRQ
102284_053
102284BConexant3-15
Production Data Sheet
8/3/05
Page 42
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.4.1Video Signal Format
The input waveform to the video decoder can be in either composite (CVBS), S-Video
(Y/C), or component (YPbPr) format. For any of the composite video inputs, only
ADC1 and ACD2 can be used to sample the video waveform. If desired, the analog
front-end of channel 2 can be powered down in situations that do not require S-Video
or component video decoding. When an S-Video signal is applied, ADC1 samples the
luma signal, and ADC2 samples the chroma signal. When a component waveform
signal is applied, the Pb and Pr values are interleaved on ADC2.
The selection of the type of video format to decode is made by programming the
appropriate value to the INPUT_MODE bits of the Video Mode Control 2 register
(0x401). Once INPUT_MODE is programmed, the video format registers in
Table 3 -1 2 are auto programmed. These registers can be manually programmed as
well. In cases where S-Video or component formats are to be decoded, the VGA for
the chroma channels must be programmed to clamp at the mid-code of the input
waveform. This is programmed through the CLAMP_SEL_CHx bits in the AFE
Control 2 register (0x105). Additionally, for decoding component signals, the second
ADC must be programmed for dual sampling mode. The DUAL_MODE_ADC2 bit
of the Miscellaneous Chip Control Configuration register (0x102) should be set high
to enable multiplexed sampling for the Pb and Pr inputs.
For reducing the integrated anti-alias filter bandwidth on chroma channels, the
HALF_BW_CH{1}/2/3 bits are provided. Setting this bit high halves the input
bandwidth for that particular channel and prevents the occurrence of any anti-aliasing
artifacts. This bit should be set when the channels are used for the chroma waveforms
in component video format.Tab le 3 -1 4 lists the video format register settings.
Table 3-14. Video Format Register Settings
Video
Format
Composite 0000000
S-Video0101100
Component1101111
For power savings measures, the analog front-end associated with chroma inputs can
be powered down when decoding only composite input signals. Control over powering
down the second ADC and its associated VGAs can be found in the Power Control 1
register (0x130).
INPUT_M
ODE
CLAMP_S
EL_CH{1}
CLAMP_S
EL_CH{2}
CLAMP_S
EL_CH{3}
DUAL_MO
DE_ADC2
HALF_BW
_CH{2}/3
3-16Conexant102284B
Production Data Sheet
8/3/05
Page 43
CX25840/1/2/3 Data SheetDetailed Functional Description
3.4.2AFE and Video Auto-Config
AFE and Video Auto-Config are enabled by default, but can be overridden in the
Miscellaneous Chip Control register (0x102) by setting bit 4 to a 1.
3.4.2.1AFE Control Auto-Config
Several control ports to the AFE from the digital core must be adjusted based on the
input mode, that is, the content received into the dual ADCs.
To provide some background, the chip contains the two ADCs, but three pre-ADC
channels. The pre-ADC channels contain conditioning circuits, Variable-Gain
Amplifiers (VGAs), and anti-alias filters. ADC1 is fed by one channel, Channel 1,
and Miscellaneous Chip Control is fed by two channels (Channel 2 and Channel 3).
Either Channel 2 or Channel 3 can be selected to drive Miscellaneous Chip Control
statically, but the AFE also supports a dual mode in which the Miscellaneous Chip
Control alternates between samples from Channel 2 and Channel 3 on each sample
clock. This supports component video mode, where it is acceptable to digitize the Pb/
Pr input streams at half the normal bandwidth. It also supports a mode which allows
us to support S-Video and audio IF simultaneously, by digitizing the chroma stream
and the audio stream at half of the normal bandwidth.
Table 3 -1 5 shows the supported input formats. Naturally, the chip supports mapping
of any given input stream to either ADC1 or Miscellaneous Chip Control, but when
auto-config mode is enabled, default assumptions are made according to Table 3 -1 5.
To reverse the input streams between ADC1 and Miscellaneous Chip Control
channels, the auto-config bit should be disabled.
Table 3-15. AFE Input Modes
Video Mode Control 2 (0x401)
INPUT_MODE (Bits 2:1)
00Composite Video/AudioCVBSAudio
01Y/C, S-VideoLumaChroma
10Y/C/A, S-Video with half-rate chroma and half-rate audioYChroma/Audio
11Y/Pb/Pr, Component VideoYPb/Pr
Each input mode requires that several AFE control ports be adjusted, either to achieve
the required functionality, or to optimize performance. The register f ields that control
these ports are not register bits that the user generally needs to adjust. Therefore, the
auto-config feature is designed to allow the user to just specify the input mode,
without having to develop software that knows how to fine-tune the AFE controls.
The register logic will automatically adjust the register fields upon writing the
INPUT_MODE field in the Video Mode Control 2 register (0x0401). The auto-config
will happen immediately upon writing the INPUT_MODE field. If desired by the
customer, software may overwrite any fields that were set by the auto-config logic by
directly writing to that field. However, the auto-config logic will again modify the
register fields if software again writes the INPUT_MODE field. To disable the autoconfig features altogether, write the CHIP_ACFG_DIS (Miscellaneous Chip Control
Configuration register, 0x102) bit.
Mode DescriptionADC1
Miscellaneous
Chip Control
102284BConexant3-17
Production Data Sheet
8/3/05
Page 44
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Table 3 -1 6 shows how the register field in the Miscellaneous Chip Control
Configuration and AFE Control (N) registers will be configured based on the
INPUT_MODE field of the Video Mode Control 2 register (0x0401).
Table 3-16. AFE Control Auto-Config
Field NameRegisterBits
INPUT_MODE0x4012:100011011
DUAL_MODE_ADC20x10220011
DROOP_COMP_CH30x10640001
DROOP_COMP_CH20x10630011
CLAMP_EN_CH30x10610001
CLAMP_EN_CH20x10600001
VGA_SEL_CH30x10501010
VGA_SEL_CH10x10461000
HALF_BW_CH30x10450001
HALF_BW_CH20x10440001
3.4.2.2Video PLL Auto-Config
Similar to the AFE Control Auto-Config feature, the Video PLL frequency is also
automatically configured based on the video operating mode. The Video PLL must be
programmed to eight times the pixel rate. The pixel rate in turn depends on whether
the chip is in square pixel mode, and if so, whether it is currently decoding a 525-line
format or a 625-line format.
CVBS
(Default)
Y/CY/C/AY/Pb/Pr
Table 3-17. Pixel Frequency Modes
ModePixel Frequency (MHz) 8x Video PLL Frequency (MHz)Sq_pixel bitLines-per-frame
BT.65613.5000108.00000Don’t-care
525-line square pixel12.272798.18181525
625-line square pixel14.7500118.00001625
When auto-config is enabled, the video PLL frequency will be automatically
configured based on whether the chip is in square pixel mode, and if so, whether the
decoder is decoding a 525-line or 625-line format. The auto-config logic will
immediately re-program the video PLL frequency controls whenever either of the
following events happens:
1. The SQ_PIXEL bit 4 in Video Mode Control 1 (address = 0x400) is written;
2. The video format changes, whether due to a register write to the VID_FMT_SEL
field bits 3:0 of Video Mode Control 1, or due to a format change while in autodetection mode.
If desired by the customer, software may overwrite any fields that were set by the
auto-config logic by directly writing to that field. However, the auto-config logic will
again modify the register fields if one of the auto-config events listed above happens.
To disable the auto-config feature altogether, write the CHIP_ACFG_DIS
3-18Conexant102284B
Production Data Sheet
8/3/05
Page 45
CX25840/1/2/3 Data SheetDetailed Functional Description
(Miscellaneous Chip Control Configuration, 0x102) bit. This is the same bit described
above, that disables the AFE Control Auto-Config.
Table 3 -1 8 shows how the registers are configured based on the pixel frequency mode.
Table 3-18. Video PLL Auto-Config
Field NameRegisterBit(s)
VID_PLL_POST
VID_PLL_INT
VID_PLL_FRAC1
VID_PLL_FRAC2
VID_PLL_FRAC3
VID_PLL_FRAC4
0x1095:00x040x040x04
0x1085:00x0F0x0D0x10
0x10C7:00xFE0xE60xB7
0x10D7:00xE20xB60x0F
0x10E7:00x2B0x6D0xF7
0x10F00x00x10x0
BT.656 timing
(Default)
3.4.3Video Standard Auto-Detection
The CX25840/1/2/3 automatically detect and configure themselves to decode a
variety of video standards found throughout the world. The auto-format detection
logic uses information about the subcarrier frequency, number of video lines, and
whether or not the video is alternating phase in order to determine the input standard.
For cases where two standards are differentiated by the presence or absence of a
pedestal (or setup), two user-programmable register bits, AFD_PAL_SEL and
AFD_NTSC_SEL, are required to differentiate the standards. Table 3-19 illustrates
how this information is used to automatically determine the video standard.
Table 3-19. Auto Format Detection Parameters
525-line Square Pixel625-line Square Pixel
NTSC-MNTSC-J
Video Lines
Subcarrier
Frequency
AFD_PAL SEL
AFD_NTSC_SEL
102284BConexant3-19
Production Data Sheet
8/3/05
525525625625525625625525525
3.583.584.434.433.583.584.25/
N/AN/A01N/AN/AN/AN/AN/A
01N/AN/AN/AN/AN/AN/AN/A
Video standards supported include NTSC-M, NTSC-J, NTSC-4.43, PAL-BDGHI,
PAL-M, PAL-N, PAL-N combination, PAL-60, and SECAM. After a device reset, the
video decoder comes up in auto-detect mode and automatically configures the
Vertical Blanking, Vertical Active, Horizontal Blanking, Horizontal Active, Burst
Gate Delay, Band-pass Filter, Comb Error Limit, SRC Decimation Ratio, Subcarrier
Step Size, and VBI Offset registers based upon the active input and whether the
SQ_PIXEL bit is set in the VIDEO MODE CONTROL 1 register (0x400).
PAL-
BDGHI
PAL-NPAL-MPAL-NCSECAMPAL-60
4.434.43
4.40
NTSC-
443
Page 46
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Refer to Table s 5 -4 and 5-5, which show the register values when auto-detect mode is
selected for BT.656 decoding and square-pixel rate decoding.
Two video standards, NTSC-J and PAL-N, require additional configuration to discern
between NTSC-M and PAL-BDGHI, respectively. For properly decoded black levels
with NTSC-J and PAL-N, the AFD_NTSC_SEL or AFD_PAL_SEL bit in the VIDEO
MODE CONTROL 1 register (0x400) must be set high to indicate to the decoder that
no pedestal is present on the input waveform.
The auto detection can also be manually overridden by programming the
VID_FMT_SEL bits in the VIDEO MODE CONTROL 1 register (0x400) to the
desired video standard to be decoded. Writing these VID_FMT_SEL bits to a forced
standard still enables automatic configuration of the registers to their respective
values but disables the function to automatically switch should a different video
standard be input. To completely disable the automatic register conf iguration, the
ACFG_DIS bit in Video Mode Control 1 (0x400) register should be set high.
3.4.4Signal Level Adjust in the Digital Front End
When a video signal is first applied, the Digital Front End (DFE) block receives 8x
NTSC subcarrier, oversampled waveforms from the ADCs that have unknown
amplitude and offsets. The block then applies offset and gain to the input such that the
output of the DFE is aligned with expected levels for black and white. The DFE
controls the amplitude of the signal into the ADCs by implementing an AGC
algorithm to gain the signal based on the reference sync-tip amplitude. This AGC
algorithm coarsely controls the signal amplitude by adjusting the VGA gain in
discrete steps. Next, fine adjustment of the amplitude is accomplished by applying a
digital multiplier to the incoming signal.
Since some video equipment provides a less-than-standard sync tip, the decoder must
also adapt the gain accordingly. If the input signal contains white levels that exceed
the expected normal level, the luma processing block detects the occurrence of these
excursions past the normal peak white and updates the sync-tip height reference.
The DFE is also responsible for aligning the back porch to a standard level. It
measures the average level of the back porch level in the incoming signal, and then
adds an offset to the ADC data after it has passed through the gain stage.
For S-Video and component formats, the chroma and Pb/Pr ADC data must have their
own gain and offset applied. For these cases, the DFE uses the same gain value that
was determined from the luma channel for the chroma and Pb/Pr channels. However,
for the offset, different assumptions apply. In the case of S-Video, it assumes that the
chroma signal is balanced around the ADC’s mid-code value of 0x200. Any DC offset
from this ideal value should not matter once the AC waveform is passed through the
chroma demodulation stage. In the case of YPbPr video format, the offset is such that
the chroma value during the sync tip is clamped to the mid-code value of 0x200
(which is logically equivalent to U/V = 0).
The DFE is also partly responsible for determining when the input waveform is
clamped. The AFE attempts to clamp the sync tip to a level such that after passing
through the VGA stage, it is roughly the correct level. This requires the DFE to
provide both the clamping strobe during the sync pulse and a clamping level to the
AFE. The clamping level is provided through mapping based on the VGA setting.
These functions also serve to maximize the dynamic range of the ADC.
Alternatively, the automatic function of the VGA and AGC can be disabled by setting
the auto enable bits, VGA_AUTO_EN and AGC_AUTO_EN, in the DFE CONTROL
register (0x48B) low and manually setting the gain values through the VGA Gain
3-20Conexant102284B
Production Data Sheet
8/3/05
Page 47
CX25840/1/2/3 Data SheetDetailed Functional Description
Control register (0x488) and AGC Gain Control registers (0x489 and 0x48A). The
auto clamping function can be disabled as well through the CLAMP_AUTO_EN bit in
the DFE Control register (0x48B). Manual control of the VGA, AGC, and clamp can
be useful for specialized applications such as security cameras, but is not
recommended for applications where the sources, formats, and standards of the video
equipment providing the signal can vary from one use to another.
3.4.5Sample Rate Conversion
After the levels of the ADC samples are adjusted, the sample points must be adjusted
in time. The Sample Rate Conversion (SRC) blocks convert the signal from the ADC
crystal clock domain to the pixel clock rate. Three pixel clock rates are supported. as
shown in Tab le 3 -2 0.
Table 3-20. Pixel Sample Rates
Pixel RateUsage
13.5 MHzITU-R BT.656 Pixel Frequency
14.75 MHzPAL and SECAM 625-line Square Pixel Frequency
12.272715 MHzNTSC 525-line Square Pixel Frequency
This conversion is more involved than a static sample rate conversion. The sample
points must be adjusted so the SRC provides not only the same number of pixels per
line (for example, 858 in 13.5 MHz mode), but sample points placed such that the first
sample is aligned with the leading horizontal sync edge.
VCRs often have timing glitches during the vertical blanking interval caused by head
switches, and camera sources can have inter-field and intra-field drift in their line
timing due to the manner in which their video timing is derived. The SRC is designed
to maintain pixel alignment with these types of nonstandard timing sources by quickly
locking to these line-to-line timing variations and smoothing out these variations so
that a consistent amount of pixels is output from the decoder.
3.4.6Source Locked Pixel Clock Generation
The sample rate conversion stage also controls the pixel clock generated by the video
PLL. This PLL should be programmed to generate a clock that is 8 times the pixel
rate. The internal video decoder logic is clocked with either this 8x clock, or a
divided-down 2x version of the same clock.
An important aspect of the SRC and video PLL is that these two blocks work together
to provide an internal clock that is locked to the video source. The BT.656 output
format requires a fixed number of clocks per field, which is the driving requirement
for a pixel clock that is locked to the video source. Not only must there be a constant
number of clocks per field, but the PLL-generated clock must be stable. This is
required to support MPEG video codec devices connected to the pixel output
interface. Similarly, analog video encoders that derive their time base from the pixel
clock that we provide can result in inaccurate hue if there is substantial clock drift over
the short term.
The video PLL clock directly controls the post-SRC pipeline of the video decoder all
the way to the output pixel interface. The frequency creates an exact data rate
102284BConexant3-21
Production Data Sheet
8/3/05
Page 48
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
requirement from the SRC, although the data rate out of the polyphase decimation
filter rate is generated independently of the PLL pixel clock. The polyphase filter
output rate and the PLL frequency are nevertheless locked, because both the SRC
filter and the PLL are both locked to a constant number of pixels per line. The
difference is that the SRC has a locking time constant of a few lines, while the PLL
has a locking time constant of hundreds to thousands of lines. This means that the
PLL- and SRC-effective sample rates can deviate from each other over the short term.
To accommodate these short-term clock rate deviations, a synchronization FIFO large
enough to hold a line’s worth of pixels is implemented. The nominal FIFO level is
half-full. The FIFO level can rise above the midpoint as the SRC quickly outputs more
sample points to keep up with short lines. The FIFO level can fall below midpoint as
the SRC slows down to accommodate longer lines, but the rate at which samples are
read from the FIFO is relatively constant.V
3.4.7Vertical Sync Detection
The sample rate converter has one more task. It detects transitions in the data that
indicate vertical sync pulses (VSYNC). The timing generator circuitry uses the
VSYNC pulse to synchronize its vertical counters, and determine what field is
currently being decoded.roma
3.4.8Luma and Chroma Separation
After the data passes through the DFE level adjust and sample rate converter stages,
the next step is to separate the luma from the chroma for composite signal sources
(see Figure 3-5). For S-Video and component signal source, the chroma is already
separated out, and these ADC samples simply bypass the separation stage and go to
the chroma demodulator.
Figure 3-5. YC Separation Block Diagram
YC_IN
2H Line
Store
4H Line
Store
CUV_IN
x8PCLK
svideo-
mode
Chroma
BPF/Notch
Chroma
Demod
Comb
Filter
Chroma
Remod
+
–
Y_OUT
C_OUT
102284_005
A digital PLL is used to track the color subcarrier frequency, F
decoded. It is the responsibility of the subcarrier tracking loop logic to exactly match
the phase frequency of the subcarrier in order to properly decode the color
3-22Conexant102284B
Production Data Sheet
as each line is
sc,
8/3/05
Page 49
CX25840/1/2/3 Data SheetDetailed Functional Description
information. The 2ωt components of the U and V are then removed by a low-pass
filter, resulting in baseband chroma components.
The Y/C separation block implements a 5-line adaptive comb filter, with adaptive
fallback to a chroma notch filter. The comb filter implements two algorithms, one for
NTSC and one for PAL. The two algorithms are required because the NTSC color
carrier has a 180-degree phase shift between adjacent lines, while the PAL color
carrier has only a 90-degree phase shift. However, the comb filter takes advantage of
these phase shifts in the color subcarrier from line to line to recover luminance data
from the bandwidth occupied by the chrominance data.
The CX25840/1/2/3 separates luminance and chrominance components of the
composite video signal with a flexible combination of a luma comb, chroma comb
and notch filter. A total of five lines are used in the chroma comb filter algorithm.
Four lines are stored in on-chip memory, and the fifth line is the currently decoded
line. The adaptation algorithms take advantage of the two additional lines to provide
pixels that are in phase with the current pixel in NTSC mode, or to provide additional
comb filter options in PAL mode. The luma comb uses only three lines, but which
three depends on whether the signal is NTSC or PAL.
The chroma comb filter uses addition and subtraction to determine the lines with the
highest degree of correlation with the current pixel and extract the chrominance from
these pixels. Since any sample consists of both luma and chroma components, the
difference between two pixels could be due to either luminance or chrominance
difference, and there is not enough information to tell them apart. In other words,
since on any adjacent line, the chroma is out of phase with the current line, subtracting
the two pixels is not the difference between the pixels, but rather chroma plus the
difference. For NTSC systems, the addition of another pair of lines above the usual
three gives access to two lines that are in phase with the current line, making a true
comparison possible. In PAL systems, the additional lines are 180 degrees out of
phase with the current line, making it similar to NTSC with three lines. However,
using a combination of all five lines, a comparison between the current line and the
outer lines is possible. So the comb filter finds the combination of lines in which this
difference is the smallest. If all the differences are above the programmed
CCOMB_ERR_LIMIT threshold in the Chroma Comb Error Limit Max (0x49E)
register, the chroma is passed through unaltered and the luminance is notch filtered.
The luma comb uses only the lines which have chroma 180 degrees out of phase, but it
first low pass filters the signal to remove the chroma, then compares the remaining
luma components. In addition, the chroma comb feeds the difference it has computed
to the luma comb. If both errors are acceptably low (below LCOMB_ERR_LIMIT)
the luma comb averages the pixels over the entire signal bandwidth. This greatly
reduces cross luma in color transitions and high-frequency chroma sources such as
DVD players.
In SECAM mode, or when the adaptation algorithm determines that an unacceptable
error would be created by the comb filter algorithm, it simply notch-filters the color
subcarrier out of the luma. Since SECAM uses an FM modulated signal, a carrier is
always present, regardless of whether or not there is color information being
broadcast. This results in a visible artifact in the luminance at the carrier frequency. To
minimize this effect, an “inverse bell” filter is applied at the encoder to attenuate color
frequencies near the Dr and Db carriers. Thus, if little or no color information is
present in the signal, the carriers will be reduced in amplitude. In order to properly
decode the color information, a “bell” filter is applied to the chroma data when in
SECAM mode.
102284BConexant3-23
Production Data Sheet
8/3/05
Page 50
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.4.9Luma Processing
The luma data path logic processes the luma waveform that comes from the Y/C
separation module to produce SPI luma samples. These decoded luma samples are
then sent through logic blocks that can perform post-processing functions such as
white crush, peaking for sharpness control, contrast, and brightness adjustment before
they are passed along to the scaling block.
White Crush
The “white crush” term refers to Conexant’s algorithm for adapting to luma overflow
in the presence of nonstandard sync-tip-to-white ratios. The luma samples are first
passed through the white crush circuitry, which works with the front-end to
automatically fine-tune the video levels. This circuitry adjusts the overall gain of the
input signal such that excursions above nominal 100 or 110 IRE peak white-level are
compensated for to reduce video-blooming artifacts. The white crush processing is by
default enabled but can be disabled by writing a 0 to the WCEN bit of Mode Control
register 2 (0x401). The 110 IRE threshold can be enabled by setting the WTW_EN bit
high in the White Crush Control 3 register (0x4A2).
Following white crush, the back porch of the luma waveform is removed, and for some
video formats, the setup (or pedestal) value is removed as well. The luma samples are
then multiplied by scale factors to match SPI def ined luma levels. Setup removal is
determined by the video standard.
Luma Low-Pass Filtering
Next, the luma is optionally low-pass filtered to remove any high frequency content
that could cause alias artifacts associated with horizontal scaling. The filter has four
different transfer functions based upon the desired horizontal scaling factor. The
appropriate transfer characteristic is automatically selected by deriving from the value
that is programmed in the Horizontal Scaling registers (0x418 to 0x41A). One of
these four transfer functions is nothing more than a filter bypass. This is automatically
chosen when no scaling is enabled.
3-24Conexant102284B
Production Data Sheet
8/3/05
Page 51
CX25840/1/2/3 Data SheetDetailed Functional Description
Figure 3-6 shows the luma filter responses for the other three transfer characteristics
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Luma Peaking
Following the low-pass filter is another filter, the peaking or sharpness filter. The
peaking filter can be used to improve the high frequency response of the luma near its
corner frequency. As with the luma low-pass filter, this filter has multiple response
functions. There is a bypass mode and four modes with non-0 gains, increasing from
+2.0 dB to +6.0 dB. The larger the programmed gain of the filter, the greater the luma
high frequency adjustment. The filter is enabled through the PEAK_EN bit in the
Luma Control register (0x416). The gain of the filter is selected through the
PEAK_SEL bits, which selects between the four positive gain values, +2.0 dB,
+3.5 dB, +5.0 dB, and +6.0 dB. Figure 3-7 shows the peaking filter characteristics for
the various pixel rates.
3-26Conexant102284B
Production Data Sheet
8/3/05
Page 53
CX25840/1/2/3 Data SheetDetailed Functional Description
Peaking Filter Response @ PAL Square Pixel Rate (14.75 MHz)
6
5
4
3
2
Magnitude (dB)
1
0
1234
Frequency (Hz)
102284BConexant3-27
Production Data Sheet
8/3/05
567
6
x 10
102284_008
Page 54
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Contrast
Contrast adjustment follows the peaking filter. This block multiplies the luma samples
by the contrast value that is programmed into the Contrast register (0x415). The
multiplication value is represented by a 2s complement number, thus values above
0x80 increase the contrast, and values below 0x80 decrease the contrast. This is
followed by color-space conversion, which converts the luma from YUV color space
to YCrCb color space. The function involves multiplying the incoming luma data by
the color-space conversion factor. The incoming video standard and the desired output
range of luma codes determine the multiplication factor. The RANGE bits of the
Luma Control register (0x416) determine the number of 10-bit codes, out of 1024,
that are allowed for the nominal luma range. This does not mean that the luma is
limited to this range. It just means that this range is used in the color space conversion
process.
Brightness
Following the contrast and color-space conversion multiplication operations, the
brightness adjustment is performed, which is an addition of the luma samples with 8
times the value found in the BRIGHTNESS register (0x414). This register value is
represented by a 2s complement number, allowing the overall video level to be
adjusted down by as much as 1024, or up by as much as 1016 on a 10-bit scale. This
results in a luma signal that has been offset by an amount equal to the brightness
value.
The next step is the coring operation, which serves to remove low-level noise by
zeroing-out any values whose magnitude is below a user-selected threshold. This
threshold is selected through the LUMA_CORE_SEL bits in the Luma Control
register (0x416). This coring threshold can range from 0, which would have no effect,
to 64, which would zero-out the 7 LSBs of the luma output.
The final process of the luma data path is the range saturation. The range adjustment
enables the user to select one of three allowed luma output ranges. The first range is
compliant to the SPI specification that allows for a nominal 64–940 range with
excursion up to 1016 but not below 16-black level. The second range is similar in that
it allows for a nominal 64–940 with excursions up to 1016 but in addition it allows for
excursions below 16. This is to support blacker-than-black values which are possible
on systems with a pedestal. The final range places no restrictions on the data in that it
allows all value from 0 to 1023 to pass. Table 3 -2 1 illustrates the output range of the
luma data for the various RANGE bits in the Luma Control register (0x416).
Table 3-21. Luma Output Ranges
Nominal Range
After Color-
RANGE[5:4]
0064–94016–23564–1016Nominal range with excursions allowed but
0164–9401–2354–1016Nominal range with excursions and blacker
1x0–10230–2550–10230–1023 nominal with no limiting
3-28Conexant102284B
Production Data Sheet
Space
Conversion
(decimal)
Allowed 8-bit
Output Range
(decimal)
Allowed 10-bit
Output Range
(decimal)
Description
no blacker than black levels
than black allowed
8/3/05
Page 55
CX25840/1/2/3 Data SheetDetailed Functional Description
3.4.10Chroma Processing
The Chroma Data Processing (CDP) block receives chrominance U/V data from the
Y/C Separation (YCS) block. Although the SECAM demodulator is located in the
CDP, the demodulator for NTSC and PAL is located in the YCS because of the comb
filtering in these formats. The U/V input is also used to support component video
(YUV) formats. The component format U/V data is merged into the U/V data path in
the YCS block.
Figure 3-8 illustrates the major components of the CDP. When in SECAM mode, the
CDP must demodulate the SECAM chroma to obtain the Db/Dr baseband
components. Otherwise, hue adjustment is done for the NTSC and PAL formats. The
CDP performs AGC on the signals, for NTSC and PAL formats, based on the value of
the U component during the color burst. Adjustments are made for saturation, color
space conversion for the Cb/Cr space, and finally chroma coring. The chroma data
path also contains a programmable delay of +
relative to the luma data path.
Figure 3-8. Chroma Processing
2 pixels to allow alignment adjustments
UV_IN
Figure 3-9. SECAM Chroma Demod
NTSC/PAL
Hue Adjust
SECAM
Demodulator
Some amount of SECAM preprocessing is performed in the YCS block. The SECAM
complex down converter or frequency mixer and the Bell filter function is performed
in the YCS block. The CDP processing for SECAM is shown in Figure 3-9.
Demod
FM
Offset
Adjust
Chroma
AGC
Deemphasis
Chroma
Adjust
CBCR_OUT
102284_049
DRDB_OUTUV_IN
102284_050
The first step is to perform FM demodulation. FM demodulation is implemented with
a CORDIC rotator followed by a differentiator filter. Next, an adjustment is made to
the output of the FM demod to account for the frequency offset introduced by using
the fixed frequency mixer. A fixed de-emphasis filter is then applied according to the
SECAM standard.
102284BConexant3-29
Production Data Sheet
8/3/05
Page 56
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Hue can be adjusted for NTSC video standards through the Hue register (0x422). The
register value represents a signed 8-bit value that is used to rotate the subcarrier phase
in increments of 0.35 degrees with a range of –45 degrees to +45 degrees.
Chroma AGC
The chroma AGC logic is used to correct for nonstandard chrominance information in
NTSC and PAL, typically found in VCRs, by multiplying the chrominance
information by a computed gain value. The chroma AGC logic is a feedback loop that
continually adjusts the gain applied to the chrominance data to produce the standard
level for the given television format. Each horizontal line, the value of the U data
during the color burst is compared to the standard value, and the difference
accumulated over four samples. If the error is greater than or equal to –8, or less than
or equal to 7 for 32 consecutive lines, the chroma AGC enters an idle state. Once in
this idle state, the chroma AGC does not make any gain corrections until the
accumulated error is greater than or equal to 32, or less than or equal to –32 for 32
consecutive lines. At this point, corrections are made until the idle state is entered
once again. This gain update only occurs once per line. The chroma AGC is enabled
by default but can be disabled by setting the CAGCEN bit of the Video Mode Control
2 register (0x401) to 0. The chroma AGC is also disabled automatically if the video
input format is component, YPrPb, or if the video standard is SECAM.
Chroma Kill
The chroma kill function disables the chroma demodulation function if the color burst
is detected to be below a certain threshold. This allows for the case in which either no
color exists or a greatly attenuated color subcarrier exists on the video input. This
prevents the chroma AGC loop from falsely detecting noise as chroma and amplifying
it.
The NTSC and PAL chroma killer is accomplished by logic that detects a low color
burst value for 127 consecutive lines. The chroma killer state machine monitors
chroma samples that are accumulated during the color burst. If the accumulated
chroma samples have a magnitude smaller than 7 percent of the nominal NTSC burst
amplitude, or 10 percent of the nominal PAL burst amplitude, the color kill function is
asserted. If the accumulated chroma sample value has a greater magnitude than
14 percent of nominal NTSC burst amplitude, or 19 percent of nominal PAL burst
amplitude for 127 consecutive lines, the color killer function is automatically
disabled. The SECAM chroma killer is accomplished by using the subcarrier
frequency detect information from the DFE. If no subcarrier exists for 127
consecutive lines, the chroma killer logic is activated. To permanently disable the
color killer function, the CKILLEN bit in the Video Mode Control 2 register (0x401)
should be set low.
3-30Conexant102284B
Production Data Sheet
8/3/05
Page 57
CX25840/1/2/3 Data SheetDetailed Functional Description
Saturation
Saturation can be adjusted through the Saturation-U (0x420) and Saturation-V
(0x421) registers. These register values are doubled internally and then multiplied
with the U and V data. The result is then rounded and clamped to a 10-bit value. To
maintain proper U and V saturation ratios, these registers should be written in tandem
with the same value. Tab le 3 -22 illustrates the range of saturation adjustment
available.
Table 3-22. Chroma Saturation Range
Decimal ValueHex ValuePercent of Original Signal
2550xFF199.22
2540xFE198.44
.
.
.
1290x81100.78
1280x80100.00
1270x7F99.22
.
.
.
10x010.78
00x000.00
Chroma Coring
Chroma
values whose magnitude is below a user-selected threshold. This threshold is selected
through the C_CORE_SEL bits in the Chroma Control register (0x423). This coring
threshold can range from 0, which would have no effect, to ±31, which would zero out the
6 LSBs of the chroma output. Ta ble 3- 23 shows the range of possible chroma coring
values.
coring can be enabled to remove low-level chroma noise by zeroing out any
Table 3-23. Chroma Coring Range
.
.
.
.
.
.
.
.
.
.
.
.
C_CORE_SEL[1:0]Coring Range
00No coring
01–7 <= x <= +7
10–15 <= x <= +15
11–31 <= x <= +31
Lastly, the chroma data can be delayed by ± 2 pixels relative to the luma data. The
CHR_DELAY bits of Chroma Control register (0x423) specify the delay. The values
can be thought of as signed 3-bit numbers that represent the pixel delay. Positive
values mean the chroma data will be delayed more than the 0 value. Negative values
mean the chroma data will be delayed less than the 0 value.
102284BConexant3-31
Production Data Sheet
8/3/05
Page 58
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.4.11Copy Protection Detect
The copy protection logic detects the presence of the pseudo-sync pulses and color
striping in the video waveform according to the Macrovision copy protection
detection specification. If more than a minimum specified number of pseudo-sync
pulses (PSP) in a field are detected, the MV_PSP status bit is set in the Copy
Protection Status register (0x40C). If Macrovision color striping is detected for more
than a specified minimum number of lines, the logic sets a status bit indicating that
color striping has been detected and additional status bits indicating what type of color
striping is detected, type 2 or type 3. The MV_CS bit indicates the presence of color
striping, the MV_T3CS bit indicates the presence of type 3 color striping, and
MV_TYPE2_PAIR indicates a type 2 pair detected. These status bits can be found in
the Copy Protection Status register (0x40C).
Additionally, the pseudo-sync pulse and color striping status indicators are encoded to
form a 2-bit Macrovision Copy Control status as described in the Macrovision
detection specification. This code is represented by the MV_CDAT bits in the Copy
Protection Status register (0x40C). The host processor can be automatically informed
of changes in the presence of copy protection on the source material through the
interrupt pin. A MV_CHANGE_STAT interrupt status with mask is available in the
Interrupt Status 2 and Interrupt Mask 2 registers (0x411 and 0x413), respectively. If
the MV_CHANGE_STAT mask is 0, any change to the status bit is reflected on the
interrupt pin. This alleviates the host processor from having to continually poll the
status register to see if copy protection is present on the incoming video waveform.
3.4.12Timing Generator
The timing generator provides all the timing control strobes for video decoder paths
that follow the sample rate converter block. It outputs both horizontal and vertical
timing control, including blanking and burst gate control. The SRC module provides
vertical sync (VSYNC) and horizontal sync (HSYNC) reference pulses to
synchronize the timing generator.
In auto-detect mode, the timing generator is also responsible for controlling the
format search. Based on the lines-per-frame count, the subcarrier frequency, and the
presence of phase alternation, the mode is selected. When video lock is lost and reacquired, the default assumption is that the video broadcast standard remains
unchanged. It is only when differences in the key format metrics are detected that the
format selection is changed.
Upon selecting a mode, the timing generator automatically sets all of the timing
parameters required for the selected video broadcast standard. There is also a manual
mode where the timing parameters are produced directly from the programmable
register set.
3-32Conexant102284B
Production Data Sheet
8/3/05
Page 59
CX25840/1/2/3 Data SheetDetailed Functional Description
3.4.13Fast Channel Switching
Fast channel switching is when you grab a field (or frame) from an input and then
switch to another input and try to grab the first correct field available, and then switch
again to another input, and so on.
To determine if the decoder can grab a field after a channel switch, the decoder must
lock on the signal. To lock on the new input signal, it is necessary to have Horizontal
Lock, Vertical Lock, and Color lock on the video input.
The CX25840/1/2/3 uses optimized hardware to reduce the time needed to switch
between different signal sources. This new technology now achieves much higher
frame rates when switching inputs continuously.
This is achieved through the following:
Fast Horizontal Lock
Fast Vertical Lock
Fast Col or Lock
Fast adjustment of gain for input signal
Fast Horizontal Lock (HLOCK) is a feature that is already optimized in the decoder.
There are no registers to enable. The General Status 2 (0x40E) register has an
HLOCK bit that notifies the application that horizontal lock has been achieved. Even
under line length variations fast horizontal locking is achieved.
Fast Vertical Lock (VLOCK) can be achieved by setting FAST_LOCK_MD bit of the
Video Mode Control 3 (0x402) register to high to enable the fast locking algorithm.
The fast locking algorithm locks onto the first vertical sync it encounters, regardless
of where the internal timing counters expect a vertical sync to occur. It also disables
the hysteresis that is used for the field detection logic. As soon as the even/odd field is
detected, the field signal is updated to reflect that status. Vertical lock can be
determined by reading the VLOCK and VPRES status bits in the General Status 2
(0x40E) register.
To achieve Fast Color Lock (CSC_LOCK), the chroma subcarrier lock speed must be
set to fast mode. To do this, the auto mode of the subcarrier lock must first be disabled
by setting the AUTO_SC_LOCK bit low and then setting the subcarrier lock speed to
“fast” by setting the MAN_SC_FAST_LOCK bits in the Video Mode Control 2
(0x401) and Interrupt Status 1 (0x410) registers, respectively. Status of subcarrier
lock can be determined by reading the CSC_LOCK and
CSC_LOCK_CHANGE_STAT bits in the General Status 2 (0x40E) and Interrupt
Status 1 (0x410) registers, respectively.
To achieve a fast adjustment of gain for the input signal (AGC_LOCK), enable the
AGC_AUTO_EN and VGA_AUTO_EN functions in the Digital Front-End Control
(0x48B) register. By doing so, the decoder has the ability to automatically acquire
gain value for all eight composite inputs. This is particularly useful because the AGC
presents a problem for doing fast channel switching. Since all sources require
different gain values when we switch from one video input to another, it takes time for
the gain to adjust. The adjustment time can prevent how fast the application can
switch between inputs. After enabling the AGC_AUTO_EN and VGA_AUTO_EN
functions, the application would then enable each input, read the AGC_GAIN and
VGA_GAIN values for that source, and save the values for later use. Next, the
application would set AGC_AUTO_EN and VGA_AUTO_EN bits to manual mode,
and write the saved AGC value that is associated with a particular input to the
AGC_GAIN and VGA_GAIN fields. This technique of restoring predetermined gain
values eliminates the amount of time needed to adjust the AGC for the new video
input. The General Status 2 (0x40E) register has an AGC_LOCK bit that notifies the
application that the correct gain has been selected.
Finally, auto format detection should be disabled for fast channel switching. This is
accomplished by setting the VID_FMT_SEL bits in the Video Mode Control 1
register (0x400) to the appropriate video standard to be decoded.
102284BConexant3-33
Production Data Sheet
8/3/05
Page 60
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.4.14Temporal Decimation
Temporal decimation provides a solution for video synchronization during periods
when full frame rate cannot be supported due to bandwidth and system restrictions.
The device provides temporal decimation on either a field or frame basis. The
temporal decimation register (TDEC) is loaded with a value from 1 to 60 (NTSC) or 1
to 50 (PAL/SECAM). This value represents the number of fields or frames skipped by
the chip during a sequence of 60 for NTSC, or 50 for PAL/SECAM. Skipped fields
and frames are considered inactive, indicated by the ACTIVE pin remaining low.
Consequently, if QCLK is programmed to depend on ACTIVE, QCLK becomes
inactive as well.
Examples:
TDEC = 0x02 Decimation is performed by frames. Two frames are skipped per 60
frames of video, assuming NTSC decoding.
Frames 1–29 are output normally, then ACTIVE remains low for one frame.
Frames 30–59 are then output, followed by another frame of inactive video.
TDEC = 0x9E Decimation is performed by fields. Thirty fields are output per 60
fields of video, assuming NTSC decoding.
This value outputs every other field, or every odd field of video, starting with
field one in frame one.
TDEC = 0x01 Decimation is performed by frames. One frame is skipped per 50
frames of video, assuming PAL/SECAM decoding.
TDEC = 0x00 Decimation is not performed. Full frame rate video is output by the
device.
When changing programming in the temporal decimation register, 0x00 should be
loaded first, and then the decimation value. This ensures the decimation counter is
reset to zero. If zero is not first loaded, the decimation may start on any field or frame
in the sequence of 60 (or 50 for PAL/SECAM). On power-up, this preload is not
necessary because the counter is internally reset. When decimating fields, the
FLDALN bit in the TDEC register can be programmed to choose whether the
decimation starts with an odd field or an even field. If the FLDALN bit is set to
logical 0, the first field dropped during the decimation process will be an odd field.
Conversely, setting the FLDALN bit to logical 1 causes the even field to be dropped
first in the decimation process.
3-34Conexant102284B
Production Data Sheet
8/3/05
Page 61
CX25840/1/2/3 Data SheetDetailed Functional Description
3.5Scaling and Cropping
The scaling engine consists of both horizontal and vertical scalers. The purpose of the
scaling engine is to scale down the image by a programmable factor. This is useful
when viewing video on a PC desktop and when saving video to disk. The scaling
engine supports arbitrary and independent downscaling only with vertical and
horizontal scaling factors that are controlled through separate registers to allow
different scaling values—anamorphic scaling.
The horizontal scaler supports the following requirements:
Supports scaling from 1 to 15.999755859375 in 1/4096 steps.
Supports 63 phases between source samples. The filter rejects aliases by 60 dB.
The vertical scaler supports the following requirements:
Supports scaling from 1 to 7.998046875 in 1/512 steps.
Supports 7 phases between horizontal lines.
3.5.1Horizontal Scaling
The horizontal scaling function is shown in Figure 3-10. The primary purpose of this
block is to scale down horizontally or reduce the number of pixels in each line.
Horizontal scaling is implemented through multitap, polyphase interpolation. Six taps
of luma and four taps of chroma, each with 64 different phases, are used to accurately
interpolate the value of a scaled pixel. In simple pixel- and line-dropping algorithms,
noninteger scaling ratios introduce a step function in the video signal that effectively
introduces high-frequency spectral components. Polyphase interpolation accurately
interpolates to the correct pixel and line position, providing more accurate
information. This results in more aesthetically pleasing video and higher compression
ratios in bandwidth-limited applications. In addition, the chroma path has a YCrCb
4:4:4 to 4:2:2 conversion block. It is important to note that prior to horizontal scaling
the luma data path pre-f ilters the data to prevent aliasing artifacts
Figure 3-10. Horizontal Scaling Block Diagram
LUMA_YDP[9:0]
HSCALE[23:0]
HACTIVE
CBCR_HSC[9:0]
CBFLAG
102284BConexant3-35
Production Data Sheet
8/3/05
Phase
Generation
Luma
Coefficient
Generation
Chroma
Coefficient
Generation
Luma
Interpolation
Filter
Chroma
Interpolation
Filter
YCbCr
4:4:4 to
4:2:2
Conversion
LUMA_HSC[9:0]
HSC_HACTIVE
CBCR_HSC[9:0]
HSC_SKIP
HSC_OBFLAG
102284_011
Page 62
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
The amount of horizontal scaling performed is based on two factors, the number of
active pixels in a line entering the scaler along with the desired number of pixels
leaving the scaler. The ratio of these two values determines the scaling ratio to be used
in the following HSCALE formula:
Horizontal Scale Value (HSCALE) = (Scaling Ratio–1) x 2
For example, to achieve horizontal scaling of a BT.656 full-resolution (720 active
pixels) image down to a half-resolution (360 active pixel) image, the scaling ratio
would simply be 2, Scaling Ratio = 720/360. Using this value in the horizontal scaling
equation yields a value of HSCALE = 2
would be 4, Scaling Ratio = 720/180. Thus, the HSCALE register (0x418 to 0x41A)
value must be set to 3 x 2
horizontal scale factor.
For square pixel scaling, the same calculation is involved, except in this case, full
resolution has 640 active pixels for NTSC and 768 active pixels for PAL and SECAM.
The scaling ratios and the HSCALE values are the same as in the BT.656 calculations
(see Table 3 -2 4).
Table 3-24. Common Scaling Resolutions: HSCALE and VSCALE Values
ResolutionHSCALE (0x418 to 0x41A) ValueVSCALE (0x41C to 0x41D) Value
Full-resolution Square Pixel 1:10x0000000x0000
20
, 0x300000. Always round up when calculating a
20
(0x100000). For 4:1 scaling the scale factor
20
CIF 2:10x1000000x1E00
QCIF 4:10x3000000x1A00
Icon 8:10x7000000x1200
Note that there is no dependence on the horizontal blanking delay (HBLANK) value
that is programmed, as there have been in some previous generation video decoders.
3-36Conexant102284B
Production Data Sheet
8/3/05
Page 63
CX25840/1/2/3 Data SheetDetailed Functional Description
3.5.2Vertical Scaling
The vertical scaling function is shown in Figure 3-11. The primary purpose of this
block is to scale down vertically by reducing the number of lines. In addition, special
functions are performed during SECAM mode for Dr/Db line-store and during PAL
mode for line averaging.
Figure 3-11. Vertical Scaling Block Diagram
VSCALE[12:0]
VTG_HRESET_N
VS_INTRLACE
VTG_FIELD
VBLANK0
VTG_AFD[3:2]
VFILT[2:0]
HSC_SKIP
LUMA_HSC[9:0]
CBCR_HSC9:0]
HSC_CBFLAG
CDP_DBLINE
VTG_VRESET_N
VTG_VACTIVE
HSC_HACTIVE
VSKIP
Phase
Generator
Line Store
and
SECAM
Dr/Db Line
Store
PHASE[2:0]
PA L
SECAM
CL_LUMA[9:0]
PL_LUMA9:0]
CL_CHROMA[9:0]
PL_CHROMA[9:0]
Chroma
Coefficient
Generator
Luma
Coefficient
Generator
CCLC[7:0]
CPLC[7:0]
YCLC[7:0]
YPLC[7:0]
Luma/Chroma
Interpolation
Filter and
PAL Line
Averaging
LUMA_VSC[9:0]
CBCR_VSC[9:0]
VSC_VALID
VSC_FIELD
VSC_CBFLAG
VSC_HRESET
VSC_VRESET
VSC_HACTIVE
VSC_VACTIVE
102284_012
Valid video data does not start until line 21 for NTSC and line 33 for PAL/SECAM. In
autoconfiguration mode, the default value for the vertical blanking delay, VBLANK
(0x474 an 0x475) is set to 22 and 34, respectively, for each video standard. This
register value, VBLANK, represents the number of half lines between the trailing
edge of a vertical reset (after the first nine lines, which contain equalization and
serration pulses) and the start of active video, while the VACTIVE (0x475 and 0x476)
registers represents the number of half lines in the vertical active region that enter the
vertical scaler.
As in the horizontal scaler, the two factors that determine the scaling process are the
number of active lines going into the vertical scaler and the number of desired lines
out of the scaler. The ratio of these two values determines the scaling ratio to be used
in the VSCALE formula below:
Vertical Scale Value (VSCALE) = (2
16
– (Scaling Ratio–1) x 29) & 0x1FFF
NOTE:
Only the 13 LSBs are used (& = logical AND).
Thus, the vertical scaling ratio is determined by VACTIVE, the number of half lines
coming into the scaler and desired number of half lines output from the scaler. For
example, to achieve vertical scaling of an NTSC BT.656 full-resolution (487 active
half lines) image down to a half-resolution (244 active pixel) image, the scaling ratio
would simply be 2, Scaling Ratio = 487/244. Using this value in the vertical scaling
equation yields a value of VSCALE = 2
16
– 29 (0x1E00). For 4:1 vertical scaling, the
scale factor would be 4, Scaling Ratio = 487/122. Thus, the VSCALE register (0x41C
16
and 0x41D) value must be set to 2
102284BConexant3-37
Production Data Sheet
8/3/05
– 3 x 29, 0x1A00.
Page 64
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
For square pixel scaling, the same calculation is involved, except in this case, fullresolution has 480 active lines for NTSC and 576 active lines for PAL and SECAM.
The scaling ratios and the VSCALE values are the same as in the BT.656 calculations
(see Table 3 -2 4).
There are two modes to the vertical scaler: interlaced and noninterlaced vertical
scaling. In interlaced mode, the two fields are treated as part of a whole image to be
displayed. Since the lines are interlaced, the scaling coefficients are set to reflect this
by resetting the coefficients to 0 and VSCALE/2 to generate that offset. In
noninterlaced mode, each field is treated independently and the scaling coefficients
are always reset to 0. Control of these modes is accomplished through the
VS_INTRLACE bit in the Vertical Scaling Control (0x41E) register.
3.5.3Interpolation Filter and PAL Line Averaging
A multitap, polyphase filter is provided for vertical scaling of both luma and chroma
data. The number of vertical taps is programmed by the user through the VFILT bits in
the Vertical Scaling Control (0x41E) register. Care should be taken when selecting the
number of taps for the vertical filter. The user may select 2, 3, 4, or 5 taps. The
number of taps must be chosen in conjunction with the horizontal scale factor to
ensure that the needed data can fit in the internal line-store memory.
The line-store contains enough memory for 768 active pixels per line. When
horizontally scaling, not all of the line-store memory needs to be used. This left-over
memory can be used to store up to three additional lines of data, for a total of five
lines worth. The amount of excess memory is determined by the horizontal scaling
ratio. When there is no horizontal scaling, the line-store can hold one line, and provide
for 2-tap filtering. When a horizontal ratio of 2:1 or greater is used, the line-store can
hold two lines, allowing 3-tap filtering. When a horizontal ratio of 3:1 or greater is
used, the line-store can hold three lines, allowing a 4-tap filtering.
Finally, when a horizontal ratio of 4:1 or greater is used, the line-store can hold four
lines, allowing 5-tap filtering. Figure 3-12 illustrates this selection. Ta ble 3 -2 5 defines
the vertical scaler tap selection.
Figure 3-12. Interpolation Filter Tap Selection Diagram
HSC_SKIP
CLC
CL[9:0]
IFMult
PL[9:0]
PLC
VFILT[1:0]
3-38Conexant102284B
Production Data Sheet
PCLK_EN PCLK_EN PCLK_EN
EEE
2'b11
2'b10
2'b01
IF[9:0]
2'b00
102284_013
8/3/05
Page 65
CX25840/1/2/3 Data SheetDetailed Functional Description
Table 3-25. Vertical Scaler Tap Selection
ResolutionVFILT[2:0] BitsDescription
Full Resolution and Below0002-Tap Interpolation
½ Resolution (less than 384 active pixels per line) or below0013-Tap Interpolation
¼ Resolution (less than 193 active pixels per line) or below0104-Tap Interpolation
1/8 Resolution0115-Tap Interpolation
Two other functions take advantage of the line-store memory. There is line averaging
in PAL mode and Dr/Db line-storage in SECAM mode. In SECAM mode, Dr/Db
values are passed through the chroma channel on alternating lines, thus a line-store is
necessary so that Cr/Cb pairs can be obtained from combining the demodulated Dr/
Db values.
In PAL mode, line averaging is done to enhance the color accuracy by averaging the
chroma values of adjacent lines. The PAL line averaging and vertical scaling are done
in the same filter. The coefficient generator for the chroma module has an input that
indicates PAL operation and sets the coefficients to the 50 percent point. Line
averaging can be disabled for sharper vertical transitions by setting the
LINE_AVG_DIS bit in the Vertical Line Control register (0x41F).
3.5.4Chrominance Interpolation Filter and Resampling
A 4-tap, 64-phase chroma interpolation filter is applied to YCbCr 4:4:4 chroma data.
The output of the filter is offset by 512 (for 10-bit chroma data) and passed to the
chroma resampling block. The chroma input to the scaler block is in 4:4:4 YCbCr
format and is downsampled to 4:2:2 YCbCr after the data has been scaled. The
resampling at half the rate can be done without a downsample filter because Cr and
Cb signals are typically limited to approximately 1.3 MHz.
3.5.5Image Cropping
Cropping enables the user to output any subsection of the video image. The
HACTIVE and VACTIVE values can be programmed to start and stop at any position
on the video frame, as illustrated in Figure 3-13. The start of the active area in the
vertical direction is referenced to vertical reset, (the beginning of a new field). In the
horizontal direction, it is referenced to horizontal reset (the beginning of a new line).
The dimensions of the active video region are defined by HBLANK, HACTIVE,
VBLANK, and VACTIVE. The vertical and horizontal blanking delay values
determine the position of the cropped image within a frame, while the horizontal and
vertical active values set the pixel dimensions of the cropped image.
102284BConexant3-39
Production Data Sheet
8/3/05
Page 66
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Figure 3-13. Effect of the Cropping and Active Registers
Video frame
VDELAY
VACTIVE
Rising Edge of VRESET
Video frame
VDELAY
Cropped image
HACTIVEHDELAY
VACTIVE
HACTIVEHDELAY
3-40Conexant102284B
Production Data Sheet
Cropped image
scaled to
1/2 size
Falling Edge of HRESET
102284_014
8/3/05
Page 67
CX25840/1/2/3 Data SheetDetailed Functional Description
3.5.6Horizontal Cropping
To horizontally crop an image, the values of HBLANK (0x470 and 0x471) and
HACTIVE (0x471 and 0x472) are adjusted. To maintain proper image location, the
cropped values of HBLANK and HACTIVE should sum to less than or equal to the
value of HBLANK + HACTIVE without cropping. To crop the left side of an image,
increase HBLANK by the number of pixels desired. To crop the right side of the
image, decrease HACTIVE by the number of pixels desired.
3.5.7Vertical Cropping
To vertically crop an image, the values of VBLANK (0x474 and 0x475) and
VACTIVE (0x475 and 0x476) are adjusted. To maintain proper image location, the
cropped value of VACTIVE plus (VDELAY) should be less than or equal to the value
without cropping.
The units of VBLANK and VACTIVE are half lines. To crop the top of the image,
increase VBLANK by the number of desired lines multiplied by two. To crop the
bottom of the image, decrease VACTIVE by the number of desired lines multiplied by
two.
3.5.8Scaling and Cropping Effects on SPI
The decoder has the following external timing signals available, which are affected by
scaling and cropping as described below:
Vertical Sync: Not affected by scaling or cropping
Horizontal Sync: Occurs at the beginning of each line and is not affected by
horizontal scaling
Vertical Active: This signal is used to determine when the analog active video is
valid. When vertical scaling occurs, this signal goes to its inactive state for the
lines that should not be stored into the video memory. When image cropping is
taking place, the length of Vertical Active is adjusted to provide fewer lines per
field.
Horizontal Active: This signal is used to determine when the analog active video is
valid. Since horizontal video is always scaled, Horizontal Active contains more
clocks than the pixels programmed into the Horizontal Active register. This signal
is affected by the value programmed into the scaling register. When image
cropping is taking place, the length of Horizontal Active is adjusted to provide
fewer valid pixels per line.
Valid Pixel Indicator: To determine which clocks are valid for storage into a video
buffer, the Valid Pixel signal is high for valid pixels and low for invalid pixels. The
Valid Pixel Indicator toggles throughout the entire line time to include blanking
and synchronizing intervals even with cropping. This signal is affected by the
value programmed into the scaling register.
Odd/Even Field Indicator: Not affected by scaling or cropping
Cb/Cr Indicator: Informs the user whether the pixel is Cb or Cr. When invalid
pixels are encountered, the Cr, Cb order is therefore maintained from valid pixel to
valid pixel, as flagged by this signal pin. This signal is affected by the value
programmed into the scaling register.
102284BConexant3-41
Production Data Sheet
8/3/05
Page 68
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.6VBI Data Slicer
3.6.1VBI Data Slicer Overview
The output of the SRC stage bypasses the Y/C separation block and passes data to the
VBI slicer block. Once in the VBI slicer, the ADC data can be VBI sliced or output
directly to the video output formatter in a raw mode.
From the SRC, the ADC samples are passed to the VBI block at the pixel rate, where
the data is upsampled to 2x the pixel rate. Here, the data is oversampled at a 4x rate
and then filtered with a –5.54 MHz to 5.54 MHz bandpass filter to reduce
quantization noise. Filtered data is then passed through the data bit slicer—which
detects VBI data according to the format for each standard. Finally, the data goes to a
FIFO for output on the 656 interface or can be read from the VBI data registers.
Note that the parameters described in this section can be manually controlled through
custom modes, but they are configured automatically in the autoconfiguration modes.
3.6.2VBI Standards Supported
The VBI block is capable of slicing the world’s VBI data standards. All sliced data can
be inserted into the BT.656 or VIP video streams as an ancillary data stream. The
BT.1364 specification discusses the specific formatting of ancillary data. The
following VBI standards are available as ancillary data in BT.656 and VIP modes:
including the Copy Generation Management System (CGMS)
Gemstar1x
Gemstar2x
The following VBI standards are available as ancillary data on BT.656 mode only:
World System Teletext (ITU-R BT.653)
North American Basic Teletext Spec. (NABTS EIA-516)
Video Programming System using Enhanced Teletext Standard (VPS ETS-300-
231)
VITC/SMPTE (ITU-R BT.1366)
Moji (ARIB STD-B5)
Where applicable, both 625-line and 525-line versions are supported.
3-42Conexant102284B
Production Data Sheet
8/3/05
Page 69
CX25840/1/2/3 Data SheetDetailed Functional Description
3.6.3VBI Waveform Description
A detailed description of the incoming waveform will help to better understand the
VBI function blocks. The model that is being used for the VBI block implementation
is based on four basic input data formats: Closed Caption (CC), Wide Screen
Signaling (WSS), Teletext (TTX), and VITC. All other signaling standards should fit
into the format of these signals.
Figure 3-14 depicts a Closed Caption waveform. The main purpose of this figure is to
illustrate the various signaling formats and how the various sections of the signal play
a part into the VBI engine. The VBI engine starts when one of the following three
events occurs: a vertical reset, time-out of data run-in, or the end of the previous line’s
data capture mode.
There are exceptions to the typical VBI waveform shown in Figure 3-14. For example,
VBI standards such as WSS525, VITC525, and VITC625 do not have clock run-in
periods. Another VBI standard that differs from the example given is the WSS625
VBI standard. It is a biphase modulated signal.
Figure 3-14. Typical VBI Waveform
Slice Level
HDELAY
COLOR
BURST
Clock Run-inData CaptureStar t/Frame
Code
S
T
A
R
T
D0-D6D0-D6
P
A
R
I
T
Y
P
A
R
I
T
Y
102284_016
102284BConexant3-43
Production Data Sheet
8/3/05
Page 70
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.6.4VBI Data Output
Low bit-rate VBI standards can be read back from the memory-mapped registers that
are accessible by either the two-wire serial communication or VIP host port. The VBI
data registers, which contain data for both even and odd fields, are updated every
frame during the vertical blanking interval after capturing and decoding the data. The
data standards available through the memory-mapped registers are the following:
including the Copy Generation Management System (CGMS)
Gemstar1x
Gemstar2x
There are four payload data FIFOs for Closed Caption, Gemstar 1x, Gemstar 2x, and
WSS standards. The CC and Gemstar 1x FIFOs are 10 bytes deep, the Gemstar 2x are
20 bytes deep, and the WSS FIFO are 6 bytes deep. By reading the Closed Caption
Data (0x445), Gemstar 1x Data (0x447), Gemstar 2x Data (0x449) and WSS Data
(0x44B) registers, the user can access the FIFOs for each of these standards.
After the data is read, the data FIFO pointer is automatically incremented to the next
byte of information. With each data byte loaded to a register for reading, a status byte
is updated accordingly. The status byte indicates whether a parity error has occurred
for CC, Gemstar 1x, Gemstar 2x. It also indicates if the byte was captured from the
odd or even field (CC or XDS), and the byte number. Two bits indicating FIFO
overflow or empty are also included in the status byte.
Both high bit-rate and low bit-rate sliced data can be inserted in the video output
stream during horizontal blanking intervals (areas labeled A in Figure 3-15) as
ancillary data. The VBI slicer uses a FIFO and related control signals to pass the data
to the video output formatter for insertion. Ancillary data insertion is enabled by
setting high the ANC_DATA_EN bit in the Video Out Control 1 (0x404) register.
3-44Conexant102284B
Production Data Sheet
8/3/05
Page 71
CX25840/1/2/3 Data SheetDetailed Functional Description
Figure 3-15. Blanking Regions
(1)(1)
H = 1
FF 00 00 XYFF 00 00 XY
(2)(3)
EAVSAVAB
(6)(6)(6)(6)
V = 1V = 0V = 1V = 0
(3)
AField 0
H = 0
(4)
(5)
FOOTNOTES:
(1) H = Horizontal
(2) EAV = End of active video
(3) A = Ancillary data
(4) SAV = Start of active video
(5) B = Blanking
(6) V = Vertical
(3)
AB
(3)
AField 1
(5)
102284_015
102284BConexant3-45
Production Data Sheet
8/3/05
Page 72
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.6.5Preprogrammed VBI Standards
The VBI slicer block can operate in a predefined/autoconfiguration mode or in a user
defined custom mode. The VBI slicer provides access to 34 VBI lines in one frame of
video; 17 lines are provided per odd and even field. The VBI decoder block can be
assigned a VBI standard to be sliced on a line-by-line basis. Each VBI line can be
individually programmed to use either the predefined autoconfiguration VBI settings
or the user programmable custom settings.
There are eight preprogrammed settings of VBI decoding for 525-line mode and
six preprogrammed settings for the 625-line mode. Each line, in either odd or even
field, can be decoded for each of the modes listed in by programming the VBI Line
Control 1 to VBI Line Control 17 (0x424 to 0x434) registers. The VBI block can
decode any combination of the available 34 lines of VBI information and output the
information to the memory mapped data registers or through the BT.656/VIP data
stream. Due to the higher bit-rates of Teletext, this data is only available as ancillary
data within the BT.656/VIP stream.
There are a total of five configuration registers consisting of 17 total lines; each
fieldname in the configuration register is defined as an odd and even line. The
decoding of each line is defined by an 8-bit register value programmed by the user
through the VBI Line Control [1:17] registers. Available preprogrammed VBI slice
standards are listed in Table 3-26.
Table 3-26. Available Preprogrammed VBI Slice Standards
525 Line Modes
VBI Line Control Value
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
No VBI Data Slicing
WST525-B
WST525-C (NABTS)
WST525-D (Moji)
WSS525
VITC525
CC525
Gemstar 1x
Gemstar 2x
RESERVED
Custom VBI 1
Custom VBI 2
Custom VBI 3
625 Line Modes
VBI Line Control Value
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
No VBI Data Slicing
WST625-B
WST625-A
RESERVED
WSS625
VITC625
CC625
RESERVED
RESERVED
VPS
Custom VBI 1
Custom VBI 2
Custom VBI 3
3-46Conexant102284B
Production Data Sheet
8/3/05
Page 73
CX25840/1/2/3 Data SheetDetailed Functional Description
For each control register, the fieldname is defined as an 8-bit value with the most
significant nibble of the fieldname used to indicate the odd field and the least
significant nibble used define the even field. To program the VBI engine to decode a
specific standard or a particular line, both the odd and the even registers of the
fieldname must be programmed to decode that set standard.
For example, upon reset, VBI_LINE_CONTROL4 (0x427) register is set to a default
value of 0x00b or “No VBI data slicing” on line 4 for odd or even field. However, if
the user wished to decode line 4 from the odd video field with WST525 and the even
video field of line 4 with Gemstar 1x, then VBI_LINE_CONTROL4 would need to be
programmed as 0x47. For a complete list of options, refer to the description of the
various VBI registers in Section 5 of this document.
3.6.6Custom Data Transmission of VBI Data
The VBI decoding block also provides the flexibility for the user to define each
parameter through various registers and fieldnames. Once programmed, the decoder
extracts the VBI information from the video stream and outputs the decoded data to
the video output formatter (VOF) block or to the memory-mapped registers. To
initiate custom program mode, the control register, VBI Line Control {1:17}, for a
particular line must be set to Custom VBIx mode.
Three programmable registers are available for customization and are autoconfigured
by default. These registers, VBI Custom{1:3} Horizontal Delay, VBI Custom{1:3}
Time-out, and VBI Custom{1:3} Increment, can be custom-configured individually to
support specif ic user-defined VBI requirements. In the default configuration, the VBI
Custom 1 registers are set to decode Closed Caption 525; VBI Custom 2 registers are
set to decode WSS625; and VBI Custom 3 registers are set to decode WST525,
System C.
Each of these registers can be custom-configured through the two-wire serial
communications port or VIP host interfaces. Refer to Section 5 for the Custom{1:3}
settings and their fieldnames. Each of these fieldname values is programmable and
allows the user to custom-modify the VBI decode engine. The other two custom
setting registers and fieldnames can be found in the register section.
3.6.7Miscellaneous VBI Configuration
Additionally, there are miscellaneous configuration registers, VBI Miscellaneous
Config 1, TTX Packet Address {1:3} (0x43C to 0x43F), used to customize Teletext
decoding and reset the VBI FIFOs for Gemstar 1x/2x, WSS, and CC. In the case of
Teletext decoding, the upper and lower limits of the Teletext packet information can
be specified through these registers and fieldnames, as well as the programming of
alternative framing packets. Furthermore, the registers can be programmed to enable
hamming comparison.
Alternatively, the miscellaneous configuration registers can also be used for
modifying the parameters in the predefined or autoconfiguration modes. A different
frame code can be substituted for the autoconfiguration mode with little user effort.
For example, modifying the VBI Alternate Frame Code Type (0x439) register, bits
FC_ALT1_TYPE, with the same code as the VBIMODE, does this.
102284BConexant3-47
Production Data Sheet
8/3/05
Page 74
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.6.8VBI Controller
Control of the VBI engine is through a state machine, which monitors the incoming
video and nonvideo data and initiates the VBI decoding process based on user defined
parameters of HDELAY, CRILK, FCBIT, and VBx_BYTE_COUNT. Other inputs to
the VBI state machine are from the Vertical Timing Generator (VTG), which outputs
both the vertical and horizontal reset. See Ta ble 3 -1 4 in Section 3.6.3. The CC
waveform consists of four major sections: hdelay, clock run-in, data run-in, (start/
frame code) and data payload (data capture).
Through the state machine, the VBI engine starts when either one of three conditions
occurs: vertical reset, a time-out of data run-in, or at the end of the previous line’s data
capture mode. When a horizontal reset occurs, the VBI engine goes into BREEZE
state for HDELAY clock cycles. Once HDELAY counter expires, it goes into a Clock
run-in state (CRILK) for the number of programmed clock run-in cycles to be
captured. It then switches to data run-in state (FCBIT). The VBI engine stays in this
state for FCBIT to capture the start bits, or the framing code in case of the Teletext
format. Then it switches to Data Capture mode to capture as many bits or bytes
specified by VBIx_CAP_COUNT. Note that the parameters described here can be
manually controlled through the custom modes, but they are configured automatically
in the autoconfiguration modes.
A discrete time oscillator determines the sample rate and positioning of the sample
points for each of the various VBI standards. A 14-bit counter, incremented by
VBIx_BITINC with each VBI clock, generates a pulse to mark each sample point.
This is used to measure sample periods as the state machine sequences through the
different stages of the VBI waveform.
3.6.9Clock Run-In Synchronization
During the clock run-in cycles, the logic performs three functions:
1. Measures the Slice Level
2. Synchronizes the slice timing to the clock run-in edges
3. Determines whether the clock run-in cycle has the expected frequency.
The slice level detector determines the “slice level” used to distinguish between a
logical 1 or 0 data sample. At the start of the clock run-in signal, an initial assumption
of 1.75 x the back-porch level is made for the initial slice level. This number is used as
a seed to the slice level calculation engine. Samples are taken at VBIx_SLCNT clocks
apart. Starting with the first zero crossing of the clock run-in, four samples are taken,
and the average of those samples is data and data run-in slice level.
During clock run-in, the logic detects the number of clock run-in cycles specified by
VBIx_CRILK. These clocks are detected in terms of rising edges on the input
waveform. At the end of this search, frequency lock is declared if the elapsed time lies
within the range specified by the VBIx_CKRGH and VBIx_CKRGL registers. These
registers specify time in terms of the VBI sample rate period. The DTO that is
controlled by the VBIx_BITINC parameter is used to count the sample periods. In
other words, the logic determines whether a defined number of clock run-in cycles
(VBIx_CRILK) elapsed in the expected time (VBIx_CKRGH and VBIx_CKRGL).
If frequency lock is determined, the sample period DTO is synchronized one more
time to the last negative edge of the clock run-in cycles. In the absence of frequency
lock, the state machine is reset to idle and waits for the next line.
3-48Conexant102284B
Production Data Sheet
8/3/05
Page 75
CX25840/1/2/3 Data SheetDetailed Functional Description
3.6.10VBI Special Cases
There are some exceptions to the typical example of the CC VBI, as follows:
For WSS525, VITC 525, and VITC625 VBIx_SKIP_DRI should be set to 1. This
implies that only one clock run-in cycle is detected, and the data run-in stage
should be skipped. Instantly, the VBI state machine switches to data capture
mode.
WSS625 uses biphase modulation, where the VBI engine groups the decoded bits
into a 24-bit words, which are sent to the Output Formatter block. The detected
bits are decoded into a 1 or 0 bit, depending if 111000 or 000111, respectively.
For Teletext, if Hamming checks are enabled through VBIx_HAM_EN, bits 3
through 0 of the framing code are used to match the odd bits of a byte detected in
transmission order. The packet address range is also checked, and if it is not valid,
the captured data is not stored into the FIFO.
3.6.11Raw Mode VBI
In raw mode, data samples are sent through the VBI slicer without any processing
directly to the video output formatter. Raw VBI data is passed directly from the SRC
output to the output formatter during the active video region of the VBI lines for
decoding and or processing by an external processor or software. Within the VBI
block, the raw ADC samples are converted to a decoder sample rate of 2x
oversampled VBI samples of 2 bytes each. Raw mode VBI is enabled by setting the
VBIHACTRAW_EN bit high in the Video Out Control 1 (0x404) register. The order
of the raw samples presented on the 8 VID_DATA pins is configurable through the
SWAPRAW bit in the Video Out Control 2 (0x405) register.
102284BConexant3-49
Production Data Sheet
8/3/05
Page 76
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.7Video Output Formatting
The Video Output Formatter (VOF) module is at the end of the data processing
pipeline. It is responsible for formatting the 10-bit luma and 10-bit chroma data into
one of the following video output stream formats:
Synchronous Pixel Interface (SPI) mode where the video is SPI-coded, 4:2:2
subsampled, and timing information is provided through separate sync signals
ITU-R BT.656 mode where timing control codes are embedded within the data
stream
VIP1.1 and VIP2 modes, both a super set of ITU-R BT.656 that supports advanced
features such as square pixel sample rates and scaled video. VIP1.1 and VIP2 are
very similar, with minor differences in control code formatting.
3.7.1Output Format Options
The OUT_MODE bits in the Video Out Control 1 register (0x404) select which of the
video output formats to enable. Also, the video data in the output stream can be
represented as either 8-bits or 10-bits wide depending on the setting of the MODE10B
bit in the same register. In 8-bit mode, the internal 10-bit video data is rounded to 8
bits and presented on the upper most significant bits of the VID_DATA pins. The
VOF is also responsible for inserting sliced and raw VBI data into the pixel stream
embedded as ancillary data. Figure 3-16 shows the various output formats along with
ancillary data.
Figure 3-16. Output Stream Formats
OUT_MODE[1:0]
1. SPI 00 -
2. 656 01 0
3. 656 01 1
4. VIP 1- 0
5. VIP 1- 1
Horizontal
Active
ANC_DATA-EN
CbCrYCbCbCrYY
CbCrYY
CbCrYY
CbCrYY
CbCrYY
In the VBI, this is
Raw Data when
VBIHACTRAW_EN = 1.
YCrYY CbCrYY CbCrYY CbCrYY CbCrYY CbCrYY
10.0h 80.0h 10.0h 80.0h 10.0h 80.0h
3FF 000 000
EAV
3FF3FF 3FF DIDDCSDID000 0000003FFCS000 000 XY
EAVSAV
3FF 000 000
EAVSAV
3FF3FF DIDDCSDID3FF000 000000
EAV
80.0h
XY
00.0h 00.0h 00.0h 00.0h 00.0h 00.0h 00.0h 00.0h
RP
RP
10.0h 80.0h 10.0h 80.0h80.0h10.0h
UDW0 UDW1 UDW2 UDW3 UDW4UDWn
Ancillary Data
00.0h 00.0h 00.0h 00.0h 00.0h00.0h 00.0h
UDW0 UDW1 UDW2UDWnIDID1
IDID0
Ancillary DataSAV
...
...
...
80.0h 10.0h
80.0h 10.0h
00.0h 00.0h
3FF 000 000 XY
SAV
3FF 000 000 RP
3FF 000 000 RP
Cb...
CrYY
CbCrYY
CbCrYY
CbCSCrYY
In the VBI, this is
Raw Data when
VBIHACTRAW_EN = 1.
102284_009
3-50Conexant102284B
Production Data Sheet
8/3/05
Page 77
CX25840/1/2/3 Data SheetDetailed Functional Description
3.7.2Synchronous Pixel Interface Mode
In the Synchronous Pixel Interface (SPI) mode, the device outputs all pixels
synchronous with PIXCLK, both horizontal and vertical blanking interval pixels and
active pixels. Unlike the BT.656 or VIP output modes where timing control codes are
embedded in the digital data stream, SPI video timing information is conveyed
through the following external synchronization signals, available on separate output
pins:
Vertical Sync
Horizontal Sync
Ve r t i c a l A c t iv e
Horizontal Active
Valid Pixel Indicator
Odd/Even Field Indicator
Cb/Cr Indicator
The polarity of each of these signals is independently selectable using the POLAR bit
in the Video Out Control 4 register (0x407).
Figure 3-17 illustrates the relationship of the external timing signals over fields.
Figure 3-18 illustrates the relationship of Horizontal Reset and the active portion of
the line. Figure 3-19 illustrates the operation of the VALID and CBFLAG indicators.
The VOF also provides the pixel clock output, PIXCLK, which can be inverted using
the CLK_INVERT register bit. The pixel clock output can be set to run continuously
or to be gated by either the VALID pixel indicator or by the logical AND of the
VALID pixel indicator with ACTIVE indicator. The clock-gating scheme is selected
using the CLK_GATING bits of the Video Out Control 2 register (0x405). Note that
the ACTIVE indicator in the same register can be set to represent either compositeactive-vertical and horizontal-active, or simply horizontal-active. The VALID
indicator can similarly be configured to represent either nonscaled pixels or represent
the logical AND of the VALID indicator and the ACTIVE video indicator. This is
controlled by the VALIDFMT bit in the same Video Out Control 2 register (0x405).
102284BConexant3-51
Production Data Sheet
8/3/05
Page 78
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Figure 3-17. SPI Mode External Field Timing Signals
Beginning of Fields 1, 3, 5, 7
HRESET
(1)
VRESET
FIELD
ACTIVE
2–6 Scan LinesVDELAY/2 Scan Lines
Beginning of Fields 2, 4, 6, 8
HRESET
VRESET
FIELD
ACTIVE
2–6 Scan LinesVDELAY/2 Scan Lines
GENERAL NOTES:
1. ACTIVE pin may be programmed to be composite ACTIVE or horizontal ACTIVE.
2. ACTIVE, HRESET, VRESET, and FIELD are shown here with their default polarity. the polarity is programmable via the
VPOLE register.
3. FIELD translations with the end of horizontal active video defined by HDELAY and HACTIVE.
FOOTNOTE:
(1)
HRESET Precedes VRESET by two clock cycles at the beginning of fields 1, 3, 5, and 7 to facilitate external field generation.
102284_051
3-52Conexant102284B
Production Data Sheet
8/3/05
Page 79
CX25840/1/2/3 Data SheetDetailed Functional Description
Figure 3-18. SPI Mode External Line Timing Signals
64 Clock Cycles
HRESET
HDELAY Clock Cycles
ACTIVE
HACTIVE Clock Cycles
102284_052
Figure 3-19. SPI Mode VALID and CBFLAG Indicators
VID_DATA[9:0]
DVALID
ACTIVE
PIXCLK
CBFLAG
102284_032
102284BConexant3-53
Production Data Sheet
8/3/05
Page 80
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.7.3Control Codes
For the BT.656 and VIP modes, Start of Active Video (SAV) and End of Active Video
(EAV) control codes are inserted into the output video stream. The 8-bit SAV/EAV
codes are comprised of four timing reference bits: Task (T), Field ID (F), Vertical
Blanking (V), and Horizontal Blanking (H). The T, F, and V bits only change during
EAV codes. The remaining four bits are Hamming-coded error protection and
correction bits in BT.656 mode or 0x0 in VIP modes. If 10-bit output mode is enabled,
0s are appended as LSBs to the end of the SAV/EAV codes.
The value of the task (T) bit depends on the output mode. In BT.656 mode, the T bit is
1. For VIP 2 mode, the T bit is determined by the TASKBIT_VAL bit in the Video Out
Control register (0x404). In VIP 1.1 mode, the T bit is 0 during the vertical blanking
interval if raw data is being substituted and is 1 otherwise.
The value of the field ID (F) bit toggles in the EAV code after an “end-of-field” signal
from the video timing generator is asserted.
The value of the vertical blanking (V) bit switches to 1 in the EAV code when the end
of vertical active is detected. The time at which the V bit switches to 0 in the EAV
code is dependant on whether the output formatter is in VIP or BT.656 mode. In VIP
mode, the line at which the V bit switches to 0 is determined by the Vertical Blanking
Delay registers (0x474 an 0x475). In BT.656 mode, the line at which the V bit
switches to 0 is determined by the Vertical 656 Blanking Delay register (0x477). The
values programmed into these registers must represent the number of half-lines after a
vertical reset. When the VIP_OPT_AL bit is set high in the Video Out Control 3
register (0x406), this forces the V bit to switch to 0 in the EAV code after the Vertical
656 Blanking Delay time when in VIP output mode.
The value of the horizontal blanking (H) bit is 0 in an SAV and 1 in an EAV.
In BT.656 or VIP modes, the video output formatter can limit the 8 MSBs of luma and
chroma samples to the range 1–254. This is done to ensure the upper eight bits do not
contain 0x00 or 0xFF, which are used in these modes to indicate the presence of
control codes. This is accomplished by setting the VIPCLAMP_EN bit of the Video
Out Control 3 register (0x406) high. Also, when VIPBLANK_EN is set high, the
output formatter will blank (Y=16, Cb and Cr=128) the luma and chroma samples for
the following conditions.
During the horizontal blanking interval (i.e., between EAV and SAV)
When V bit is 1 between SAV and EAV (if VBIHACTRAW_EN is not set)
3-54Conexant102284B
Production Data Sheet
8/3/05
Page 81
CX25840/1/2/3 Data SheetDetailed Functional Description
3.7.4Ancillary Data Insertion
Sliced vertical blanking data can be inserted into the pixel stream output during the
horizontal blanking interval as ancillary data. The ancillary data will be prepended by
the appropriate control codes for the output format that is enabled, BT.656 or VIP.
Table 3 -2 7 is an example of 10 bytes of ancillary data, along with the control codes
and headers that are used for each of the formats.
Key:
n: not e
e: even parity of remaining bits
dt: data type of ancillary data (sent from VBI slicer)
UDW0UDW0UDW0IDID0IDID0IDID0
UDW2UDW2UDW2UDW0UDW0UDW0
UDW3UDW3UDW3UDW1UDW1UDW1
UDW5UDW5UDW5UDW3UDW3UDW3
UDW6UDW6UDW6UDW4UDW4UDW4
UDW8UDW8UDW8UDW6UDW6UDW6
UDW9UDW9UDW9UDW7UDW7UDW7
Fill ByteCSCSUDW8UDW8UDW8
Fill Byte——UDW9UDW9UDW9
n,e,00 0011n,e,00 1010n,e,00 0011 00
ChecksumCSChecksum
The ancillary data insertion can be enabled by setting high the ANC_DATA_EN bit of
the Video Out Control 1 register (0x404). For the VIP modes, the IDID0 and IDID1
values that are embedded within the stream can be customized by programming the
Ancillary IDID0 and IDID1 registers (0x408 to 0x40A) with the desired value.
102284BConexant3-55
Production Data Sheet
8/3/05
Page 82
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
Alternatively, the VBI slicer line count can be used as the IDID0 bytes by setting the
IDID0_SOURCE bit high in the Video Out Control 3 register (0x406). The data count
(DC) byte can be configured to represent either 4-byte blocks of UDWs—with byte
padding to remain DWORD aligned or the actual number of UDWs. This option is
selected through the DCMODE bit of the Video Out Control 3 register (0x406).
In addition to providing sliced VBI data as ancillary packets, raw VBI sample data can
be substituted into the horizontal active region of the vertical blanking interval.
Figure 3-20 shows the ancillary region along with the raw VBI regions.
Figure 3-20. Ancillary Region and Raw VBI Regions
H = 1
FF 00 00 XYFF 00 00 XY
EAV
V = 1V = 1V = 0V = 0
This raw data is from the luma/composite output of the ADC after it has been samplerate converted to 13.5 MHz and 2x upsampled by the VBI decoder/slicer. Raw data
substitution is selected by setting the VBIHACTRAW_EN bit high in the Video Out
Control 1 (0x404) register. In the SPI mode, the raw data is substituted when
VACTIVE is 0 and HACTIVE is 1. In BT.656 or VIP modes, the raw data is
substituted between SAV and EAV codes when the V bit is 1.
By default, the even samples are placed where the chroma samples would occur, and
the odd samples are placed where the luma samples would occur. If the SWAPRAW
bit of the Video Out Control 2 (0x405) register is set high, odd raw samples are placed
where chroma samples would occur, and the even raw samples are placed where the
luma samples would occur.
Anc.
Available
AField 0
Anc.
Available
H = 0
SAVRaw VBI Available
Raw VBI Available
Field 1A
102284_010
3.7.5Blue Field Generation
The video output formatter also contains a blue field generator. This function replaces
the input luma and chroma samples with a field of blue pixels, Y=35, Cb=212,
Cr=114. The blue field generator can be set to automatically output these pixels’ value
when the video decoder determines that there is no lockable signal on the input. This
is configured by setting high the BLUE_FIELD_EN bit in the Video Out Control 1
(0x404) register. The blue field generation can be forced on by setting the
BLUE_FIELD_ACT bit in the same register, regardless of the state of the input video
waveform.
3-56Conexant102284B
Production Data Sheet
8/3/05
Page 83
CX25840/1/2/3 Data SheetDetailed Functional Description
3.8Infrared Remote Controller
3.8.1Architecture Overview
The Infrared Remote (IR) controller, shown in Figure 3-21, is a generic interface that
can be used to communicate with a wide variety of commercial infrared remote
control units. This interface provides modulation and demodulation logic, a set of
programmable pulse timers, and a set of FIFOs. Enough hardware support is provided
to off-load the microprocessor from performing individual bit modulation and
demodulation and data transmission and reception. However, individual infrared
protocols are not decoded or encoded by the hardware, such as Sharp ASK or
Universal Remote. Instead, this task is left to the device driver software that controls
the port. This division between hardware and software alleviates the microprocessor
from performing the time-consuming bit manipulation.
Figure 3-21. Infrared System Diagram
Microprocessor
Device-Driver
Serial Programming
Interface
CX2584x (3,2,1,0)
IRQ
IR Rx
IR Tx
IR Receiver
Module
IR Transmitter
Circuit
102284_017
102284BConexant3-57
Production Data Sheet
8/3/05
Page 84
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.8.2IR Receiver
The IR receiver block, shown in Figure 3-22, captures bits and timing information
from the IR receiver module. Data can either be in the form of a modulated or an
unmodulated signal. For modulated signals, the IR port contains a demodulator which
can be enabled. The demodulated signal is then used to start and stop a counter which
measures the width of the pulse. The frequency of the clock which drives the pulse
width counter can be varied, depending on the total duration of the longest pulse
which must be measured. Next the timing value from the pulse width counter is stored
to the receive FIFO, along with the level of the pulse just measured and a tag to
indicate the data is valid. When data stops being received, the input no longer
transitions, and the pulse width counter overflows. This overflow signals the end of
the transmission.
Figure 3-22. IR Receiver Block Diagram
2-Wire Serial
(SER_DAT, SER_CLK)
Bus
Serial Programming
Interface from
Microprocessor
CX2584x (3,2,1,0)
2-Wire Serial
Bus
Register
Access
IR Rx
FIFO
IR Rx
Capture
3.8.2.1Receive Data Demodulation
A modulated signal encodes 1s and 0s through the use of a carrier which either
transitions at a high frequency (compared to the rate of the incoming data stream), or
does not transition. In most circumstances, a high frequency transition, called a mark,
represents a logical 1, while the absence of any input signal transitions, called a space,
represents a logical 0. The IR port is programmable such that both a mark and a space
can represent either a 0 or a 1. An unmodulated signal is simply represented by the
logic level received on the IR_RX/PRGM5 pin. As with modulated signals, the
polarity of an unmodulated signal is programmable and can be programmed for
inverse sense.
A programmable clock is used for all receive logic. The frequency ranges from
27 MHz down to 823.97 Hz. If the demodulation logic is used, this programmable
clock rate must be 16 times the frequency of the input carrier. All incoming data is
first synchronized to the IR port’s internal clock. This 16-bit Receive Clock Divider
bit field is used to control the IR port’s receive clock rate. The receive clock is used to
drive both the demodulation logic and the receive pulse width timer. The IR RX Clock
Divider (0x208 and 0x209) registers are used as the modulus for a 16-bit down
counter and is decremented at half the video clock rate (108 MHz/2). Each time the
counter reaches 0 or the IR RX Clock Divider registers are written, the contents of this
register are reloaded to the counter. Each time the counter wraps to 0, a receive clock
pulse is signaled to the demodulation logic and the RX pulse width timer. The IR RX
IR_Rx Pin
IR Receiver
Module
102284_018
3-58Conexant102284B
Production Data Sheet
8/3/05
Page 85
CX25840/1/2/3 Data SheetDetailed Functional Description
/
k
Clock Divider bit fields can be programmed with any value from 0x01 to 0xFFFF.
The RX clock rate, given a set Receive Clock Divider value, is calculated using the
equation below:
RxClkFreq
Next, the demodulation logic looks for rising edges on the input signal. Once a rising
edge is detected, the logic expects another rising edge every 16 RX clock cycles. To
compensate for jitter in the receive carrier, or if the carrier frequency is a noninteger
multiple of the RX clock, a programmable window function is implemented which
allows the next rising edge to fall within a range of 16 clock cycles plus or minus three
to four clocks. If the edge occurs within the programmed limits, the demodulator
passes the data to a persistence counter. The persistence counter ensures that the
receiver encounters four consecutive rising edges at the predicted time in order for a
mark to be output from the demodulator. Likewise, when the carrier burst stops, the
demodulator does not output a space until four time periods elapse and a rising edge
has not been detected. This filtering function makes the demodulator somewhat
resistant to noise if carrier transitions are occasionally missed. Marks and spaces are
then output to the low-pass filter.
3.8.2.2Low-Pass Filter
Ambient light can cause high-frequency noise to be picked up by infrared receivers.
To eliminate this noise, a low-pass filter is used. A programmable 16-bit down
counter measures the duration of each demodulated or raw unmodulated pulse which
is input to the receiver.
The 16-bit IR Low-Pass Filter (0x218 and 0x219) registers are used to prevent pulses
under a minimum width from being measured by the receive pulse counter. These
registers are used as the modulus for a 16-bit down counter that is decremented at half
the video clock rate (108 MHz/2). The counter reloads using the value programmed to
this register each time a qualified edge is detected as programmed through the EDG
bits in the IR Control 1 (0x200) register. Once the reload occurs, the counter begins
decrementing. If the next programmed edge occurs before the counter reaches 0, the
pulse measurement value is discarded, the filter modulus value is reloaded, and the
next pulse measurement begins. Thus, any pulse measurement that ends before the
counter reaches 0 is ignored.
For pulses that are greater than the minimum selected, the filter counter decrements to
0, and remains at 0 until the next qualified edge is encountered. Pulse measurements
are only stored to the RX FIFO when the filter counter reaches 0. The equation below
is used to calculate the minimum pulse width that can be measured, given the filter
register modulus value. To enable the filter, the IR Low-Pass Filter register can be
programmed with any value from 0x0004 to 0xFFFF (4 to 65535), which filters
pulses using the equation below for minimum allowable pulse duration. Values of
0x0001 through 0x0003 are not allowed. This register is reset to 0 (0x0000), which
disables the filter function.
2/108
)1(
+=erRxClkDivid
Re
asuredMinPulseMe=
vcl
102284BConexant3-59
Production Data Sheet
8/3/05
gValueterLowPassFil
2
Page 86
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.8.2.3Pulse Width Timer
The demodulated or nonmodulated raw data is then applied to an 18-bit pulse width
timer. The RX pulse width timer uses the same programmable clock used by the
demodulation logic to measure the duration between edge transitions on the incoming
demodulated signal. If the input signal is not modulated, meaning the RX clock does
not need to be 16 times the carrier frequency, it can be programmed such that the
longest symbol width does not cause the RX pulse width counter to overflow at the
given RX clock frequency. This allows each pulse to be measured at its greatest
resolution, using the full 18-bit range of the counter.
The IR port can be programmed to measure the time between rising edges, falling
edges, or both edge types. The pulse width timer starts when the first programmed
edge type is detected and stops when the next edge is detected. At this point, the most
significant 16 bits of the 18-bit timer value is transferred to bits 15–0 at the top of the
8-entry x 18-bit receive FIFO. The logic level of the pulse (as programmed by the
polarity bit) is stored in bit 16, and bit 17 is set in the next FIFO location to denote that
the next FIFO entry contains valid data. Next, the RX pulse width timer is cleared and
again begins to increment at the programmed clock rate to measure the width of the
next pulse.
When the demodulated input signal no longer transitions, the RX pulse width timer
overflows, which indicates the end of data transmission. When this occurs, the timer
value contains all 1s. This value can be stored to the RX FIFO, to indicate the end of
the transmission if the Rx FIFO load on Timer Overload disable is not set.
Additionally, a status bit is set which can interrupt the microprocessor, if it is enabled
within the IR port. The time duration of each pulse measured can be calculated using
the following equation (the multiplication by four takes place due to the use of the
most significant 16 bits of the pulse width timer):
ionPulseDurat
=
The RX FIFO load on Timer Overload Disable allows the user to choose whether to
store or not store Rx pulse with times overflows. Noise starts the Rx pulse width
Counter and can produce overloads when not desired as in a Com mode wakeup
operation.
tValueRxFIFOCoun
)4*(
qRxClockFre
3-60Conexant102284B
Production Data Sheet
8/3/05
Page 87
CX25840/1/2/3 Data SheetDetailed Functional Description
3.8.3IR Transmitter
The IR transmitter block, shown in Figure 3-23,accepts bits for transmission from the
microprocessor and is responsible for formatting the output data into a desired
transmission specification prior to placement into the TX FIFO buffer.
Figure 3-23. IR Transmitter Block Diagram
2-Wire Serial Bus
(SER_DAT, SER_CLK)
CX2584x (3,2,1,0)
2-Wire Serial
Bus
Register
Access
For IR transmission, pulse duration count values are calculated by the microprocessor
using the same equation,
Serial Programming
Interface from
Microprocessor
IR Tx
FIFO
IR Tx
Capture
ionPulseDurat
=
IR_Tx Pin
tValueTxFIFOCoun
IR Transmitter
Module
)4*(
qTxClockFre
and written to the transmit FIFO. The TX FIFO is 8 entries by 17 bits. Bits 15–0
contain the timer count value, and bit 16 contains the logic level that is to be output
during the duration of the pulse. These count values are taken from the bottom of the
FIFO one at a time and are loaded to the most significant 16 bits of the 18-bit TX
pulse width counter. The counter decrements using a separate TX clock which is
independent of the RX clock described above. Similarly, its frequency is
programmable with a range determined by the frequency of the host clock. If the
transmit modulation logic is enabled, this programmable clock rate must also be 16
times the frequency of the output carrier.
If the output is not modulated, a clock frequency can be selected such that the longest
pulse duration does not cause the 18-bit TX pulse width timer to overflow. Again, this
provides the best resolution for each pulse that is transmitted. Once a value is loaded
into the TX pulse width counter, the programmed logic level is either driven onto the
IR_TX/PRGM6 pin, if modulation is disabled, or is passed to the modulation logic, if
it is enabled. When the counter reaches 0, the next value is taken from the bottom of
the TX FIFO, and the whole process starts once again. When the counter reaches 0
and no more data is available within the TX FIFO, it is assumed that the end of the
data stream has been reached. At this point, the IR_TX/PRGM6 pin is forced to the
level which indicates a space, as programmed by the polarity bit.
102284_019
102284BConexant3-61
Production Data Sheet
8/3/05
Page 88
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.8.3.1Transmit Data Modulation
If modulation is enabled, marks are represented by bursts of high frequency carrier
transitions, and spaces are represented by the absence of carrier transitions. The duty
cycle of the high-frequency transitions is programmable. Again, if modulation is
enabled, the TX clock frequency must be 16 times the desired frequency of the carrier
transitions. This 16-bit IR Transmit Clock Divider bit field is used to control the IR
port’s transmit clock rate. The transmit clock is used to drive both the modulation
logic and the transmit pulse width timer. This bit field is used as the modulus for a 16bit down counter, which is decremented at half the video clock rate (108 MHz/2).
Each time the counter reaches 0 or the IR TX Clock Divider registers (0x204 and
0x205) are written, the contents of this register are reloaded to the counter. Each time
the counter wraps to 0, a transmit clock pulse is signaled to the modulation logic and
the TX pulse width timer.
If modulation is enabled, this field must be programmed such that the TX clock rate is
16 times the desired carrier frequency when a mark is transmitted. If modulation is
disabled, a clock frequency can be selected such that the longest pulse duration does
not cause the 18-bit TX pulse width timer to overflow. This provides the best
resolution for each pulse that is transmitted. The IR TX Clock Divider bit fields can
be programmed with any value from 0x01 to 0xFFFF. The Transmit Clock Divider is
reset to a value of 0xFFFF. The TX clock rate, given a set Transmit Clock Divider
value, is calculated using the following equation:
The period of one carrier transmitting is broken into 16 time periods. The duty cycle
register provides a selection of one of 16 different carrier duty cycles. The carrier can
be one TX clock period high and 15 low, two TX clock periods high and 14 low, and
so on. The 4-bit IR TX Carrier Duty Cycle (0x20C) register selects the duty cycle
(high time, then low time duration) of the transmit carrier when signaling a mark. The
TX carrier frequency is established by programming the IR TX Clock Divider
registers as described above. Again, the TX clock must be programmed to be 16 times
the desired frequency of the TX carrier. The IR TX Carrier Duty Cycle value then
selects one of 16 possible duty cycles: one TX clock high and 15 TX clocks low, or
two TX clocks high and 14 TX clocks low, etc. This bit field is ignored if modulation
is disabled.
3.8.4IR FIFOs
The IR FIFO (0x23C and 0x23D) registers provide access to the IR port’s transmit and
receive FIFOs. Writes to this register access the top of the transmit FIFO, allowing it
to be filled and count values to be transmitted. A write with a value of 0x0000 to the
Tx FIFO is effectively 0xFFFF+1, or maximum pulse width. Reads of this register
access the bottom of the receive FIFO, allowing incoming pulse width measurements
to be removed. The transmit FIFO is 17 bits wide x 8 entries deep. Bits 15–0 contain
the count value to be loaded to the TX pulse width counter, and bit 16 contains the
state which should be driven to the modulation logic. The receive FIFO is 18 bits wide
x 8 entries deep. Bits 15–0 contain the pulse width measurement from the RX pulse
width counter, bit 16 contains the state of the ir_in pin at the end of the measurement,
and bit 17 is a tag which indicates whether more valid data is present within the FIFO.
TxClkFreq
2/108
)1(
+=erTxClkDivid
3-62Conexant102284B
Production Data Sheet
8/3/05
Page 89
CX25840/1/2/3 Data SheetDetailed Functional Description
3.8.5IR Controls
General control of the IR functions is programmable through the IR Control 1 (0x200)
and IR Control 2 (0x201) registers. Features which are controlled using these registers
include the following:
RX FIFO load on timer overflow
Loopback operation
Carrier polarity
FIFO service request levels
Enabling/disabling of both the IR port’s transmitter and receiver
Enabling/disabling of the RX and TX FIFOs
Selection of carrier modulation and demodulation
Control of which type of edge to start and stop the pulse timer for demodulated
receive data
Control of a window which is used to predict when the next receive carrier
transition is expected
The user can either program the IR port’s six control registers, in any order, then write
to the transmit FIFO to start operation, or first place data in the transmit FIFO, while
the IR port is disabled, then configure the six control registers, programming this
register last to enable the IR port. When changing any configuration in these registers,
always disable the IR’s transmitter and receiver first, then reprogram the mode of
operation and enable the receiver and transmitter.
3.8.6IR Status and Interrupts
The IR Status (0x210) register contains six status bits, four that can interrupt the
microprocessor and two that can be polled. Bits 5, 4, 1, and 0 are set and cleared
automatically by hardware and signal when a hardware condition exists which must be
handled by software. Any one of these four status bits produces an interrupt when set
and its corresponding interrupt enable bit is set. Interrupt enable bits do not affect the
setting and clearing of status bits. The transmit and receive busy flags are also set and
cleared automatically by hardware, bits 2 and 3, but do not produce interrupts. They
are polled by software to query whether the IR port is currently transmitting and/or
receiving IR data. The Interrupt Enable Register (IR_IRQEN_REG) is programmed
to enable/disable the transmit and receive FIFO service requests to signal interrupts to
the interrupt controller. This register is read-only; writes have no effect.
The IR Interrupt Enable (0x214) register contains four bits which are used to mask or
enable individual interrupt requests. Refer to the above IR Status (0x210) register for
a description of each interrupt source. The interrupt enable bits do not effect the
setting and clearing of the interrupt status bits. Each enable bit is logically ANDed
with its corresponding status bit, and the resultant signals are all logically ORed to
produce a single interrupt request to the interrupt controller.
102284BConexant3-63
Production Data Sheet
8/3/05
Page 90
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.9Auxiliary PLL, Video-Locked Master Clock
In addition to the PLL dedicated for clocking the video decoder data path, a second
auxiliary PLL is provided for general-purpose use. The user can program the auxiliary
PLL for any reference frequency desired. One intended use is to use this PLL as an
audio master clock, or OSR (oversampled ratio) clock, to clock the audio DACs or
ADCs in the system. If so, an optional feature is provided to enable the locking of this
clock to the video pixel rate.
Many applications require synchronization between the video pixel rate and the audio
sample rate. This is particularly important for applications that compress audio and
video data into MPEG frames for subsequent playback. To support these applications,
the device provides an audio master clock that is locked to the video pixel rate. This
master clock can be divided down to generate the serial audio word clocks, bit clocks,
and the OSR clocks. In the context of the video decoder, a “locked” audio clock
means that there is a constant ratio between the number of video pixel clocks and
audio sample clocks. This ratio is defined as any integer number of audio clocks to
another integer number of video clocks. The EN_AV_LOCK bit in the Audio Lock 1
(0x12B) register controls the video-audio locking. Setting this register to 1 enables
video-audio locking. When the locking is not enabled, the PLL values pass straight
through the filter.
The audio clock is loosely coupled through a locking loop. Thus, for any given set of
audio samples, there are not necessarily a fixed number of video samples. However,
over the long term, the ratio will be maintained. Thus the sample-rate ratio is def ined
by defining two numbers that must equal each other over the long term. The
AUD_COUNT bits (0x12C to 0x12E) contains a 24-bit integer value representing the
number of audio clocks, and the 24-bit VID_COUNT bits (0x128 to 0x12A)
represents the fractional number of video clocks that are expected in the time frame of
the audio register. The VID_COUNT register contains 21 integer bits and 3 fractional
bits. The locking loop will drive the audio PLL such that this ratio is maintained. Lock
is maintained as long as the accumulated difference between audio samples and video
pixels does not exceed one-half of a video field.
The locking algorithm counts a number of audio clocks from an audio clock
reference, equal to the number programmed into the AUD_COUNT register. The
reference for the audio clock is the AUX_PLL, which is always equal to 384 times the
audio sample rate.
A video count register accumulates the number of video pixel clocks during this
interval. The difference between the accumulated number of pixel clocks and the
expected value in VID_COUNT def ines the error term. The reference for the video
clock is a clock that is 8 times the pixel rate. Since jitter can exist due to clock domain
synchronization issues, and because the video pixel clock can be somewhat unstable
in order to lock to sources such as VCRs, the error term is heavily filtered (a low loop
gain) to maintain a clean audio clock.
The fractional portion of the VID_COUNT register provides a degree of flexibility in
the required parameter in the AUD_COUNT register, and thus how often the loop
updates. Without fractional capability, the value required in the AUD_COUNT
register might have to be so large that the loop is updated too infrequently.
Table 3 -2 8 contains examples of how these registers should be programmed for
common audio sample rates and video pixel rates. Notice that the fractions can be
exactly represented through binary numbers. These values demonstrate the minimum
requirements. The user may want to multiply both AUD_COUNT and VID_COUNT
3-64Conexant102284B
Production Data Sheet
8/3/05
Page 91
CX25840/1/2/3 Data SheetDetailed Functional Description
numbers by a common integer such that all modes have similar loop update rates. The
video pixels and audio samples columns show the minimum ratio of whole pixel to
whole sample counts. However, because the actual clocks are multiples of the video
pixel and audio sample rates, and because the video count can be specified to 3-bit
fractional granularity, the logic does not have to wait for that long to measure the ideal
ratio. Table 3-28 shows the minimum values of AUD_COUNT and VID_COUNT that
will achieve the desired ratio. The VID_COUNT register value assumes an 8x pixel
clock and a 21-bit integer, 3-bit fractional number. The AUD_COUNT register value
assumes a 384 x sample rate clock.
Table 3-28. 43 Locking Register Values for Common Audio Sample Rate
Video Pixel
Rate
13.5 M 48 k1,12540x1193F80x05FFF
13.5 M 96 k1,12580x08CAF80x02FFF
13.5 M 32 k 2,25080x0D2EF80x02FFF
13.5 M 44.1 k4,500147 0x057E380x01B8F
14.75 M 48 k7,37524 0x0733B80x023FF
14.75 M96 k7,37548 0x0733B80x047FF
14.75 M32 k7,37516 0x0733B80x017FF
14.75 M44.1 k 147,500441 0x0900A80x02957
12.27 M48 k818,1813,2000x0C7BFD0x04AFF
12.27 M96 k 818,1816,400 0x0C7BFD0x095FF
12.27 M32 k 2,454,5436,400 0x2574070x095FF
12.27 M44.1 k 272,7279800x04294F0x016F7
Audio Sample
Rate
The table entries show the exact ratio, and the event that generates an error happens
faster than the field rate of 60 Hz. (NTSC square pixel with 32 kHz audio would have
a worst-case update rate of 40 Hz. However, because the AUD_COUNT integer is
divisible by eight, and there are still three bits of resolution in the VID_COUNT
register, both numbers could be divided by eight to reduce the update frequency to
320 Hz.)
Video PixelsAudio Samples
Recommended
VID_COUNT
Recommended
AUD_COUNT
102284BConexant3-65
Production Data Sheet
8/3/05
Page 92
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.10Register Addressing
The user-programmable registers can be programmed through either a two-wire serial
interface or the VIP Host port. In either method, there is a portion of the cycle in
which a register subaddress is passed over the interface. The internal register space is
based on a 16-bit subaddressing scheme. (The address space is currently limited to 12
bits based on VIP Host port limitations.) Table 3-29 shows how the address space is
organized among the major submodules of the IC.
The first address space is used for the serial port mechanism, whether it is the twowire interface or the VIP Host port. The mapping of these 256 bytes depends on
which of the two interfaces is active. This space is used to configure the operation of
the serial interface itself. It is also used for configuring power-down states. Since the
serial interfaces receive their own external clocks, these modules can be used to shut
down the other digital clocks.
See Section 5 for a full definition of the register address space.
Table 3-29. Register Subaddresses
Subaddress[11:8]Register FileSize (bytes)
0000Two-wire serial/VIP256
0001Chip Config256
0010IR Blaster256
0011RESERVED256
0100Video and VBI1K
1xxxRESERVED2K
3-66Conexant102284B
Production Data Sheet
8/3/05
Page 93
CX25840/1/2/3 Data SheetDetailed Functional Description
3.11Two-Wire Communications Port
The device communicates over a 400 kHz, two-wire serial interface or a 2-bit VIP
host interface. These two interfaces share pins and are mutually exclusive. The
VIP_ENABLE reset strap selects either the VIP Host or the serial slave
communication mode.
3.11.1Serial Slave Interface
The registers can be accessed through a two-wire serial bus interface operating as a
slave device. The serial clock and data lines SER_CLK and SER_DATA transfer data
from the bus master. A CHIP_SEL/VIPCLK pin is available to configure the device
for one of two possible chip addresses. The device address byte can be either 0x88 or
0x8A for write cycles, or 0x89 or 0x8B for read cycles. (The ALTADDR_SEL reset
strap also enables a 0x8C/0x8D and 0x8E/0x8F option. See Section 3.16 for more
details.)
3.11.2Starting and Stopping
The relationship between SER_CLK and SER_DATA is decoded to provide both a
start and stop condition on the bus. To initiate a transfer on the serial interface bus, the
master must transmit a start pulse to the slave device by taking the SER_DATA line
low while the SER_CLK line is held high. The master should only generate a start
pulse at the beginning of the cycle, or after the transfer of a data byte to or from the
slave. To terminate a transfer, the master must take the SER_DATA line high while the
SER_CLK line is held high. The master can issue a stop pulse at any time during a
cycle. Since the interface interprets any transition on the SER_DATA line during the
high phase of the SER_CLK line as a start or stop pulse, ensure that data is stable
during the high phase of the clock. Figure 3-24 provides a timing diagram for the
serial start and stop transaction.
Figure 3-24. Serial Start and Stop Transaction
SER_CLK
SER_DATA
StopStart
102284_020
102284BConexant3-67
Production Data Sheet
8/3/05
Page 94
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.11.3Chip Addressing
The device’s serial interface chip address consists of two parts: a 7-bit base address
and a single-bit R/W command. The R/W bit is appended to the base address to form
the transmitted address.
A6A5A4A3A2
Table 3-30. Chip Addressing
Serial Address
880110001000Write
8A1110001010Write
8C0010001000Write
8E1010001010Write
CHIP_SEL/
VIPCLK Pin 17
A1A0R/W
Base AddressR/W Bit
Table 3 -3 0 defines chip addressing.
IRQ_N/PRGM4
Pin 10
0110001001Read
1110001011Read
0010001001Read
1010001011Read
Base AddressR/W BitAction
102284_021
3-68Conexant102284B
Production Data Sheet
8/3/05
Page 95
CX25840/1/2/3 Data SheetDetailed Functional Description
3.11.4Reading and Writing
After transmitting a start pulse to initiate a cycle, the master must address the device.
To do this, the master must transmit one of the four valid chip addresses, with the
Most Significant Bit (MSB) transmitted first. After transmitting the address, the
master must release the SER_DATA line during the low phase of the SER_CLK and
wait for an acknowledge. If the transmitted address matches the selected chip address,
the device responds by driving the SER_DATA line low, generating an acknowledge to
the master. The master samples the SER_DATA line at the rising edge of the
SER_CLK line, and proceeds with the cycle. If no device responds, the master
transmits a stop pulse and ends the cycle.
If the slave address R/W bit is low, indicating a write, the master must transmit the
16-bit subaddress as two 8-bit bytes, MSB first. The device acknowledges the transfer
and loads data into its internal address register. The master then issues a stop
command, a start command, or transfers an 8-bit byte, MSB first, which is loaded into
the register specified by the internal address register. The device then acknowledges
the transfer and increments the address register in preparation for the next transfer. As
before, the master may issue a stop command, a start command, or transfer another 8
bits to be loaded into the next location.
If the slave address R/W bit is high, indicating a read, the device transfers the contents
of the register specified by its internal address register, MSB first. The master must
acknowledge receipt of the data and pull the SER_DATA line low. As with the write
cycle, the address register is auto incremented, in preparation for the next read. To
stop a read transfer, the host must not acknowledge the last read cycle. The device
then releases the data bus in preparation for a stop command. If an acknowledged
pulse is received, the chip proceeds to transfer the next register.
When the master generates a read from the device, it starts its transfer from whatever
location is currently loaded in the address register. Because the address register might
not contain the address of the desired register, the master executes a write cycle and
sets the address register to the desired location. After receiving an acknowledgment
for the transfer of data into the address register, the master initiates a read of the
device by starting a new serial interface cycle with an appropriate read address. The
device then transfers the contents of the desired register. Serial communications
protocol is illustrated in Figure 3-25.
SR = REPEATED START
P = STOP
A = ACKNOWLEDGE
NA = NON ACKNOWLEDGE
From Master to
CX25840/1/2/3
From CX25840/1/2/3 to
Master
102284_022
Page 96
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.12VIP 2 Host Interface
The VIP 2 Host Interface provides a faster alternative interface to the two-wire serial
communication interface. The VESA VIP 2 Host slave interface is a high-bandwidth,
minimal-pin-count interface for connecting multiple video components. Refer to the
Video Electronics Standards Association (VESA) Video Interface Port, version 2
specification for full implementation details. The VIP 2 Host slave interface enables
the chip to communicate with devices that are compliant with either the VIP 1.1 or 2
master specifications. The host interface provides read accesses to the FIFO and
Read/Write accesses to the register space.
The VIP Host Interface also supports the following:
Burst reads of the registers with at most one wait phase per byte
Power management configuration through writes into the command register
Power reporting in the status registers
The VIP Host interface works on the VIPCLK pin, which doubles as CHIP_SEL/
VIPCLK in the two-wire serial mode. The VIP 2 Host interface block takes care of the
serialization of the data flow from the device to the a VIP Master (graphics chip) and
the serial to parallel conversion of the data flow from the VIP Master to the device.
The VIP Host interface block follows the VIP 2 specification, which stipulates that,
for reliable operation, all register accesses must be at most one wait phase per byte
and no wait phases for FIFO operations.
3.12.1Address Space
The VIP Master can address 4096 locations. VIP address spaces are defined in
Table 3 -3 1.
Table 3-31. VIP Address Spaces
Address SpaceBlock Select bit
000–00F
010–FFF
VIP configuration space
Local register space
3.12.2VIP Power-Up Detection
On power-up, the VIP master asserts VRST. The device holds the HAD[0] line low
until VRST remains asserted. Once the VRST is deasserted, the host interface drives
the HAD[0] line to a three-state, indicating the signal’s presence on the VIP bus.
Vip_sel
Reg_sel
3-70Conexant102284B
Production Data Sheet
8/3/05
Page 97
CX25840/1/2/3 Data SheetDetailed Functional Description
3.12.3VIP Power Modes
The VIP master can configure the device for different power modes. The device
supports all four modes, as described in the VIP 2 specification. The master must
write to bits [1:0] of the command register to configure the chip for these different
power modes.
P0: The device is operating in the normal power consumption mode without any
part of the chip being put to sleep. This is the default mode.
P1: In this mode, the digital part of the chip is shut down. It essentially turns off all
the clocks to the digital part of device. This mode has a turn-on latency of less than
10 ms. The VIP clock will be on, and the graphics chip can access the
configuration registers (000:00D addresses).
P2: In this mode, the analog portions of the chip are shut down as well. The host
interface turns off the power to the digital part and the analog portions of the chip.
Turn-on latency is less than 1 second. The VIP master can turn off the VIPCLK in
this mode. However, if the clock is supplied, the master will be able to access the
configuration registers (000:00D address).
P3: The device supports the P3 powered down mode where it consumes minimal
power. The VIP master stops the VIPCLK to the block in a power-down mode. In
this mode, the host interface will drive the VIP interface pins to a three-state. The
host interface asserts a sleep signal, and this turns of the power to digital and the
analog parts of the chip. This mode is the same as the power mode P2.
102284BConexant3-71
Production Data Sheet
8/3/05
Page 98
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
3.13Hardware Interrupt
The interrupt pin, IRQ_N/PRGM4 (VIRQ_N in VIP mode) signals interrupt
conditions that occur within the chip. An interrupt condition can be enabled through
the Interrupt Mask 1 and Interrupt Mask 2 (0x412 and 0x413) register. Setting the
appropriate video decoder or IR controller bits in the register masks the assertion of
the interrupt pin. The Interrupt Status 1 and Interrupt Status 2 (0x410 and 0x411)
registers allow the status of each of those interrupts to be checked separately. There is
also an option to invert the polarity of the pin.
3.14I/O Pin Configuration
3.14.1Output Pin Configuration
The digital I/O pin functionality is extremely flexible. The CX25840/1/2/3 provides
up to eleven programmable pins. These configurable GPIOs are shared with the
following pin/port groups so that the user can assign exactly which pins can be
dedicated to specific functions versus general purpose I/O functions.
Video Timing Control (VRESET/HCTL/PRGM3 is unavailable when VIP Host
Any of the programmable pins can be conf igured to provide alternate functions from
their default state. This allows customization of the output interface in order to fit a
wide variety of system requirements. Ta ble 3 -3 2 shows the default state of the
programmable pins after reset.
Table 3-32. Default PRGM[0:7] Pin Configuration
Pin Name
DVALID/PRGM0DVALIDDefault function is a valid pixel data indicator. When asserted, indicates a valid pixel. Can be
FIELD/PRGM1FIELDDefault function is field indicator. Even/Odd Field indicator (0 = odd field, 1 = even field). Field
HRESET/PRGM2 HRESETDefault function is horizontal reset indicator. Asserted at 0H sync point, held for 32 or 64 clocks.
VRESET/HCTL/
PRGM3
IRQ_N/PRGM4IRQ_NInterrupt pin
IR_TX/PRGM6IR_TXInfrared Remote Transmit
IR_RX/PRGM5GPO[2]Infrared Remote Receive. This is by default an input, so the output select will be a don’t care
PLL_CLK/PRGM7 GPO[3]Auxiliary PLL output clock. This default mode is to select the PLL output from inside the analog
programmed for alternate functions in Ta ble 3 -3 3.
resets to 0, odd, and toggles every new_field. Can be programmed for alternate functions in
Tab le 3-3 3.
Width can be configured through HR32 bit in MISC_TIM_CTRL register in video decoder core.
Can be programmed for alternate functions in Ta bl e 3 -3 3.
VRESETDefault function is vertical reset indicator. Asserted from vsync begin (start of serration pulses)
through end of equalization pulse period, nominally 5 or 6 lines depending on video standard.
Can be programmed for alternate functions in Table 3 -33 . In VIP mode this pin becomes the Host
Interface Reset Input and is not programmable.
unless put in output mode.
domain, so this output select will be a don’t care unless CLK_PAD_IN is selected from the digital
core.
Description
3-72Conexant102284B
Production Data Sheet
8/3/05
Page 99
CX25840/1/2/3 Data SheetDetailed Functional Description
Alternatively, the following functions in Ta bl e 3-33 are available by programming the
Pin Configuration registers (0x11C to 0x122). The XXX_OUT_SEL field select
which internal signal is output on the PRGMx pin. The default output 0 value is
determined by the specific output pin.
Table 3-33. Alternate PRGM[0:7] Pin Functions
0 = Pin Dependant
1 = ACTIVE (Composite active or horizontal active indicator. See ACTFMT bit of OUT_CTRL1
register in video decoder core.
)
2 = VACTIVE (Vertical active indicator. Asserted during all vertical active lines.)
3 = CBFLAG (Cr/Cb indicator (0 = Cr, 1 = Cb) Cbflag is reset to cb at the beginning of each
line and toggles every pixel clock period.
)
4 = VID_DATA_EXT[0] (Extended Video Data. Least significant bits of internal 10-bit video
bus. When enabled, 10-bit video is possible.
)
5 = VID_DATA_EXT[1] (Extended Video Data. Least significant bits of internal 10-bit video
bus. When enabled, 10-bit video is possible.
)
6 = GPO[0] (Data from internal GPIO flops.)
7 = GPO[1] (Data from internal GPIO flops.)
8 = GPO[2] (Data from internal GPIO flops.)
9 = GPO[3] (Data from internal GPIO flops.)
A = IRQ_N/PRGM4 (Interrupt output: default active low polarity)
B = AC_SYNC
C = AC_SDOUT
D = PLL_CLK
E = VRESET/HCTL/PRGM3 (vertical reset indicator)
F = RESERVED
Any signal shown in Figure 3-26 can be routed to any pin.
Figure 3-26. Output Signals Connection and Routing to Pins
Output Signals
Output Values
Bit Location
GP Flop
GPO0
GPO1
GPO2
GPO3
0
1
2
3
Register 126
Output Mux Value
Default unique to pin
ACTIVE
VACTIVE
CBFLAG
VID_DATA_EXT[0]
VID_DATA_EXT[1]
GPO[0]
GPO[1]
GPO[2]
GPO[3]
IRQ_N
AC_SYNC
AC_SDOUT
PLL_CLK
VRESET
RESERVED
Hex
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
Pin #
17
23
22
21
18
10
8
9
7
4
46
Pins/Output Mux
Name (Default)
CHIP_SEL/VIPCLK (GPO[0])
DVALID/PRGM0 (DVALID)
FIELD/PRGM1 (FIELD)
HRESET/PRGM2 (HRESET)
VRESET/HCTL/PRGM3 (VRESET)
IRQ_N/PRGM4 (IRQ_IN)
IR_TX/PRGM6 (IR_TX)
IR_RX/PRGM5 (GPO[2])
GPIO[0]/PRGM8 (GPO[0])
GPIO[1]/PRGM9 (GPO[1])
PLL_CLK_PRGM7 (PLL_CLK)
Enable
Register Bit
114 2
114 6
114 7
115 0
115 1
114 3
114 5
114 4
114 0
114 1
116 2
Output Mux Location
Register Bit
11D
3:0
11F
3:0
11F
7:4
120
3:0
120
7:4
11D
7:4
11E
7:4
11D
3:0
11D
3:0
11D
7:4
122
7:4, 2:0
102284_056
102284BConexant3-73
Production Data Sheet
8/3/05
Page 100
Detailed Functional DescriptionCX25840/1/2/3 Data Sheet
For example, if you want to read the signal VACTIVE on pin 23 (DVALID/PRGM0),
enable the signal by programming the output mux to a decimal 2 on register 0x11F,
bits 3:0. The signal VACTIVE can now be read on pin 23 (DVALID/PRGM0).
However, if you want to read any signal on pin 46 (PLL_CLK/PRGM7), set bit 2 of
register 0x115, then program the output mux to X11 (x = don’t care) on register
0x122, bits 2:0, and finally, register 0x122, bits 7:4. See Figure 3-27.
Figure 3-27. Reading the VACTIVE Signal on Pin 23 (DVALID/PRGM0)
Output Signal
VACTIVEDVALID/PRGM0 (DVALID)
Enable bit 6 of register 0x114.
Program bits 3:0 of register 0x11F to 0x02.
3.14.2Input Pin Configuration
For general purpose inputs, there are four internal registers that can be programmed to
receive their state from the pins shown in Tab le 3-34. The input pin for each general
purpose input can be programmed through the GPIOx_IN_SEL bits in the Pin
Configuration 9 and 10 registers (0x124 and 0x125). Bits 0x0 of GPIO{3:0}_IN_SEL
select the pin input that is assigned to the internal GPIx input flip-flop.