Professional Documents
Culture Documents
User Guide: Cycloneii Fpga / Asic Multimedia Application
User Guide: Cycloneii Fpga / Asic Multimedia Application
Multimedia Application
Platform
User Guide
1.1 ASIC/FPGA Introduction
Cyclone II Multimedia Platform is a implement for all there layers: beginner,
pre-intermediate and advanced. Its add-on modules provide the conjunction of
school and company designers. The user can implement VLSI (Very Large Scale
Integration)…with DHL , the digital logic circuit design and realize further the
digital media and image processor.
FPGA/ASIC Media Cyclone II FPGA system platform also provides RTL IP Code
and System Verification by the realization of the image to PC through USB.
2. Four 384K byte Frame Buffer Memory: store the VGA image data at
LCD Panel.
80MSPS Operation
VGA Output
10. Six 7-segs display: for Stopwatch, Count down, Alarm clock designs
14. 8 pairs of crystals for users: implement the Multiple Clock System
Design with the variety of users'demands
LE 33,216
18x18 Multipler 35
PLLs 4
I/Os 475
1.4 Peripheral
1.4.1 Seven Segment LED
The modules of the 7-segments are(form right to left part):
U13/U14/U15/U16/U17/U18. the followings show the position toward Cyclone II
FPGA pins.
U13 U14
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
A D2 A B5
B C2 B A5
C B4 C B6
D F10 D C3
E F3 E J5
F F9 F G10
G F4 G H12
DOT A4 DOT A6
U15 U16
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
A B7 A B9
B A7 B A9
C B8 C H8
D C6 D D8
E D6 E E8
F C4 F D7
G D5 G C7
DOT A8 DOT G5
U17 U18
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
A G6 A G9
B J8 B J9
C F7 C H11
D E10 D D1
E C9 E F11
F C8 F D10
G D9 G C10
DOT K9 DOT H10
1 L10 1 K2 1 L7
2 T10 2 K1 2 L9
3 T9 3 L2 3 N9
4 P3 4 L3 4 P9
5 R2 5 M2 5 P7
6 R3 6 L4 6 P4
7 M3 7 M5 7 R5
8 M4 8 L6 8 R4
Button Switch
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
LCD
Signal Cyclone II FPGA Pins
RS J1
RW K4
E K3
DB0 H6
DB1 H3
DB2 H4
DB3 J3
DB4 J4
DB5 H2
DB6 H1
DB7 J2
1.4.6 VGA & Audio & PS2 Interface application
Blue0 K26
Blue1 K25
Blue2 J26
Blue3 M24
Blue4 M21
Blue5 N23
Blue6 N24
Blue7 H19
Green0 K23
Green1 L23
Green2 L24
Green3 M22
Green4 M23
Green5 P24
Green6 K19
Green7 H26
Red0 K21
Red1 L20
Red2 L21
Red3 L19
Red4 M20
Red5 K24
Red6 P23
Red7 K18
BLANK N20
SYNC M19
SYNC_T J25
M1 L25
M2 M25
VGA_HS R24
VGA_VS R20
AUDIO Interface ( J4 )
Signal Cyclone II FPGA Pins
AUDIO_L1 T22
AUDIO_R1 T23
AUDIO Interface ( J5 )
Signal Cyclone II FPGA Pins
AUDIO_L2 T24
AUDIO_R2 T25
PS2 Interface ( J6 )
Signal Cyclone II FPGA Pins
PS2_KB_DAT P17
PS2_KB_CLK R25
PS2 Interface ( J7 )
Signal Cyclone II FPGA Pins
PS2_MS_DAT T18
PS2_MS_CLK R17
TFT LCD ( U7 )
Signal Cyclone II FPGA Pins
LCD_CLK N26
VSYNC J24
HSYNC H25
LCD_DATA0 G23
LCD_DATA1 G24
LCD_DATA2 K22
LCD_DATA3 G25
LCD_DATA4 G26
LCD_DATA5 H23
LCD_DATA6 H24
LCD_DATA7 J23
Frame Buffer ( U4 )
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
Frame Buffer ( U6 )
Signal Cyclone II FPGA Pins Signal Cyclone II FPGA Pins
ASARM provides 3 control signals: 20-bit A0~~19, 8-bit (I/O0~I/O7) and CE,
OE and WE. Picture 2.14 shows the structure of ASARM.
The serial numbers and positions of ASARM are as follow:
ASRAM ( U20 )
Type Signal Cyclone II FPGA Pins
A A0 AD12
D A1 AA13
D A2 AA14
R A3 AC14
E A4 AA15
S A5 AD17
S A6 AC17
A7 W15
A8 Y16
A9 W16
A10 AE18
A11 AF18
A12 AE17
A13 AF17
A14 AE16
A15 Y14
A16 Y13
A17 AA12
A18 Y12
A19 AF19
D IO0 AC15
A IO1 AB15
T IO2 AD16
A IO3 AC16
IO4 AE15
I/O IO5 AF13
IO6 AE13
IO7 AE12
C OE Y15
T CE AD15
L WE AA16
ASRAM ( U21 )
Type Signal Cyclone II FPGA Pins
A A0 W17
D A1 V17
D A2 V18
R A3 AA17
E A4 AC18
S A5 AB21
S A6 AD22
A7 AC22
A8 AA20
A9 AD23
A10 U17
A11 W19
A12 AC19
A13 Y18
A14 AA18
A15 AF21
A16 AE20
A17 AF20
A18 AE19
A19 U18
D IO0 AD19
A IO1 AC20
T IO2 AB20
A IO3 AD21
IO4 AE23
I/O IO5 AF23
IO6 AE22
IO7 AF22
C OE AE21
T CE AB18
L WE AC21
1.4.10 CMOS Image Sensor
The 3030ten thousand pixels 640x480 image sensor which can perform
644x484 in raw data format can be manual focused. The sensor can transmit the
image data to PC pin with the USB image catcher and rewrite the register data in
the sensor.
The position of the sensor card. The arrow shows the lens direction.
Picture show the input and output interface
SYSCLK VSYNC
HSYNC
CMOS
Sensor
SCL PXCK
SDA PXD[7:0]
PWDN
The serial numbers and position of the image sensor are as follow:
CMOS Sensor ( J3 )
Signal Cyclone II FPGA Pins
PX0 AA10
PX1 AC7
PX2 Y11
PX3 W11
PX4 AA11
PX5 V11
PX6 V13
PX7 T8
VSYNC Y10
PXCLK PXCLK
SYSCLK SYSCLK
HSYNC AB8
SDA AC9
SCL AC8
PWDN AA9
The designer can put the OSC quartz crystal on Cyclone II Multimedia
Platform
OSC ( X1~X8 )
OSC (Up) X7 X5 X3 X1
PLL
(SMA1)
Num SMA1
1.4.12 Jump
Cyclone II Multimedia Platform disposes several JUMP for OSC or
PLL clock. The user can apply widely. Take VGA_CLK for instance, the
designers can use 25MHz or PLLP4 for VGA clock input. In some occasion,
the clocks are limited, such as 24.576and 12.175, etc. Picture 2.23 shows the
positions of JUMP.
The following shows the jumps pin numbers.
SENSOR_SYSCLK JUMP
Num 1 2 3
SENSOR_PXCLK JUMP
Num 1 2 3
VGA_CLK JUMP
Num 1 2 3
FAST AS / AS JUMP
Num 1 2 3
(JP6)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP7)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP8)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP9)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP10)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP11)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
(JP12)
Address Signal Cyclone II FPGA Pins Address Signal Cyclone II FPGA Pins
The user should avoid not to alter the register due to the fact that most of the
requirement can be provided by the processor.
Table 2.1、CMOS Processor Register list
Table 2.2、CMOS Controller Register list
Table 2.3、Description
Table 2.4、CMOS Controller Register Description
2.4 CMOS Project
As Figure 2.14 shows
Figure 2.14
Step1:
Figure 2.15、RGB320x240.mif
Figure2.17、(Step 2)
Figure2.18、(Step 3)
Figure2.19、(Step 4)
Figure2.20、(Step 5)
Figure2.21、RGB320x240.mif (Step 6)
Figure2.22、(Step 7)
reg SDATA_Out;
reg SDATA_Out_En;
//--------------------------------------------------------
// Clock Generator
//--------------------------------------------------------
always @(negedge SYS_clk or negedge rst_n)
if(!rst_n) CLK_reg <= 7'b00000;
else CLK_reg <= CLK_reg + 1;
//--------------------------------------------------------
// Initiate WCmd
//--------------------------------------------------------
always @(rst_n)
if(!rst_n)
begin
WCmd <= {`Slave_ID,`Write};
end
//--------------------------------------------------------
// ROM State
//--------------------------------------------------------
always @(ROM_ADDR)
if(ROM_ADDR==`OpNum) OpFinish = 1'b1;
else OpFinish = 1'b0;
//--------------------------------------------------------
// Operand Data
//--------------------------------------------------------
always @(posedge FSM_CLK or negedge rst_n)
if(!rst_n) {OpAddr,OpData} <= 16'h0000;
else if(ReadOp_En) {OpAddr,OpData} <= ROM_DATA;
else {OpAddr,OpData} <= {OpAddr,OpData};
//--------------------------------------------------------
// SIE FSM
//--------------------------------------------------------
always @(posedge FSM_CLK or negedge rst_n)
if(!rst_n)
begin
ROM_ADDR <= 6'b000000;
ReadOp_En <= 1'b0;
SDATA_Out_En <= 1'b1;
SDATA_Out <= 1'b1;
BitCnt <= 3'b111;
CState <= `Idle;
end
else case(CState)
`Idle : begin
SDATA_Out_En <= 1'b1;
SDATA_Out <= 1'b1;
BitCnt <= 3'b111;
if(!SCL && !OpFinish)
begin
ReadOp_En <= 1'b1;
CState <= `Write_Start;
end
else
begin
ReadOp_En <= 1'b0;
CState <= `Idle;
end
end
//--------------------------------------------------------
// Write Comd routine
//--------------------------------------------------------
`Write_Start : begin
SDATA_Out_En <= 1'b1;
if(!SCL )
begin
CState <= `Write_Start;
SDATA_Out <= 1'b1;
end
else
begin
CState <= `Write_Cmd;
SDATA_Out <= 1'b0;
end
end
`Write_Cmd : begin
ReadOp_En <= 1'b0;
SDATA_Out_En <= 1'b1;
if(!SCL )
begin
SDATA_Out <= WCmd[BitCnt];
BitCnt <= BitCnt;
CState <= `Write_Cmd;
end
else
begin
SDATA_Out <= SDATA_Out;
BitCnt <= BitCnt-1;
if(BitCnt==3'b000)
CState <= `WWait1;
else
CState <= `Write_Cmd;
end
end
`WWait1 : begin
SDATA_Out_En <= 1'b0;
BitCnt <= 3'b111;
if(!SCL )
CState <= `WWait1;
else
CState <= `Write_Addr;
end
`Write_Addr : begin
SDATA_Out_En <= 1'b1;
if(!SCL )
begin
SDATA_Out <= OpAddr[BitCnt];
BitCnt <= BitCnt;
CState <= `Write_Addr;
end
else
begin
SDATA_Out <= SDATA_Out;
BitCnt <= BitCnt-1;
if(BitCnt==3'b000)
CState <= `WWait2;
else
CState <= `Write_Addr;
end
end
`WWait2 : begin
SDATA_Out_En <= 1'b0;
BitCnt <= 3'b111;
if(!SCL )
CState <= `WWait2;
else
CState <= `Write_Data;
end
`Write_Data : begin
SDATA_Out_En <= 1'b1;
if(!SCL )
begin
SDATA_Out <= OpData[BitCnt];
BitCnt <= BitCnt;
CState <= `Write_Data;
end
else
begin
SDATA_Out <= SDATA_Out;
BitCnt <= BitCnt-1;
if(BitCnt==3'b000)
CState <= `WWait3;
else
CState <= `Write_Data;
end
end
`WWait3 : begin
SDATA_Out_En <= 1'b0;
BitCnt <= 3'b111;
if(!SCL )
CState <= `WWait3;
else
CState <= `Write_Stop;
end
`Write_Stop : begin
SDATA_Out_En <= 1'b1;
if(!SCL )
begin
CState <= `Write_Stop;
SDATA_Out <= 1'b0;
end
else
begin
CState <= `Idle;
ROM_ADDR <= ROM_ADDR + 1;
SDATA_Out <= 1'b1;
end
end
endcase
//--------------------------------------------------------
// Output Declaration
//--------------------------------------------------------
assign SCL = CLK_reg[6];
assign SDA = (SDATA_Out_En) ? SDATA_Out : 1'bz;
endmodule
Step3:CMOS_I2C_s symbol
Figure2.1、CMOS_I2C_s
Step4:CMOS2Buffer (Verilog)
WCK,
WRST,
WE_n,
WDATA,
TST
);
endmodule
Step5:DispCtl (Verilog)
R[4:0] => {R[4:0], R[4:2]}
G[5:0] => {G[5:0], G[5:4]}
B[4:0] => {B[4:0], B[4:2]}
VSYNC,
HSYNC,
LCD_DATA
);
reg RE_n;
reg VSYNC;
reg HSYNC;
reg [7:0] LCD_DATA;
//--------------------------------------------------------
// LCD Interface Signal
//--------------------------------------------------------
//VSYNC
always @(negedge SYS_clk)
if(!SYS_rst)
begin
VCnt <= 19’b0;
Field <= 1’b0;
VSYNC <= 1’b1;
end
else if(VCnt==19’d409499)
begin
VCnt <= 19’b0;
Field <= ~Field;
VSYNC <= 1’b0;
end
else
begin
VCnt <= VCnt + 1;
Field <= Field;
VSYNC <= 1’b1;
end
//HSYNC
always @(negedge SYS_clk)
if(!SYS_rst)
begin
HCnt <= 11’b0;
HSYNC <= 1’b1;
end
else if(HCnt==11’d1559)
begin
HCnt <= 11’b0;
HSYNC <= 1’b0;
end
else
begin
HCnt <= HCnt + 1;
HSYNC <= 1’b1;
end
always @(HCnt)
if(HCnt>=’d19 && HCnt<’d1519) Hdisp_EN <= 1’b1;
else Hdisp_EN <= 1’b0;
//--------------------------------------------------------
// Frame Buffer Interface Signal
//--------------------------------------------------------
assign RCK = SYS_clk;
assign OE_n = 1’b0;
assign RRST = Vdisp_EN;
always @(negedge SYS_clk or negedge SYS_rst)
if(!SYS_rst)
begin
RE_n <= 1’b1;
PixState <= 2’b00;
OpFilter <= 2’b11;
end
else if(Vdisp_EN && Hdisp_EN)
case(PixState)
2’b00: begin
RE_n <= 1’b0;
PixState <= 2’b01;
OpFilter <= 2’b00;
end
2’b01: begin
RE_n <= 1’b0;
PixState <= 2’b10;
OpFilter <= 2’b01;
end
2’b10: begin
RE_n <= 1’b1;
PixState <= 2’b11;
OpFilter <= 2’b10;
end
2’b11: begin
RE_n <= 1’b1;
PixState <= 2’b00;
OpFilter <= 2’b11;
end
endcase
else
begin
PixState <= 2’b00;
RE_n <= 1’b1;
OpFilter <= 2’b11;
end
//--------------------------------------------------------
// LCD Data
//--------------------------------------------------------
always @(OpFilter_dly or DATA_tmp1 or DATA_tmp2)
case(OpFilter_dly)
2’b00: LCD_DATA = {DATA_tmp1[7:3],DATA_tmp1[7:5]};
2’b01: LCD_DATA =
{DATA_tmp1[2:0],DATA_tmp2[7:5],DATA_tmp1[2:1]};
2’b10: LCD_DATA =
{DATA_tmp2[4:0],DATA_tmp2[4:2]};
2’b11: LCD_DATA = 8’b00000000;
endcase
endmodule
Step6:
Figure2.24
Figure2.25、(Step 1)
Figure2.26、(Step 2)
Step8:Pin assigment
As Figure2.27
Figure2.27、Assignments
Figure2.28
Figure2.29
Figure2.30、TFT-LCD
Step9:Compile
Figure2.31