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

Configure nRF52840 GPIO High_level detection

Hello All,

I am using nRF52840 Dev-kit and nRF5_SDK_for_Thread_and_Zigbee_v3.0.0_d310e71 SDK. So far in development, I have used the GPIO edge triggering method to detect rising or falling edge detection as per GPIOTE API and Interrupt handler. But due to some changes in Hardware, we are moving to detect "LEVEL_TRIGGER".

I have been searching for proper steps or example which explains the level trigger configuration and it's interrupt routine so make fast changes and test the detection.

Can anyone suggest to me the example which used a GPIO level trigger interrupts instead of an edge trigger?

Very urgent from a development point.

And current configuration and what is happening using pin_change example and GPIOTE API,

1.GPIO detects raising edge and pull_down configuration so if I connect GPIO pin to VDD it gives me interrupt and if open from VDD then also I am getting interrupted.

- Here, I should get interrupted when GPIO short to VDD else NO

2. And also tried to config both edge (Sense toggle) and pull_down config then also if connect GPIO to VDD I am getting interrupted and open it get interrupted but if connect to GND not getting interrupted.

- Let me know why such behavior using GPIOTE and how to configure GPIO for level trigger handler instead of edge trigger.

I saw GPIO HAL, here I saw only config,sense_set, sense_get, out_config, and in_config functions but not handler/callback related function and sense_get means leads to polling method if I am not wrong.

Thanks and Regards

Rohit R

Parents
  • Hi,

    I'm not sure I understand what you are asking about. As far as I know, the GPIOTE peripheral can only generate interrupt from a pin state-change. If you want to know the initial state of the pin, you need to read it from the application.

    See also this case.

    Best regards,
    Jørgen

  • Hello Jørgen,

    My question is nRF52840 support level_trigger? If Yes, then let me know how to configure it.

    I am connecting one GPIO to Relay out of relay taking as input to that GPIO so I want to configure GPIO to detect levels. So if there is a level trigger then let me know how I can? and I saw the post shared by you he says "nRF52 does not support level_trigger ". But since it very old post so I am asking this again.

    And As I am using this in Zigbee light_bulb code. Can I ignore the Alexa On / Off command when there is a positive input from Relay to GPIO?. - Let me know your feedback on this.

    Thanks and Regards

    Rohit R

Reply
  • Hello Jørgen,

    My question is nRF52840 support level_trigger? If Yes, then let me know how to configure it.

    I am connecting one GPIO to Relay out of relay taking as input to that GPIO so I want to configure GPIO to detect levels. So if there is a level trigger then let me know how I can? and I saw the post shared by you he says "nRF52 does not support level_trigger ". But since it very old post so I am asking this again.

    And As I am using this in Zigbee light_bulb code. Can I ignore the Alexa On / Off command when there is a positive input from Relay to GPIO?. - Let me know your feedback on this.

    Thanks and Regards

    Rohit R

Children
No Data
Related