GPIO on LPC2106

Hello,

i want to switch between 2 different states on 2 I/O Pins at the same time. For examble P0.0 is high an P0.1 is low - so i want P0.0 to low and P.1 to high with one instruction.

In C-Code i have to use IOCLR and IOSET to switch the pins. Is there a possibility to do this with only one instruction?

In the datasheet I found the IOPIN instruction in the GPIO section. It is signed as ReadOnly. But if i write: IOPIN ^= 0x3, the PINS will switch to the states at the same time. But normally (like it is discribed in the datasheet) it shouldn’t work. So does anyone know a better solution for my problem or is the datasheet not correct and the IOPIN instruction is for reading and writing?

Check the IOPIN register description at the top of page 82 of the LPC2106 User Manual (Rev 5); it describes writing to the IOPIN. Its possible, the problem is the you must modify all 32 bits per write. This can quickly become a hassle when multiple independent peripherals are connected.

Hope this helps,

Vern