Is UART Flow Control really possible on PSoC6 (CYBLE-416045)?

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

cross mob
WiFl_1166056
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

I am trying to transfer data via UART into an FTDI USBUART cable at ~1MBaud.  This works good except the receive buffer overflows, causing data loss.  I have not been able to get any hardware or software flow control to work on CYBLE-416045-EVAL.

It appears that the CYBLE-416045 module does not have any combination of IO pins available for any SCB to use hardware flow control (CTS).  The fitter always fails to find a pin for CTS.  For some mysterious reason, the architecture requires the CTS pin to be a very specific option on the same port as the Tx/Rx pins.   This seems like a silly oversight as any IO pin should be able to be routed to this signal.  I also tried exposing the UART terminals in the schematic view (PSoC Creator 4.4) to see if I can use an internal signal, like a register component, but it requires connection to a dedicated IO pin; another very silly design oversight.

The FTDI cable can also send Xon/Xoff bytes, which I am able to receive and process.  However, I can't find any way to halt the transmission of bytes already in the UART Tx buffer.  I am transferring packets of 44 bytes at a time. 

If I simply disable the UART, then all the untransmitted bytes in the buffer are lost.  I have not found a way to determine how many bytes are thrown out (so I can send them later).  I found this function:  Cy_SCB_UART_GetNumLeftToTransmit(UART_1_HW, &UART_1_context);  but it always returns zero.  Looking in the UART_1_context struct (in the debugger) it always shows the buffer as done transmitting, however the oscilloscope shows that many bytes are still transmitted even after this function is called (I toggle an IO pin to see exactly when the function has been called).

If I rewrite my transmit function to send byte-by-byte and check if Xoff has been received, then I would kill my throughput speed and/or cause a huge unnecessary burden on the CPU.

Does anyone know how to actually pause the UART transmitter, or how stop it without loosing data in the buffer (or just get an accurate count of untransmitted bytes)?

Thanks in advance!

-Will

0 Likes
1 Solution
MiZu_4805356
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

I have no CYBLE-416045 but I quickly found id documentation following:

According to CYBLE-416045 (module) datasheet (Document number: 002-24085 Rev. *A) there are exposed CTS signasl of SCB1, SCB2, SCB5 and SCB6.

Following screenshot shows mapping table with higlighted CTS mapping for SCB1 and 2. Mapping for 5 and 6 you can find in the same document at next pages. Note that this is mapping for module and not a evaluation board.

pastedImage_0.png

So now, you need to find where P10_3 and P9_3 are exposed on your evaluation board (CYBLE-416045-EVAL). According to schematics they are both exposed on arduino connectors (green arrows).

pastedImage_1.png

You can find both connectors J5 and J6 and P9_3 and P10_3 pins using following image but proably pin labels are also printed on physical board.

pastedImage_2.png

View solution in original post

0 Likes
2 Replies
MiZu_4805356
Level 2
Level 2
10 sign-ins 5 replies posted 5 sign-ins

I have no CYBLE-416045 but I quickly found id documentation following:

According to CYBLE-416045 (module) datasheet (Document number: 002-24085 Rev. *A) there are exposed CTS signasl of SCB1, SCB2, SCB5 and SCB6.

Following screenshot shows mapping table with higlighted CTS mapping for SCB1 and 2. Mapping for 5 and 6 you can find in the same document at next pages. Note that this is mapping for module and not a evaluation board.

pastedImage_0.png

So now, you need to find where P10_3 and P9_3 are exposed on your evaluation board (CYBLE-416045-EVAL). According to schematics they are both exposed on arduino connectors (green arrows).

pastedImage_1.png

You can find both connectors J5 and J6 and P9_3 and P10_3 pins using following image but proably pin labels are also printed on physical board.

pastedImage_2.png

0 Likes
WiFl_1166056
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

I'm marking this as the solution to give credit to for his very thorough response. 

Unfortunately, I tried to implement it with an FTDI USB-UART cable, but received errors I believe are due to the FTDI chip.  I don't recall now, exactly what the error was.

I am still interested in a method to implement software flow control (XON/XOFF), but my project is now focusing on transmitting via BLE (and sending compressed binary data rather than ASCII decimal values).

0 Likes