Node to Node Uart Communication Echo Test Issue

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
jaro_4346051
Level 2
Level 2
First like received First like given

Hello,

I am working on a project where a custom piece of hardware is using a PSoC 5LP as the controller, this hardware will be called a node. The project is composed of many of these nodes, connected together in a network like a linked list. Each node has a north and south port and each port has its own Full Duplex Uart. Each node also has a debug port which is used for a console and is the only way I can interface the node with the computer.

Each node has the same external crystal (70.77888 MHz) and each Uart is running on 737280 baud (master clock divided by 12, 8x oversampling then gives rate). I am using external Rx Interrupts on byte received for the Uarts and have written my own Uart C and H files to allow for my project to interface with the demands I need. This file is called UartHandler.c/.h. I have created an echo project where one node will send a buffer of length 288 to the other node. The other node will check if the bytes follow the proper format (proper format predetermined to ensure Uarts are not mis-reading bytes), then ping the array back. This will happen back and forth forever.

Unfortunately after a random number of times (usually under 20) one of the Uarts has a Timeout because it receives less than the 288 bytes. Because the clock rates of each node are the same I should not be experiencing byte misses like this.

If someone could look at my UartHandler file and let me know if there are any blatant logic issues that would be appreciated.

I have attached my project below. Thank you.

0 Likes
1 Solution
DoBa_1705086
Level 3
Level 3
First like received First like given

At this high data rate you most definitely should switch to using DMA rather than interrupts to handle the I/O.  I would be quite easy to overrun the UART's internal buffer while handling interrupts on the other port.  Configure the UART for the maximum 16 bytes of internal buffering as well for an extra margin of safety. 

Also consider the signal integrity of the UART interconnect.  You did not indicate if you are using RS232 or RS48X signaling.  Transmission line effects and cross-coupling between Rx and Tx wires will start to come into play with long cable lengths.  You might also have challenges with ground loops, so watch your system ground integrity carefully!  Differential signaling might be necessary for long cable runs.

Doug

View solution in original post

7 Replies