Engineer To Engineer Notea

EE-203

Technical Notes on using Analog Devices' DSP components and development tools
Contact our technical support by phone: (800) ANALOG-D or e-mail: dsp.support@analog.com
Or visit our on-line resources http://www.analog.com/dsp and http://www.analog.com/dsp/EZAnswers

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to
NTSC/PAL video decoder over the asynchronous port
Contributed by Thorsten Lorenzen

Introduction
The purpose of this note is to describe how tohook up video devices such as the ADV7183
NTSC/PAL Video Decoder to the external bus of
the ADSP-BF535 Blackfin® Processor. Becauseof its architecture and video processing
capabilities, Blackfin will interface with video
devices. The ADSP-BF535 as the first part of theBlackfin Processor family is not equipped with astandard interface that glueless interacts withvideo devices, but as this EE-Note shows, theAsynchronous Interface can be used to receive
video data in ITU-656 format.
Future Blackfin derivatives will beequipped with interfaces designed tosupport video devices (PPI interface).

ADV7183 NTSC/PAL Video
Decoder
The ADV7183 is an integrated video decoderthat automatically detects and converts astandard analog base band television signal
compatible with world wide standards NTSC or
PAL into 4:2:2 or 4:1:1 component video datacompatible with 16-bit/8-bit CCIR601/CCIR656
or 10/20-bit extended standards.
The advanced and highly flexible digital output
interface enables performance video decoding
and conversion in both frame buffer based andline locked based systems “LLC Mode”. This
makes the device ideally suited for a broad rage

September 1, 2003

of applications with diverse analog video
characteristics including tape based sources,
broadcast sources, security/surveillance cameras
and professional systems.

Basics of analog video composite
signals
To fully understand the decoders digital output it
is helpful to review the background of the NTSC
standard and how it came along. If you arefamiliar with it already please go to the next
chapter.
The first color television system was developedin the United States and began broadcasting in
1954. For economic reasons, a requirement wasmade that monochrome receivers must be able todisplay the black and white portion of a color
broadcast and that color receivers must be able todisplay monochrome broadcast. For broadcasting
purposes all required signals must be fitted into asingle line. However, the CVBS signal looks still
as years ago for compatibility purposes.
The analog composite video signal was designed
a way it is shown as follows.
Imagine, a CRT (Cathode Ray Tube) of a TV
such as shown in Figure 1 has been designed todisplay a video image based on N lines in thevisual area “active video” of the monitors
surface. In general, the ray of the CRT starts atthe top left side and goes to the right. Afterreaching the right end it turns off and goes backCopyright 2003, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application ofcustomers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are propertyof their respective holders. Information furnished by Analog Devices Applications and Development Tools Engineers is believed to be accurate and reliable, however
no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices’ Engineer-to-Engineer Notes.

ato the left, a line below. Reaching the left side itturns on again and draws the next line on thescreen. By repeating this the monitor will always
be drawn with the help of the CRTs ray.

In Figure 1 a NTSC Video Composite Signal canbe seen. It drives the CRT in a sense that it runs
as discussed above.

What kind of signals are required to fully drive
the CRT?

Even Field
Line 1
Line 3.
.
Last Line

Line 1

Odd Field
Line 2
Line 4.
.
Last Line

Line 3.

.

Last Line

Blank

CVBS

Figure 1: Multiple lines of an analog video composite signal (CVBS)

In general the video composite signal has two
major tasks.
First, the CRT (Figure 1) runs from the left tothe right, from the top to the bottom controlled
by its own oscillators and sidetrack units. But it
must be controlled (triggered) by signals thatcomes along (is aligned to) with the signal that
holds the image data. Otherwise the image cannever be placed on the screen in a correct order.
Such signals are called:

