I would like to know if I can write data to a port data register (for ex. PORTB) when some of the PORTB pins are used as an alternate pin function. On my development board (Atmega328P) pin 6 and 7 (XTAL 1 and XTAL 2) of PORTB are used for an external XTAL. I looked in the complete datasheet from the Atmega328P but wasn't sure if the information that I found answers my question. It looks like the answer can be found in table 14-4 on page 84 "Overriding Signals fo Alternate Functions".
My reasoning is that DDOE (Data Direction Override Enable) somehow is set when a clock is selected with the fuse bits. Then when DDOE is set, the output driver is disabled by DDOV (which is zero in all cases for PB7 and PB6 according to table 14-4). Is my reasoning correct? If yes then how DDOE is set (1)?