read-modify port
2003-12-27 by mirza_4
Hi, all...
i have implemented dtmf generator on 2313.
now i need to use other Port B pins as general IO.
i use the following code to read PORTB0 state and then write it back:
void modifyPortB (void)
{
unsigned char temp, temp1;
temp = PORTB;
temp1 = temp;
temp1 &= 0xfe;
temp = ~temp;
temp &= 0x01;
PORTB = (temp1 | temp);
}
but with oscilloscope i observe a "glitch" on PWM signal.
Any suggestions?
TIA
-mirza-