Post comments on this article and find any associated files and/or downloads at www.nutsvolts.com/
index.php?/magazine/article/september2015_DesignCycle.
USART Firmware
Let’s begin by setting up the USARTs.
We only have to write this code once as the
USART setup procedure is identical for both
PICs. Our USART drivers will transmit on
demand and receive via interrupt. The
receive interrupt mechanism is assisted by a
ring buffer. Each USART we activate will be
attached to its own ring buffer. A ring buffer
identical to their PIC32MX575F512H counterparts. This
design also includes a 32.768 kHz crystal to drive the