Hi Electro-Tech users,
I am using ATmega16 AVR,
I want to copy data of one port to other port.
I have written following code in embedded C.
but the above code does not copy the data to PORTB
Please let me know the mistake in the above code.
I am using ATmega16 AVR,
I want to copy data of one port to other port.
I have written following code in embedded C.
Code:
DDRA = 0x00; [COLOR="Green"]//PORTA is a input port[/COLOR]
DDRB = 0xFF; [COLOR="Green"]//PORTB is a output port[/COLOR]
while(1)
{
PORTB = PORTA;
}
but the above code does not copy the data to PORTB
Please let me know the mistake in the above code.