Skip to content

Commit 22b5e9a

Browse files
committed
Add LTC frame format
1 parent 3a451cf commit 22b5e9a

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

sim/ltc/top.v

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,41 @@ module top(
33
output wire ltc
44
);
55

6-
parameter FPS = 25;
7-
reg [79:0] frame; // LTC frame
8-
reg out; // Output buffer
6+
/*
7+
* SMPTE 12M Linear Timecode (LTC) Frame Format
8+
* https://en.wikipedia.org/wiki/Linear_timecode#Longitudinal_timecode_data_format
9+
*
10+
* OFFSET LEN USE
11+
* 0x00 4 Frame (units)
12+
* 0x04 4 User Field 1
13+
* 0x08 2 Frame (tens)
14+
* 0x0A 1 Drop Frame Flag
15+
* 0x0B 1 Color Frame Flag
16+
* 0x0C 4 User Field 2
17+
* 0x10 4 Seconds (units)
18+
* 0x14 4 User Field 3
19+
* 0x18 3 Seconds (tens)
20+
* 0x1B 1 FLAG
21+
* 0x1C 4 User Field 4
22+
* 0x20 4 Minutes (units)
23+
* 0x24 4 User Field 5
24+
* 0x28 3 Minutes (tens)
25+
* 0x2B 1 FLAG
26+
* 0x2C 4 User Field 6
27+
* 0x30 4 Hours (units)
28+
* 0x34 4 User Field 7
29+
* 0x38 2 Hours (tens)
30+
* 0x3A 1 Binary Group Flag 1 (External Sync Source Flag)
31+
* 0x3B 1 FLAG
32+
* 0x3C 4 User Field 8
33+
*/
34+
35+
parameter FPS = 25; // Frames per second
36+
parameter CLK = 25e6; // Clock frequency in Hz
37+
38+
reg [15:0] sync = 16'b0011111111111101; // SMPTE 12M Sync Word
39+
reg [79:0] frame;
40+
reg out;
941

1042
wire rst_n;
1143
crg reset(clk, rst_n);

0 commit comments

Comments
 (0)