> 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?
Try this :
PORTB ^= 1;
Which does the same as your code. (Which I don't understand the purpose of).
/Jesper
www.yampp.comMessage
Re: [AVR-Chat] read-modify port
2003-12-27 by Jesper Hansen