XK-1A individual pin control

Technical questions regarding the XTC tools and programming with XMOS.
cicga
Active Member
Posts: 51
Joined: Tue Oct 11, 2011 4:48 pm

XK-1A individual pin control

Post by cicga »

Hi all,

is it possible to control individual pin in port?

something like this:
#define a as XS1_PORT_4A0;
#define b as XS1_PORT_4A1;
#define c as XS1_PORT_4A3;

...
while(1){
a<:1;
b<:0;
c<:1;
.......
}

best

cicga


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

No.

You will need to use the 1-bit wide ports.
I must admit that the 1-bit ports are scarce.

If they are all outputs you can buffer the state of the port in a variable, do bit manipulations on the variable and write the variable to the port.
Or read back the value of the port and then do a bit manipulation and write back the value.