Horizontal Sync (Line Blanking Signal), toforce the CRT to turn off the ray and startwith the next line. The Line Blanking area in
Figure 2 shows such a signal.
Vertical Sync, to force the CRT to turn off the
ray at the end of a frame/field and start with
the next frame/field. The right end of the
CVBS signal on Figure 1 “Blank” shows sucha signal.
Second, the image data is split into parts ofluminance and chrominance information’s “(Y)Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 2 of 12

a(C)”. “Figure 2” shows the two information’s
combined with the syncs in a single line.
Luminance: As it can be seen in the area of“Active Video Line” the steps show different
levels of luminance displaying a bar ofdifferent values in brightness.
Chrominance: The gray squares in Figure 2
represents 9 cycles of a 3.58MHz frequency
as shown underneath the signal. The cycles
are carrying the color information. The firstgray square in the area of Color Burst drives
an extra oscillator build into the video
receiver and holds the cycles as a reference.
The following squares “cycles” will becompared with the reference (Color Burst).
The phase shift between these determines thehue. Color saturation is implemented by thecycles amplitude.
Line Blanking
Color Burst

Active Video Line

Figure 2: One line of a Video Composite Video Signal

As many as lines the video resolution includes as
many line signals must be implemented in thevideo composite signal.

Decoding the analog composite
video signal by the ADV7183 in
LLC mode
It has been discussed how the analog composite
video signal looks like. This section is dedicatedto understand the signal path of the decoderwhen in CVBS mode. Just one of the two ADCs
are used for conversion
After the analog signal has passed the ADC it
goes into a luminance path to separate theluminance information. Also, it goes into achrominance path to separate the chrominanceinformation.
In the luminance path the 10-bit data from the
ADC is applied to an antialiasing low pass filter
that is designed to band-limit the input video
signal such that antialiasing does not occur. In
CVBS mode a notch filter must be used toremove the unwanted chrominance data that lies
around the subcarrier. The next step is a peaking
filter. This filter offers a sharpness function on
the luminance path. The data is then passed
through a resampler to correct for linelengthvariations in the input video. The resampler isdesigned to always output 720 pixels per line.
In the chrominance path the 10-bit data from the
ADC is first demodulated as it is achieved bymultiplying the locally generated quadrature
subcarrier, where the sign of the cos subcarrier isinverted from line to line according to the PAL
switch. The low pass filter is applied to remove
components at twice the subcarrier frequency.
The chrominance data is then passed through anband-pass filter to remove unwanted luminancedata. After a shaping filter is applied the data ispassed through a resampler to correct for line
length variations in the input video. It always
outputs 720 pixels per line.
The output formatter block does take theluminance and chrominance data and put it in theorder as it is shown in Figure 3.

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 3 of 12

a
As is can be seen the actual video data has been
embedded in the data block (Active Video).
Active video data is separated by blanking andsynchronization.
Due
to
the
ITU-656
recommendation it always begins and ends withthe preamble (“FF 00 00 DA” 10 80 10 80 … 10
80 10 80 “FF 00 00 C7”).

Figure 13 shows a video stream blanking and thepreamble included.
Alternatively, the synchronization values
embedded in the data stream can also be
provided with the help of external lines “pins”.
Figure 3 show such lines “DV, VREF, HREF”.

Even Field

Odd Field

Line 1
Line 2.
.
Last Line

Line 2.

Video Blank Video

Blank Video

Line 1.

Last Line

Blank

CVBS
16-bit
BUS

Blank Video Blank Video

Blank

HREF
DV
VREF
t

Figure 3: Analog input and digital output of an video decoder

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 4 of 12

aAsynchronous Interface of the
ADSP-BF535
The processors asynchronous interface is used toreceive the video data. 32-bit data can be fetchedin a manner it is shown in Figure 4.

DMA is set up to read 32x32-bit data words(shown as Channel 2, the /ARE signal).
However, the DMA channel can be programmed
to a maximum number of 64k words. The gap
between these 32 words is required for loading
the next DMA descriptor.

Channel 2

Figure 4: ADSP-BF535 Asynchronous Timing

