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

nRF51822 HID example - delay between characters

Hi,

I'm using SDK 4.4.2 and softdevice 5.2.1 to try the HID example. Although it is provided for the nRF6350 kit, I ported (buttons and LEDs) the example to the EV kit (PC1001) and I can connect both to iOS and OS X without any issues. However, typing out the 'hello' sequence takes too long time, it seems like I have to wait almost a second between the button presses to be able to type out the next character. If I press the button too quickly then the next character won't by typed until I wait for a while again. I see this on iOS and OS X too so I suspect it has to do with the example code. I tried to change slave latency from 6 to 0 without any luck. I'd be grateful if you guys can advise where to continue to look for the source of the problem.

Parents
  • Hi,

    The example is set up to be a bit slow. As you state, it will send one-and-one character for each keypress. For each keypress you send, you will also send a key-release (only '0').

    What you can do to make it go a bit faster is to reduce the button-detection delay (debouncer) via this define: BUTTON_DETECTION_DELAY APP_TIMER_TICKS(10, APP_TIMER_PRESCALER)

    Also, since this example does not use pull on the buttons, you should add this under the function "buttons_init":

        static app_button_cfg_t buttons[] =
        {
            {KEY_PRESS_BUTTON_PIN_NO,       false, NRF_GPIO_PIN_PULLUP, button_event_handler},
            {BONDMNGR_DELETE_BUTTON_PIN_NO, false, NRF_GPIO_PIN_NOPULL, NULL}
        };
    
    

    Best regards Håkon

Reply
  • Hi,

    The example is set up to be a bit slow. As you state, it will send one-and-one character for each keypress. For each keypress you send, you will also send a key-release (only '0').

    What you can do to make it go a bit faster is to reduce the button-detection delay (debouncer) via this define: BUTTON_DETECTION_DELAY APP_TIMER_TICKS(10, APP_TIMER_PRESCALER)

    Also, since this example does not use pull on the buttons, you should add this under the function "buttons_init":

        static app_button_cfg_t buttons[] =
        {
            {KEY_PRESS_BUTTON_PIN_NO,       false, NRF_GPIO_PIN_PULLUP, button_event_handler},
            {BONDMNGR_DELETE_BUTTON_PIN_NO, false, NRF_GPIO_PIN_NOPULL, NULL}
        };
    
    

    Best regards Håkon

Children
No Data
Related