Microcontroller › AVR › AVR PORT pins › thanks for the replywhat
November 17, 2011 at 11:40 am
#6848
Ashutosh Bhatt
Participant
thanks for the reply
what happens in proteus simulator that i tell u
if the following code is written to blink the LED then it blinks fine
PORTD = (1<<PD0);
_delay_ms(1000);
PORTD = (0<<PD0);
but if the code is
PORTD|= (1<<PD0);
_delay_ms(1000);
PORTD| = (0<<PD0);
then it stays on. no blinking
but again if the code is changed to
PORTD|= (1<<PD0);
_delay_ms(1000);
PORTD& = ~(1<<PD0);
led starts blinking
so my questions is why and how?