Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

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-

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.