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

slow BLE button repeat rate nRF52840 to Android and Windows

Hi,

I am new to the Nordic Semi world, having recently purchased a nRF52840 DK board and a nRF52840 dongle.

I have programmed an Arduino Nano 33 IoT over BLE and when I repeatedly press a button, set as Notify, the change in button states appear on nRF Connect as expected.

No matter how fast I press/release the button, the state changes are correctly shown in nRF Connect.

This is also the case when I connect the Nano to 'BLE Scanner' on Android and to  a c# program I have written, running on Windows 10.

I'm using nRF5 SDK v17.0.2

Using the nRF_sdk/examples/ble_peripheral/ble_app_blinky, I can only see the state changes if I press and release the button relatively slowly (e.g. slower than about 500ms). Any faster and button state changes are not reliably shown. The same happens on both the DK board and the dongle.

In debug mode, I have put ' NRF_LOG_INFO' calls to see what happens and 'button_event_handler()' is called correctly on every button transition, so the problem is not with the button event handler calling mechanism.

Any ideas how I can speed up the BLE notification to nRF Connect?

Thanks

Parents
  • Hi Gary

    I tested here on my end on an nRF52840 DK and were only able to reproduce it if I really tried to press it quickly. What I think you're seeing is the BUTTON_DETECTION_DELAY in action, which is set as a delay of 50 APP_TIMER_TICKS  from a GPIOTE event until a button is reported as pushed. If a signal is triggered for less than the BUTTON_DETECTION_DELAY it will not be considered a button press. You can try decreasing this to see if that lets you detect quicker button presses.

    Best regards,

    Simon

Reply
  • Hi Gary

    I tested here on my end on an nRF52840 DK and were only able to reproduce it if I really tried to press it quickly. What I think you're seeing is the BUTTON_DETECTION_DELAY in action, which is set as a delay of 50 APP_TIMER_TICKS  from a GPIOTE event until a button is reported as pushed. If a signal is triggered for less than the BUTTON_DETECTION_DELAY it will not be considered a button press. You can try decreasing this to see if that lets you detect quicker button presses.

    Best regards,

    Simon

Children
  • Hi Simon,

    Thanks for looking at this for me.

    I'm trying to create a BLE game controller, ultimately using the nRF52840 dongle, so very fast button presses will be the norm :-)

    I've tried various values of BUTTON_DETECTION_DELAY (50, 30,20,10, 5, 2, 1) on a clean copy of ble_app_blinky in SES and it doesn't improve the state change rate shown on nRF Connect/BLE Scanner.

    I can manually press the button on the nRF52840 DK at about 3 Hz. At this rate I get maybe 50% of the transitions shown in  nRF Connect. On the Nano 33 IoT, I get everything.

    As a test, I set BUTTON_DETECTION_DELAY to 500; that slowed the response considerably, evidently by slowing the call to button_event_handler().

    With BUTTON_DETECTION_DELAY at 50, button_event_handler() sees every button press, no matter how quickly I press it, so I think the problem is elsewhere, i.e. ble_lbs_on_button_change() and deeper

    Thanks again

    Gary

     

Related