Skip to main content
xleij
Associate II
August 22, 2018
Solved

any method to modify uart idle detection time

  • August 22, 2018
  • 5 replies
  • 1556 views

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.

    This topic has been closed for replies.
    Best answer by Bob S

    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".

    5 replies

    xleij
    xleijAuthor
    Associate II
    August 23, 2018

    any suggestions?

    T J
    Senior III
    August 23, 2018

    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
    Bob SBest answer
    Super User
    August 23, 2018

    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
    xleijAuthor
    Associate II
    August 24, 2018

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

    xleij
    xleijAuthor
    Associate II
    August 24, 2018

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