Page 786 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 786
if(!reset)
cnt_50ms <= 0;
else
begin
if(state == delay_50ms)
begin
if(cnt_clk == 249999)
begin
if(cnt_50ms == 9) //5ms * 10
cnt_50ms <= 1'b0;
else
cnt_50ms <= cnt_50ms+1'b1;
end
end
else
cnt_50ms <= 0;
end
end
// LCD 문자출력 회로
always @ (posedge clk, negedge reset)
begin
if(!reset)
line <= 0;
else
begin
if(state == display_data)
begin
if(cnt_clk == 249999)
begin
if(line >= 34)
line <= 1'b0;
else
line <= line+1'b1;
end
end
else
line <= 0;
end
end
- 779 -