This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 key driver tuning

Other Parts Discussed in Thread: CC2541

Hi,

I'm writing a firmware for CC2541 chip based on keyfob example from BLE stack 1.2.1.

In our application instead of key 2 ( SW2 - as in keyfob) we use reed switch to

monitor some magnetic field changes with characteristic periods between events up to 6-7 ms.

I noticed that key driver cann't handle properly such rapid triggering.

What can I fix in BLE stack key drivers to improve time resolution of keys?

to handle such fast keyevents/

Thank you.

BR,

Evgeny.

  • Hello,

    There is some setting for keys  such as 

    #define HAL_KEY_RISING_EDGE 0
    #define HAL_KEY_FALLING_EDGE 1

    #define HAL_KEY_DEBOUNCE_VALUE 25

    You should be able to catch interrupt, and then use shorter debounce to verify key change.

    BR,

    -Greg

  • Hi Greg,

    For our key we configured triggering on falling edge,

    and as to debounce value  - I tried to reduce it to 3 (instead of 25) but still it doesn't seem to be fast enough

    in some modes reed switch has to go off every 6 or 7 ms

    and in that mode application misses about 1 in every 3 such events.

    So does it make sense to set debounce value to 2 or even 0?

    Or  is there some other parameters influencing key event reaction time?

    BR,

    Evgeny.