Looking for advice on using USBUART in an interrupt driven mannor on the PSoC5LP | Cypress Semiconductor
Looking for advice on using USBUART in an interrupt driven mannor on the PSoC5LP
I would like to "connect" a USBUART device to a regular UART device in the same PSoC5LP. I have the added a UART and USBUART component to my existing design and have had success in interfacing them in software. When a byte arrives on the CDC interface I queue it for delivery on the UART and when a byte arrives on the UART I write it to the USBUART.
At slow speeds everything works fine, however I have noticed that Windows seems to send data to the USBUART faster than the 115,200 baud rate that I configured the interface for, which overwhelms the PSoC with data.
Also, I am implementing this in an interrupt driven framwork so I need to be interrupted when data arrives on the USBUART. I assue that this is the common use model but I cannot find any reference or example code to do this.
I had some luck putting a callback function in the auto-generated function: USBUART_EP_3_ISR() to signal that data arrived, but I am not confident that this is a safe/efficient way to react to incomming data.
I have read the USBUART and UART datasheets and I am pretty comfortable using them, however I am looking for some more information on the USBUART, specifically:
1) Is it my imagination or does data transfer faster than the specified baud rate (i.e. 115,200 baud) when using a CDC driver like the one generated by PSoC Creator? If so, is there a way in software (PSoC firmware or CDC inf file) to slow down the transfer?
2) How do I use the USBUART, specifically the RX part, in an interrupt driven manor? What should I tringger my ISR on?