While writing Far Inside The Arduino: Nano Every Supplement I uncovered some errors in the Microchip (Atmel) documentation.
In Timer/Counter B Single-Shot mode, setting EDGE=1 is supposed to generate a pulse on the negative edge of the event signal. Instead it generates a pulse on both edges of the event signal.
In the SPI, the Receive Complete (IF) interrupt flag is supposed to be cleared automatically upon entering the ISR. This is not the case. The flag must be cleared by writing “1” to it.
Also in the SPI, the RXCIF interrupt flag is set when there is contents in the receive buffer and cleared when the receive buffer is empty. The documentation states it can also be cleared by writing a “1” to the flag, however this doesn’t make sense.
The USART TXCIF flag documentation says get cleared automatically when the interrupt routine for TXC is entered, however this is not the case. The flag must be cleared by writing “1” to it.
As mentioned previously, if the Timer/Counter A event input is used, the clock prescaler will not work correctly for Timer/Counter B. This is not documented.
In some cases peripheral devices automatically override pin direction for output functions and in some cases they don’t. Because of this uncertainty, it is best to manually set the direction of all output pins to be outputs.
(By the way, I’m currently waiting to receive the proof copy of the book. I expect it this weekend, and with luck the book will become available, both printed and Kindle format, on August 25th. )