исключаться должно программно. МК набил фифо записи как командами чтения, так и записи, например. А потом ждет ответа от фифо чтения.
в сигналы от фифо чтения все сильно и уперлось -- теперь пытаюсь понять Ваш метод с синхронизацией.
помогите разобраться с этим кодом
из
http://electronix.ru/forum/index.php?showtopic=93650посмотрите как по ссылке сделан SPI .
http://www.fpga4fun.com/SPI2.htmlВот в этом блоке привязывают внешний клок spi к внутренним клокам плис
------------------------------------------------------------------------------------------------------------------------------
We sample/synchronize the SPI signals (SCK, SSEL and MOSI) using the FPGA clock and shift registers.
// sync SCK to the FPGA clock using a 3-bits shift register
reg [2:0] SCKr; always @(posedge clk) SCKr <= {SCKr[1:0], SCK};
wire SCK_risingedge = (SCKr[2:1]==2'b01); // now we can detect SCK rising edges
wire SCK_fallingedge = (SCKr[2:1]==2'b10); // and falling edges
// same thing for SSEL
reg [2:0] SSELr; always @(posedge clk) SSELr <= {SSELr[1:0], SSEL};
wire SSEL_active = ~SSELr[1]; // SSEL is active low
wire SSEL_startmessage = (SSELr[2:1]==2'b10); // message starts at falling edge
wire SSEL_endmessage = (SSELr[2:1]==2'b01); // message stops at rising edge
// and for MOSI
reg [1:0] MOSIr; always @(posedge clk) MOSIr <= {MOSIr[0], MOSI};
wire MOSI_data = MOSIr[1];
Что тут происходит?