I have a question related to AVR microcontrollers using AVR-GCC and CodeVision:
Normally we set the port related registers inside the main function using DDRx/PORTx registers, for example like this:
DDRB = 0x00; PORTB = 0x00;
How can I change the content of these registers in other places of the program?
And another question, is it wise to set DDRx and PORTx registers using the following way: