why do i have to set FIOMASK every time

30 Jun 2010

Interestingly, the new PortOut function still isn't fast enough for my application. So I grabbed my old code that worked. But I can't understand why I need to call every time:

LPC_GPIO0->FIOMASK = ~(NT2_N|NT2_P);

otherwise the voltage level on the pins can't be set correctly, if I just set the mask once.

I must have copied it from someone else's example.

Please help.

 

 

#define NT2_N (1<<9) //DIP5

#define NT2_P (1<<10) //DIP28

 

void NT2_HIGH() {

LPC_GPIO0->FIOMASK = ~(NT2_N|NT2_P);

LPC_GPIO0->FIOPIN = (NT2_N|NT2_P);  //11

}