1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00

Fixing serializer bug

- SPI now working...
This commit is contained in:
Andreas Olofsson 2016-03-10 17:03:38 -05:00
parent da6856befa
commit ed8d29ee2c

View File

@ -57,16 +57,20 @@ module oh_par2ser (/*AUTOARG*/
if(~nreset)
count[CW-1:0] <= 'b0;
else if(start_transfer)
count[CW-1:0] <= datasize[CW-1:0];
else if(shift & access_out)
count[CW-1:0] <= datasize[CW-1:0]; //1=1 byte
else if(shift & busy)
count[CW-1:0] <= count[CW-1:0] - 1'b1;
assign access_out = (count[CW-1:0]==1'b1);
//output data is valid while count>0
assign access_out = |count[CW-1:0];
assign busy = |count[CW-1:0];
//wait until valid data is finished
assign wait_out = access_out |
assign wait_out = busy |
wait_in;
//##########################
//# SHIFT REGISTER