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

What is the difference between High-accuracy and SIGNAL mode in GPIOTE

Hello,

 

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flash the image. I am using ‘ble_app_blinky’.

1) What is the difference between High-accuracy and SIGNAL mode. “Product specification” nowhere mentioned about high accuracy.

a)  In GPIOTE mode, if I configure high accuracy when whether IN in “Figure 21: GPIO Port and the GPIO pin details” is used for sensing the level where as in normal mode SENSE/DETECT is use to generate PORT Event.

2) Under nrfx_gpiote_in_init() in below link I am seeing the description mentioned below.

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fgroup__nrf__drv__gpiote.html&anchor=ga00970227fc2c393fbbc71b3d362b58c2

If high-accuracy mode is used, the driver attempts to allocate one of the available GPIOTE channels. If no channel is available, an error is returned. In low accuracy mode SENSE feature is used. In this case only one active pin can be detected at a time. It can be worked around by setting all of the used low accuracy pins to toggle mode.

a) If 'high accuracy' mode is not selected, whether SENSE feature is same as normal GPIO sense. In this case whether GPIOTE will not come into picture ?

b) I have a scenario where two buttons to be pressed for 1 sec at a time. In this case whether GPIOTE cannot be used. ?

c) In high accuracy mode, GPIOTE_CONFIG_IN_SENSE_TOGGLE(true) I am seeing few interrupts getting missed. Any thoughts on this.

Thanks & Regards

Vishnu Beema

  • Hello Vishnu

    1. You are correct, it is not mentioned in the PS, as it is part of the SDK, not the nRF chip. 

    a) I'm struggling to understand what you mean here. You will be able to create a PORT event in normal mode of GPIOTE as well as high acc. mode, but not at all with "just" GPIO, if that's what you're wondering.

    2.

    a) When High accuracy mode isn't enabled, the signal will be DETECT, with the added possibility of generating a PORT event which is described in chapter 21.2 in the PS. So not exactly the same as a regular GPIO event.

    b) What do you mean that it can't be used? If all channels are busy/unavailable, the event will return an error. But it can still be used when a channel is available again.

    c) Can you specify please. How often does it toggle, and how many interrupts are missed? Are you using the HF external oscillator for this, or another clock? The accuracy of the high-acc. GPIOTE depends on which HF clock you are using.

    NOTE: The main difference between high accuracy mode and normal mode is that the high acc. mode has to use one of the HF clocks to work properly (recommended to use the 32MHz HFXO clock), while you can use the LF clocks for normal mode. This also means that the high accuracy mode will consume more power than the normal mode.

    Best regards,

    Simon

  • Hello Simon,

    Thank you for your inputs. My further queries to your answers are.

    1.a) In both normal and high accuracy if the input to PORT event is DETECT, then I am bit confused with the statement

            “Set hi_accu to true to use IN_EVENT”

    as part of NRFX_GPIOTE_CONFIG_IN_SENSE_TOGGLE() macro. What is this “IN_EVENT”.

     

    2.a) If high accuracy is not enabled then the signal will be DETECT, then if high accuracy is enabled what will be the signal ? Is it ‘IN_EVENT’. In “Figure 21: GPIO Port and the GPIO pin details” I am seeing only sense / DETECT but not ‘IN_EVENT’. Is ‘IN_EVENT’ is part of GPIOTE.

     

    2.b) I need only button press event to be detected with debouncing of 2 seconds. For this I used GPIOTE_CONFIG_IN_SENSE_HITOLO(false). This worked when only one button is pressed at a time. If I press two buttons at a time (or within 2 sec debouncing delay) I am not able to see event handler triggered for second button. Later I saw statement “In low accuracy mode SENSE feature is used. In this case only one active pin can be detected at a time.”

     

    So I changed to high accuracy GPIOTE_CONFIG_IN_SENSE_HITOLO(true). Here some times few buttons presses are not detected.

    Later by seeing the statement “ It can be worked around by setting all of the used low accuracy pins to toggle mode” I reverted back to low accuracy toggle mode GPIOTE_CONFIG_IN_SENSE_TOGGLE(false). This worked for me.

    But still I am bit confused why by using high accuracy GPIOTE_CONFIG_IN_SENSE_HITOLO(true) few button events are missed.

     

    2.c) I am using Nordic Development kit. I hope it should have 32MHz external crystal and the same is configured in ble_app_blinky application. Please correct me if I am wrong.

    Thanks & Regards

    Vishnu Beema

  • Hi Vishnu

    1

    a)  GPIOTE_CONFIG_IN_SENSE_LOTOHI(true) is an IN_EVENT.

    GPIOTE_CONFIG_IN_SENSE_LOTOHI(false) is a PORT event.

    2.

    a) You are correct. More info on that in this post

    b) Thanks for clarifying. Yes, you will only be able to detect one pin at a time in low accuracy mode. The reason you are missing some events is likely due to the GPIOTE channels being busy, although I'm not completely sure. Anyway, low accuracy toggle mode is the best solution.

    c) You are correct.

    Best regards,

    Simon

  • Sorry, I have last query.

    Based on DETECT, PORT event will be generated. Based on your statement

    "You will be able to create a PORT event in normal mode of GPIOTE as well as high acc"

    even in case of for IN_EVNET, whether DETECT is used ?

    Is high accuracy mean, more sampling of input pin using High frequency clock (HFXO).

    Thanks & Regards

    Vishnu Beema

Related