Behavior of pinseq and pinsneq on buffered ports

Technical questions regarding the XTC tools and programming with XMOS.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Behavior of pinseq and pinsneq on buffered ports

Post by kster59 »

Is it possible to use pinseq/pinsneq on a 1 bit port that's buffered greater than the number of bits?

For example, can I use:
out buffered port:32 ONEBITBUFFERED = XS1_PORT_1A;
unsigned data;
ONEBITBUFFERED when pinseq(0) :> data;

So it will wait until ONEBITBUFFERED is 0 then read serially 32 bits or will it continuously serially read 32 bits and wait until all 32 bits are 0?


richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

Yes you can use pinseq() / pinsneq() with buffered ports when the transfer width is greater than the port width. The comparison is done against the port-width bits of data sampled from the pins and not on the entire shift register. When the condition is met the value returned is the contents of the shift register at the point the condition was met with the data that matched the condition in the most significant position.

See section 15.10 Buffered Transfers of the The XMOS XS1 Architecture for more details.