Figure 5: ADSP-BF535 DMA Read Bursts

As mentioned in the ADSP-BF535 Blackfin
Hardware Reference Manual after a read cycle isinitiated the Async Memory Select line (/AMSx),
Async Output Enable line (/AOE) and the Async
Read Enable line (/ARE) become asserted. Aftera multicycle “Read Access” delay (Configuredby the Async Interface Bank Control Register),the /ARE pin normally de-assert to complete theread operation. As the processors external
memory map is split into four banks ofasynchronous memory regions there are four
separate select lines ”AMS[3:0]” dedicated toeach memory bank. The timing is equivalent to
the read enable line “/ARE” unless additional
hold cycles are inserted. The /AMSx lines can betaken to act as a chip select “CS” to different
devices by accessing different memory banks.

Because of each DMA transfer is split into burstsof eight accesses (in this configuration, four
bursts per DMA execution) the understanding of
this behavior is crucial for developing a proper
DMA interface. Figure 6 zooms into one of theseburst patterns to analyze how many cycles aretaken for each access.

Due to the architecture of the ADSP-BF535, a
DMA-controlled data download is somewhat
non-intuitive. Each DMA data transfer is split
into bursts of eight read accesses. After the burst,
a gap appears because of internal bus activity.
Figure 5 illustrates this. As shown below the first

Figure 6: ADSP-BF535 DMA Read Accesses

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 5 of 12

aThe peripheral clock “SCLK” is displayed inchannel 1 and channel 2 shows the /ARE pin.
After eight read strobes are done nine extra
SCLK cycles are taken to place the data into
internal memory.

Interface the ADSP-BF535 into
the ADV7183
The ADSP-BF535 asynchronous interface isconfigured to make full use of its 32-bit external
memory interface, in order to gain maximum
throughput. As the ADV7183 is configured to
run in 16-bit LLC synchronous mode its output
does not meet the timing requirements of theprocessors asynchronous interface in more than
one topic.

underflow. The reads and writes are internallysequential through the use of ring pointers, withno address information required to load andunload data. Data is toggled in and out of thedevices through the use of the Write (/W) andRead (/R) pins. The IDT72V06 FIFO
incorporates a 9-bit data path. In order to take itfour of them must be connected in parallel tomake it compatible to the ADSP-BF535 32-bit
interface.

1. The 16-bit bus must be extended to gain
maximum throughput over the 32-bit bus.
2. As discussed in the chapter before, due tothe descriptor reload the processor is notable to receive data while it is in thereloading process. Data of the ADV7183
would get lost without the use of any holdmechanism.
3. SDRAM could never be accessed without
the use of external buffers as long as thevideo decoder transfers data sequentially(Data/Address busses are multiplexed).
4. Without any logic active video data as wellas control information’s “Blanking”
embedded in the data would be received.
Although, the control information’s are notneeded it would be transferred and waste
memory space.
All these topics has been taken to design aninterface that serves these. In this application
example the decision was made to take FIFOs of
IDT. The IDT72V06 is a dual port FIFO memorythat operates at a power supply voltage between
3.0V and 3.6V. It loads and empties data on afirst-in/first-out basis. It uses Full, Half Full andEmpty flags to prevent data overflow andFigure 7: Picture of the actual application

Figure 7 shows the actual application. Its
designed as a daughter card that fits on the
ADSP-BF535 EZ-KIT Board. As it can be seen
on top is the ADV7183 evaluation board
connected. Both boards are part of Analog
Devices evaluation environments.
IDT today offers more enhanced FIFOs
as it has been taken in this EE-Note.
The chapter “Design Improvements”
shows an alternative part that fits betterwith less glue logic

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 6 of 12

