always @ (posedge Clkin,negedge Resetb)
if(!Resetb)
begin
DataIN<=16'd0;
//StartM<=0;
//CodeOUT<=16'd0;
//ROUT<=0;
//POUT<=0;
//YOUT<=3'd0;
LED1<=0;
LED2<=0;
LED3<=0;
LED4<=0;
LED5<=0;
LED6<=0;
SETCode<=16'd0;
MRun<=0;
Cnt1<=2'b0;
end
else
begin
SETCode<=16'd30000;
case(Cnt1)
2'b00:
begin
if(!StartM)
begin
Cnt1<=2'b01;
end
else
begin
Cnt1<=2'b0;
end
end
2'b01:
begin
MRun<=1;
if(YOUT==3'b001)
begin
Cnt1<=2'b10;
end
else
begin
Cnt1<=2'b01;
end
end
2'b10:
begin
MRun<=0;
Cnt1<=2'b0;
end
endcase
end
又用万用表测试了一下复位信号,在按下复位开关时,电平由3.29V变为0。01V,复位信号应该是有了,可是板子还是没反应,CPLD好任性啊
always @ (posedge Clkin,negedge Resetb)
if(!Resetb)
begin
DataIN<=16'd0;
//StartM<=0;
//CodeOUT<=16'd0;
//ROUT<=0;
//POUT<=0;
//YOUT<=3'd0;
LED1<=0;
LED2<=0;
LED3<=0;
LED4<=0;
LED5<=0;
LED6<=0;
SETCode<=16'd0;
MRun<=0;
Cnt1<=2'b0;
end
else
begin
SETCode<=16'd30000;
case(Cnt1)
2'b00:
begin
if(!StartM)
begin
Cnt1<=2'b01;
end
else
begin
Cnt1<=2'b0;
end
end
2'b01:
begin
MRun<=1;
if(YOUT==3'b001)
begin
Cnt1<=2'b10;
end
else
begin
Cnt1<=2'b01;
end
end
2'b10:
begin
MRun<=0;
Cnt1<=2'b0;
end
endcase
end
又用万用表测试了一下复位信号,在按下复位开关时,电平由3.29V变为0。01V,复位信号应该是有了,可是板子还是没反应,CPLD好任性啊
一周热门 更多>