I am developing some SYS/BIOS based code for a new device.
The unit uses a MSP430F5419A running at 25Mhz. Two of the
USCI ports are connected to the UARTs on two different
modules. The purpose of the device is to act as a bridge
between the two modules, translating the byte streams
into formats understood by the other module. Both USCI
ports are set to 115200 baud.
I'm using DMA for handling the input data and using
interrupts to send the outgoing data. The DMA uses
a Repeated Single Transfer setting which puts the
incoming data into a circular buffer. Every 2 msec,
a SYS/BIOS task checks for new data, collects it,
does the translation, and queues it for transmission
on the other USCI port. There are two such tasks,
one for each port.
The code works very well most of the time and it is
able to handle multiple kbytes of data transfer.
However, sometimes a data byte gets dropped.
I added some code in the interrupt handler that
checks the status register (UCAxSTAT) when sending
data out a USCI port. At random times, the status
register shows that the UCOE (USCI_A_UART_OVERRUN_ERROR)
is set, indicating an incoming data overflow error.
It will happen on both USCI ports. On one and only one
of the ports, the UCRXERR bit is also set when the
error condition occurs.
I have tried both enabling and disabling the DMA
RoundRobin bit with no change in behavior. I've also
changed task priorities and multiple other tweaks
with no success.
My question is what can cause the UCOE bit to be set
during a DMA transfer?
Thanks in advance for any suggestions or answers!