This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Minimize CPU time used by BLE

My application is doing kind of old communication with an old machine. Communication line is bit banged by an GPIO. Baud rate is 0.5ms. "Start bit" is still used to synchronized the start of a packet. I use GPIOIE to get the start bit, then Timer2 is used to receive 8 bit data and sending back a 8 bit response byte. So very simple.

Without BLE enabled, the communication is fine. Wth BLE enabled, the communication is almost OK, except missing data every 5 to 10 minutes.

I believe the reason is timer2 or GPIO interrupt get bumped off by BLE interrupts once for a while when they happen at the same time.

I only need to bring data corruption ratio into an acceptable range.

The BLE feature is minimum in this application, as long as smartphone can change 2 parameters. So I want to make the BLE stack lowest priority and minimize the time occupied by BLE stack, and anything I can do to minimize the BLE activity.

Thanks

Paul

Parents
  • Good idea. I can schedule the time slot just a little earlier before the 240ms event to make sure I get the start bit and then schedule another 16 time slots to check the incoming bits and bang out response bits. I am using SDK12.0.0 on other projects which has peer manager module. I noticed that SDK10.0.0 has fstorage and fds as experimental and a BLE relay example using peer manager. Is there any known reason that I cannot use peer manager came with SDK10.0.0?

Reply
  • Good idea. I can schedule the time slot just a little earlier before the 240ms event to make sure I get the start bit and then schedule another 16 time slots to check the incoming bits and bang out response bits. I am using SDK12.0.0 on other projects which has peer manager module. I noticed that SDK10.0.0 has fstorage and fds as experimental and a BLE relay example using peer manager. Is there any known reason that I cannot use peer manager came with SDK10.0.0?

Children
No Data
Related