I got the I2C/TWI interface working as master and slave simultaneously, so finished that chapter. I didn’t add the non-blocking functions but explain how to easily modify the code to achieve it. Turns out there is a comment in the source explicitly mentioning that Arduino likes blocking functions and the comment is on the statement that does the blocking!
My RS485 interface boards arrived. They have a MAX485 transceiver IC on them with the balanced line driver. My demo program worked perfectly with them. One issue was that the XDIR pin is only accessible on one of the USARTs, and I needed XDIR on two. The solution was easy — I used the Event System to route the inaccessible XDIR pin to an accessible pin. I’m really liking the idea of the Event System, which is a feature not taken advantage of in the Arduino Library.
The top trace is the TXD of the first USART, the next three are the A-B, A, and B signals of the differential pair. The bottom trace is the RXD of the second USART. The right side of the display shows the communication back from the second USART to the first. Unfortunately I only have a four channel scope, so I can’t show the remaining signals here.
There are just a few loose ends to write up and then it’s time to go over the manuscript in detail to check for errors and confusion. I should be able to get the book up on Amazon by the end of August.