I'm working on an application that requires control of multiple devices from a single USB_UART/hyperterminal connection.
My solution was to use the CY8C5888 devices used on the CY8CKIT-059 as it has worked in a similar prototype application.
I've designed a custom board that uses three (3) CY8C5888LTI-LP097 PSOCs. One PSOC uses the USB_UART component to interface to a PC to allow hyperterminal control of two switches to turn on supply voltage to the other two separate PSOC devices. Once powered, these secondary devices may then be used to communicate via UART to the main USB_UART device. I decided to play with the MUX components and just use a single UART whose external connections are selected based on hyperterminal commands. When sending UART commands to the secondary devices, they are programmed to reply with an acknowledgement message.
So far, the main USB_UART controller device appears to be working well for just hyperterminal communications back to the PC. The UART/MUX switch part seems to work fine, and enabling power to the other two PSOC devices works ok as well. However, when I try to talk to the other devices over UART, I get mixed results. Mostly, I am getting incomplete messages and/or the acknowledgement messages from the remote devices seem to be delayed by 1 message.
I'm sure there is something I'm doing wrong either with buffer sizes, or how I'm reading the UART messages back from the secondary PSOC devices, or something else. Since I will ultimately need to send and receive more than 4 bytes at a time I have been setting the UART TX and RX buffers to numbers greater than 4 which I have read generates an internal interrupt, which is hopefully being handled by the while (UART_GetRxBufferSize() ) loop... My concern is that there is another USB_UART device that is also generating interrupts that I might not be handling correctly.
For completeness, I've had something similar to this working with just the CY8CKIT-059... where the kitprog device was ONLY relaying hyperterminal commands to the single CY8C5888 target device over UART and it seemed to work ok.. with the target sending full messages back as expected. Right now, I'm just turning LEDs on and off via GPIO on the secondary PSOC devices... which is currently working. Since that part worked, I strongly suspect that my "problem" code is on the USB_UART side. I've read through the UART data sheet as well as the following forum posts, but am still a bit confused how to get this working correctly.
I'm uploading the project for the USB_UART side in hopes that someone can shed some light on what I might be doing wrong.
Thanks in advance.