BECKHOFF DK9222-0213-0063 User Manual

XFC
h
ff
h
ff
h
ff
Application Note DK9222-0213-0063
Oversampling
SMPTE timecode EL3702 entertainment stage show light technology light control decoding time information synchronising LED
Reading SMPTE timecode information
This application example provides basics on the SMPTE timecode and contains a TwinCAT sample code for
Keywords
extracting the time information sent by a SMPTE master. Using an EL3702 EtherCAT oversampling terminal
it is possible to “listen” to the analog signal the SMPTE master broadcasts to the slaves. For the sample
code see DK9222-0213-0063_TwinCAT_sample.zip.
Preamble
Please keep in mind that in this document the term frame is used in a double meaning:
– Part or unit of a protocol.
– Snippet or single picture as unit of a movie.
What is SMPTE-Timecode?
Defined by the Society of Motion Picture and Television Engineers, the SMPTE timecode is a standard to provide an absolute
time reference for media metadata. Mainly it is used to synchronise different layers in media productions. A SMPTE frame
consists of 80 bits and is always broadcast from a SMPTE master to the slaves. Via an analog signal (±1…10 V), the SMPTE
timecode provides time information in a binary coded decimal identification on an absolute 24-hour time base (hh:mm:ss:ff).
Depending on the signal coding, there are different rates of frames per second (fps); the most common values are 24, 25, and
30 fps.
SMPTE master
hh:mm:ss:ff
Broadcast
Audio
h:mm:ss:
Video
h:mm:ss:
Automation
hh:mm:ss:ff
Other
h:mm:ss:
Fig. 1 SMPTE timecode: Broadcasting an absolute time reference to the slaves
For application notes see disclaimer on the last page
BECKHOFF
New Automation Technology
1
Application Note DK9222-0213-0063
Oversampling
Protocol details | Duration of a single bit
The first step is to calculate the duration of a single bit in relation to the frame rate. Because of the different picture frame
rates (24, 25, 30), the duration of a single bit differs and is calculated as follows:
XFC
Frames per second
30
25
24
Table 1 Duration of one bit
Duration of one bit Duration of a frame
4162⁄3 µs
500 µs
520 µs
80 x 4162⁄3 µs = 331⁄3 ms
80 x 500 µs = 40 ms
80 x 520 µs = 412⁄3 ms
Protocol details | High or low bit
The second step is to count the transitions within this duration. The bits are encoded as biphase: A „0“ bit has a single
transition at the start of the bit period. A „1“ bit has two transitions, at the beginning and middle of the period. So by counting
the transitions within a defined period of time, it can be determined whether the bit is high or low. When the signal is stable
during 417 µs at a rate of 30 fps, it is 0. When there are two constant signals of ~208 µs detected, it is 1.
417 µs 417 µs
“Zero“ “One“
Fig. 2 Sample at 30 fps
208 µs
transition
Protocol details | Frame setup
Aa a timecode frame always consists of 80 bits, it is 10 byte long. To mark the ending of a frame, the last two bytes follow a
defined sequence called SyncWord: 0011.1111.1111.1101. In table 2 you can see the setup of a complete timecode frame. In
the first row an overview of the time segmentation is given. To enable a fast overview of time-relevant information, the bits
containing other information are marked „x“.
For application notes see disclaimer on the last page
BECKHOFF
New Automation Technology
2
Application Note DK9222-0213-0063
Oversampling
XFC
Frame units
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
Table 2 Binary coded time information in the SMPTE frame. Bits containing other information than timecode are marked x.
Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8 Byte 9 Byte 10
Frame tens
1
2
4
8
x
x
x
x
Second units
10
20
x
x
x
x
x
x
Second tens
1
2
4
8
x
x
x
x
10
20
40
Minute units
x
x
x
x
x
Minute tens
1
2
4
8
x
x
x
x
10
20
40
Hour units
Hour tens
1
2
4
x
x
x
x
x
8
x
x
x
x
Sync word (fixed sequence of bits)
10
20
x
x
x
x
x
x
binary 0
binary 0
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 1
binary 0
binary 1
Analysing a frame
In the following figures two sections of a frame are decoded as an example. Figure 3 shows the complete SMPTE frame, figure
4 focusses on a frame detail (the frame units and the frame tens) to analyse the binary coded time information and transfer it
into the decimal based count of frames.
Frame
User
Frame
User
Second
User
Second
User
Minute
User
Minute
User
Hour
User
Hour
SyncWord
64 68 72 76 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76
n+1
Units
Bits
Tens
Bits
Units
Bits
Tens
Bits
Units
Bits
Tens
Bits
Units
Bits
one SMPTE frame
n
User
Tens
Bits
SyncWord
Frame Units
0
User
Frame
Bits
Tens
4 8 12
n-1
Fig. 3 A single SMPTE sample frame
Bit 0
Bit 1
Bit 2
Bit 3
Frame units
1
0
0
1
Frame tens
01
10
1
2
4
8
20
x
x
frame units = 9 frame tens = 20
1 0 0 1
0 1 x x
Fig. 4 Bit sequence 1001 | frame unit = 9; bit sequence 01xx | frame tens = 20, as both last bits do not give information about time
To obtain the complete frame value, both values are added: 20 + 9 = 29. It is the 29th frame in this second. Extracting further
time data out of the complete sample frame shown in fig. 3 results in: 05:38:14:29. Having understood the coding of the frame,
For application notes see disclaimer on the last page
BECKHOFF
New Automation Technology
3
Loading...
+ 7 hidden pages