2018-08-21 11:59 PM
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.
Solved! Go to Solution.
2018-08-23 07:14 AM
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".
2018-08-22 06:39 PM
any suggestions?
2018-08-22 08:08 PM
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..
2018-08-23 07:14 AM
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".
2018-08-23 10:18 PM
seems feasible. Thanks you two. I will have a try.
2018-08-23 10:20 PM
how to comment on someone's reply? @Bob S @Community member