I try to understand AVR ATMega GPIO ports.
I understand that the PINn register is intended for reading data, but via binary operations it is possible to write data to it.
What happens in this case? On some sites it is written that for the ATMega controllers a logical 1 change the PORTn register state.
What will happen in other situations?
Thank you.
13.2.2 Toggling the Pin
Writing a logic one to PINxn toggles the value of PORTxn, independent on the value of DDRxn.
Note that the SBI instruction can be used to toggle one single bit in a port.