a
As it can be seen in Figure 8 the FIFOs aredesigned in between the processor and the video
decoder. Lets start with the connections to theBlackfin “ADSP-BF535”. As discussed earlier
the ADSP-BF535 is fitted with the 32-bit
asynchronous interface. The 32-bit data bus islinked to the FIFOs output “Q[7:0]”. The
Asynchronous Memory Select Line 1 “/AMS1”
is linked to the Read Line “/R” of the FIFOs.
Taking /AMS1 indicates that the processors
Memory Bank 1 must be accessed to activate the
FIFOs. The FIFOs Half Full Flag “/HF” indicatesa half full and the ADSP-BF535 should start adownload to prevent a data overflow. That’s why
its connected to programmable flag GPIO1. A
processor interrupt driven by the programmableflag GPIO1 starts the download. In general, there
is no connections of the Blackfin to the video
device. It just waits until it indicates that the
FIFO must be emptied. The key point can befound between the Video Decoder and theD[31:0]

D[7:0]
Q[7:0]/R

D[7:0]
/W

/HF

/RS

Q[7:0]

D[7:0]
/W

/R
/HF

/R
/HF
74LV02D< 1 A0GPIO 1Q0
B0

Q[7:0]/R/HF

P[15:0]74LV74D

Q0

DV
LLC2

D
CK0<

74LV08D/Q0
CLR

D[7:0]
/W
/RS

Q0

A0

& B0

74LV74D

ADV
7183

P[15:8]D[7:0]/W/RS

Q0
ADM 708 SAR

4 X FIFO IDT 72V06

GPIO 2

DCK0<=1
74LV08D/Q0/RESET

CLR

A0

VREF

& B0

FIELD

Q0

/MR

/OE

GPIO 3SCL

GPIO 4GPIO 5beVideo SourceP[15:0]P[7:0]

D[31:24]

must

The D-Flip Flop “74LV74D” at the bottom of
Figure 8 is designed in to detect the start of thefirst frame after power up or manually reset
activated by a programmable flag. With the helpof the signal VREF and FIELD supplied by thevideo decoder the Data transfer will be enabledat the first stage. The Data Valid signal “DV”
indicates fractions of active video. With the helpof a logical AND the DV signal and the Flip Flopoutput of VREF and FIELD defines a signal thatenables transfer at the second stage.

/RS

D[23:16]Q[7:0]

functions

Second: The FIFOs should not be filled withblank data. Blank data just wastes memory.

P[15:8]

D[15:8]mainFirst: Automatically, it should be detected thestart of the first frame otherwise the frames
can not be reconstructed.

P[7:0]DATA/AMS1ADSPBF535

FIFOs. Two
implemented.

SCCB Interface to configure the device

SDA

Figure 8: ADSP-BF535 video connection block diagram

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 7 of 12

aTo extend the 16-bit bus of the Video Decoder tobecome a 32-bit bus compatible with the ADSPBF535 a second Flip Flop is used at the final
stage. As it can be seen on top of Figure 8 thesecond Flip Flop half’s the frequency. It links theoutput line Q0 to the top FIFOs write line andlinks the output line /Q0 to the bottom FIFOs
write line. Alternately, the 16-bit bus will belinked to both FIFO pairs.
Due to this logic the FIFOs will just be filledwith video data.

Data Download Procedure
With regards to the discussion above the normal
procedure to receive video data in this system is
as follows. After power up the FIFOs will befilled with data when a start of a field occurred.
All this will be ignored because the processor is
not ready to run. The first action of the Blackfin

software is to assert GPIO2 in order to reset thesystem manually. The programmable flag drives
a supervisory circuit effecting the Flip Flops and
FIFOs to reset. The first video field after reset
fills the FIFOs. After the FIFOs are half full the/HF pin will be asserted. The assertion of /HF
generates an processors interrupt via GPIO1. Theinterrupt service routine includes instructions tostart a descriptor based DMA. The IDT72V06
includes a 16k address space so that the /HF pin
asserts after it has been filled with 8k of data. To
prevent memory underflow the maximum
number of DMA transfers must be limited to 8k.
When the DMA transfer is finished the next
descriptor will be loaded automatically but thetransfer will not continue. The data alreadyreceived can be processed. As soon as the FIFOs
indicate been half full again the next DMA
transfer is activated.

