interrupt word read from 32 bit buffered port

Technical questions regarding the XTC tools and programming with XMOS.
stefanharjes
Member
Posts: 13
Joined: Wed Jun 01, 2011 7:33 pm

interrupt word read from 32 bit buffered port

Post by stefanharjes »

Hi there,

I use the simple loop:

Code: Select all

	
while(1) {
		start_clock(ltc.blk);
		//read value from 'in buffered port:32'
		ltc.miso :> wert;
		//stop clocking
		stop_clock(ltc.blk);
}
to read a adc @50MHz using spi. However, I only need the first 18bits from the device. Is it possible to interrupt the read and simply read out the fifo after a certain time? I saw the

Code: Select all

{twidth_t, counter_t} getHead(FIFO f)
function in the IO specification. Anyone used that and would care to share a usage example?

Best regards
Stefan


User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Is the input port a 1-bit port?

You can use the partin() function (see xs1.h)