I've made a simple LED display controller. AtMega32 is directly driving the LEDs and commands are sent using serial communication. The software is very simple. An interrupt is fired when something is received in serial and the ISR sets the PORTx registers according to the command received.
Now I've noticed that I need a way to control the brightness of the LEDs. Therefore I need PWM.
The question is if there is a way to do it without touching the PORTx registers? Could I just set the ports as inputs through DDRx registers when the LEDs should not illuminate? Should I also disable the pull-up resistors with PUD bit in SFIOR?