LLC2
VData
Y[7:0]
/MLW
/MHW
DV
VREF
Field
/Reset
FF Start
Figure 9: ADV7183 output and video system timingThis process repeats as long as it is not turned off
by software.
Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 8 of 12

aIn general a DMA engine is designed totransmit data independently of core
activities. While the first portion of data
will be processed the next portion can bereceived without interrupting the core.
Figure 9 shows the timing from ADV7183 to the
FIFOs. After RESET has been de-asserted VREF
will assert at the beginning of the next field. The
pin DV will remain de-asserted as long as justblanking goes over the bus. At the beginning of
the first visual line (active video) DV will assert
and remain asserted while active video istransmitted in the actual line. At the end of theline DV will de-assert and remain until the next
visual line. While DV remains asserted
alternatively the FIFOs gets filled triggered by
the top Flip Flop (/MLW and /MHW). As its
output and inverted output are taken (Q0 and/Q0) the top FF expends the 16-bit bus to an 32bit bus.

Design Performance.
As in the chapter “Interface the ADSP-BF535
into the ADV7183” covered the SDRAM could
never be accessed if the bus would be taken for
the video download already. Due to the fact thatthe Blackfin Processor empties the FIFO much
faster than it is filled by the video decoder thebus remain idle in between. Figure 10 (channel
1) shows blocks of memory strobes (/AMS1). If
the processors peripheral clock (SCLK) runs at
120MHz and the external port is set to run at
maximum speed it takes 400µs to download 8k
words (32-bit). After each download the bus
remains in idle. Channel 2 of Figure 10 shows asignal peak triggered by the half full flag of the
FIFOs. That results in a Blackfin processor
interrupt which starts the next DMA
transmission. From the end of transmission one
to transmission two takes 1.04ms.This is left for
SDRAM or any other access via the external
port.

Figure 10: ADSP-BF535 performance test result

Design Improvements
Today’s FIFOs are much more enhanced than the
one taken for this project. The main reasons fortaken the IDT72V06 was the availability as wellas the package size. The IDT72V06 is available
in a PLCC package instead of the IDT72T36105
discussed below. However, the next IDT
generation of FIFOs like the IDT72T36105
provides bus widths up to 36 bits in a single chip.
It supports features like asynchronous andsynchronous timing, retransmit, programmable
almost full and empty flags, bus matching…
These chips provide a lot of functionalities that
decrease the number of external logic required.
Asynchronous vs. Synchronous Timing:
The device can be programmed to meet theasynchronous timing as it is required forBlackfin as well as synchronous timing required
for the video device.
Retransmit:
Allows to transmit the data stored many times.
Programmable almost full/empty flags:
A programmable threshold of a certain level
when the pin asserts. As mentioned before taking
the half full flag wastes a lot of memory. A

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 9 of 12

acheaper chip with less memory could be chosen
if the almost full fag is programmable.
Bus Matching:
The input bus of the FIFO can be limited to 18
bits while the output keeps the width of 36. This
D[31:0]

way the device collects 18 bit words and packs it
to be 36 bit words. No glue logic is required foralteration. Figure 11 shows a schematic that
includes such a device. This schematic is just a
recommendation but has never been tested on
hardware.
P[15:0]

FIFO IDT 72T36105

DATA

D[31:0]Q[15:0]

/AMS1

/RD

/WEN

GPIO 1/PAF

GPIO 2/REN

P[15:0]
DV

Q0 A0

& B0
74LV08D

LLC2

WCLK
74LV74D/PRSADSPBF535

Q0

D

=1

ADV
7183

CK0<
/Q0
CLR

ADM 708 SAR/RESET

GPIO 3GPIO 6

A0

VREF

& B0

FIELD

Q0

/MR

/OE

GPIO 4GPIO 5

