|
实现的功能:SPI slave接收到一个数据存到FIFO_i中,进行加1处理然后传给FIFO_o通过SPI slave端传回。
实验结果:接收到的数据前端多了18位,此18位均为0。
always @(posedge clk)
begin
if(~SSEL_active)
begin
count2<=0;
count3<=0;
end
if(SSEL_active)
if(byte_sent_int)
begin
byte_data_sent <= byte_data_tosent;
count3<=1;
end
if(count3==1)
if(SCK_fallingedge)//SCK_risingedge
begin
if(count2<15)
begin
byte_data_sent <={byte_data_sent[14:0], 1'b0};
count2 <= count2 +1;
end
if(count2==15)
begin
count2<=0;
end
end
end
assign MISO = byte_data_sent[15];
发送数据:0x00 0x03 0x00 0x07 0x00 0x0b 0x00 0x0f 0x00 0x13 0x00 0x17 0x00 0x1b 0x00 0x1f
接收数据:0x00 0x00 0x00 0x01 0x00 0x02 0x00 0x03 0x00 0x04 0x00 0x05 0x00 0x06 0x00 0x07
窜了18位呢,怎么回事呢,请教!~~ |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|