For various reasons I decided to use the strobe function essentially like below. Assume (just to get numbers) that the word_select signal has period of 1ms (1kHz). So obviously it will be high 500uS and low 500uS. Each sample is 16 bit so the "p_clock_in" is 32kHz.
So I'm reading a 16 bit sample while the strobe (word_select) signal is high as below.
Code: Select all
in buffered port:32 p_in = XS1_PORT_1A;
in port p_word_select = XS1_PORT_1B;
in port p_clock_in = XS1_PORT_1C;
clock clk = XS1_CLKBLK_1;
myReadTask() {
configure_clock_src ( clk , p_clock_in ) ;
configure_in_port_strobed_slave ( p_in , p_word_select , clk , 0) ;
start_clock ( clk ) ;
unsigned dataIn;
timer tmr;
unsigned tStart, tStop;
while (1) {
tmr :> tStart;
p_in :> dataIn;
tmr :> tStop;
printintln((tStop-tStart) / 100);
}
}
So it seems that the strobe input only inputs 16 bits to the buffered port (as expected), but waits the full 32 cycles to return!
This of course waste 500uS that I intended to use for code that makes the strobe input useless...