cancel
Showing results for 
Search instead for 
Did you mean: 

any method to modify uart idle detection time

xleij
Associate II

Hi guys,

I use uart idle interrupt to handle BLE passthrough, but because ble module don't buffer data received from ble,if the baudrate is 115200bps, there will be some gaps within one packet(it should be uart transfer rate is higher than ble rate), for example there will be 8 gaps within one 14 bytes packets. Our host will have more high priority task to do, so I can't accept so many interrupts to handle one packet. So any method to increase uart idle detection time.

If I don't use uart idle interrupt, I will have to  align the packet size to a multiple of a fixed size.

this is not what I want, though this works.

1 ACCEPTED SOLUTION

Accepted Solutions
Bob S
Principal

Do you have a spare timer (that has trigger inputs)? If so, you can run the serial RX signal to one of the timer inputs. Configure the timer in up-counting mode and have the trigger input reset the counter (on falling or rising edge, doesn't matter). Set the compare register for a time period longer than the intra-character pauses from your BLE module so the counter only hits the compare value when there really is not more data from the BLE. Then interrupt on the timer compare for "end of message".

View solution in original post

5 REPLIES 5
xleij
Associate II

any suggestions?

T J
Lead

If you run a resistor Parallel with a diode from the Rx pin to a cap, and then take the cap voltage into a comparitor pin. interrupt on the rising edge.

if you consider worst case "0xff" then the startbit saves us.

I can draw a diagram if you want..

Bob S
Principal

Do you have a spare timer (that has trigger inputs)? If so, you can run the serial RX signal to one of the timer inputs. Configure the timer in up-counting mode and have the trigger input reset the counter (on falling or rising edge, doesn't matter). Set the compare register for a time period longer than the intra-character pauses from your BLE module so the counter only hits the compare value when there really is not more data from the BLE. Then interrupt on the timer compare for "end of message".

xleij
Associate II

seems ​feasible. Thanks you two. I will have a try.

xleij
Associate II

how to comment on someone's reply? @Bob S​ @Community member​