ATmega4809 Odds and Ends

All of the USART examples are done but for RS-485. I originally was going to skip this since it is so similar to “1-wire” operation, but then decided to buy some RS-485 drivers and give complete USART coverage with examples. This chapter should be finished by the end of next week after the parts arrive.

Every chapter I write I think I’ve found at least one error in Microchip’s documentation. It’s usually something with interrupt flags or configuration of pins. All I can say is it’s a good thing I’ve been writing example programs for all the features to test things out. There are also some typos, but those are easy to uncover. And there will probably be many such errors in my books as well. I don’t claim to be perfect, just that my example programs work.

Because I seemed to have a free day this week, I wrote the small chapter on the Watchdog Timer. I only discuss differences between the ATmega4809 and the older ATmega328, and the WDT is somewhat different. It now has windowing, such that a wdt_reset too soon will cause a system reset. However it is actually easier to use. The example program for the WDT parallels the functionality of the one in Far Inside The Arduino but for the added windowing.

Next up is the TWI/I2C interface, but I am also considering what to do with the Configurable Custom Logic feature. The microcontroller, as mounted on the Arduino Nano Every board, is missing connections for lots of pins, which reduces the practicality of the CCL feature. So it will take a lot of explaining for probably little gain. A suitable, simple example may be tricky to devise.