74LV08DSCLSCCB Interface to configure the device

SDA

Figure 11: Enhanced ADSP-BF535 video connection block diagram

Conclusion
This note should have given an idea on how toconnect devices like the ADV7183 video
decoder to the ADSP-BF535. It has been
discussed the processors behavior of the external
port (EBIU) especially in combination with
DMA transfers. A standard video source(ADV7183), the digital signal obtained from andthe way it can be implemented in the video signal
chain has been covered. Furthermore the glue
logic required and the connections to suchdevices.

Derivates as such as the ADSP-BF533 will beequipped with interfaces (PPI) that fit glueless tothis sort of video devices. Additionally, the PPIinterface will include features like ITU-656/601
support. The data stream will be investigated by
the PPI and optionally skip blanking, skip evenor odd samples to select bw/color samples orskip field 1 or 2. Also, external sync signals aresupported (HSYNC/VSYNC).
Future processors will have even more support assuch as on-fly separation of luminance andchrominance values, windowing of an area ofinterest, re-sampling 4:4:4>4:2:2, RGB/YUV
conversion, down sampling or up sampling.

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 10 of 12

aFor lower speed devices it is referred to
the note EE-181. EE-181 is dedicate toshow how single chip CIF cameras canbe connected to the ADSP-BF535. Suchcameras supply an output clock of about
8MHz.

external port of the ADSP-BF531/532/533 canalso be taken as it is done in this note to make asecond PPI. Figure 12 shows this. With the helpof just two FIFOs and nearly the same logic the
ADV7183 can also be connected to the ADSPBF531/532/533 external port.
The ADSP-BF531/532/533 does notshow the same behavior as the ADSPBF535 on the external port due to designchanges. The gaps are not existing
anymore. Please see the Hardware
Reference Manual

ADSP-BF531/532/533 Support
The ADSP-BF531/532/533 is already equippedwith a PPI Interface. The use of any glue logic is
not necessary. Due to the fact that the PPI is ahalf duplex bi-directional port it is not capable
for multiple video devices. But if for any reason
two PPI interfaces are required the 16-bit

D[15:0]

D[7:0]DATA/AMS1

P[7:0]
Q[7:0]/R

D[7:0]
/W

/HF

/RS

Q[7:0]

D[7:0]/W

D[15:8]

P[15:0]2 X 74LV08D

P[15:8]/R/HF

ADSPBF535

P[15:0]

Q0

LLC2

A0

& B0

/RS

Q0

DV

A0

& B0

2 X FIFO IDT 72V06

ADV
7183

74LV74D

Q0GPIO 1

ADM 708 SAR

D
CK0<

=1
74LV08D/Q0/RESET

GPIO 2

A0

VREF

& B0

FIELD

Q0

/MR

/OE

GPIO 3SCL

GPIO 4GPIO 5CLR

SCCB Interface to configure the device

SDA

Figure 12: ADSP-BF533 video connection block diagram

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 11 of 12

aPreamble = FF 00 00 DA
Preamble = FF 00 00 C7

Blanking

Active Video Data

Figure 13: ITU-656 Digital Video Data Stream

References[1]

IDT 72V06 Datasheet, August 2001 Integrated Device Technology Inc[2]

IDT72T36105 Datasheet, June 2002 Integrated Device Technology Inc[3]

ADV7183 Datasheet, Rev 0, 2002. Analog Devices Inc[4]

ADSP-BF535 Datasheet, Rev PrC, 2002. Analog Devices Inc[5]

ADSP-BF535 Blackfin® Processor Hardware Reference Manual, Second Edition, March 2003

[6]

Video Demystified by Keith Jack, Third Edition, 2001

Document History
VersionDescription

September 01, 2003 by T. Lorenzen.

Initial Release

Interfacing the ADSP-BF535/ADSP-BF533 Blackfin® Processor to NTSC/PAL video decoder over the
asynchronous port (EE-203)
Page 12 of 12