lpcware

lpc1114 GPIO problem

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by mshrestha789 on Tue Jan 17 22:04:02 MST 2012
I am having problem with masking the bit for reading and writing operation.
Here's what I am doing

LPC_GPIO0->DIR |= (1<<3)|(1<<5);
LPC_GPIO0->MASKED_ACCESS[(1<<3)|(1<<5)] = (1<<3)|(1<<5);

In above code, it is suppose to mask only 3rd and 5th bits of GPIO 0. Bit it masks all bits.
Another strange thing I notice that in above code, replacing
LPC_GPIO0->MASKED_ACCESS[(1<<3)|(1<<5)] = (1<<3)|(1<<5);
with
LPC_GPIO0->MASKED_ACCESS[0] = (1<<3)|(1<<5);
makes no difference. Here in place of 0, writing any number makes no difference.

Can any one help??

Outcomes