Is is possible to address individual bits of I/O ports?

If you have a simple question and just want an answer.
User avatar
acid3
Newbie
Posts: 1
Joined: Sat Jan 04, 2014 9:33 pm

Is is possible to address individual bits of I/O ports?

Post by acid3 »

I'm very new to programm 32-bits and XMOS its firts "big" microprocessor. I used to work with AtMega's 8-bit with GCC. 

I'm wonder is it possible to work with I/O ports (pins) like Atmega do.

I mean somthine like that:

PORTx |= (1<<1) - to set pin HIGH and absolutley leave others as is

PORTx &= ~(1<<1) - to set pin LOW and leave others in their actual state?

Most important is P32A port .



User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

It is not possible to read or write particular bit of an multi bit port. You can write data by using the following example code:

If you need to write data to a 32 bit port and if you need to write data only on to bit 0 of this port,

port_a :> data;

port_a <: data | (new_data & 0x01);