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

GPIOTE input pins dont work

Hello,

I use NRF52810 with SDK 14.2.0 and softdevice 112. I need to use 7 input pins,  but if I config more than 3 pins, all signals disappear.

GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS is setted to 7.
My configuration for each pins is like below:
	/**< INPUT. */
	nrf_drv_gpiote_in_config_t config_pwr = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
	// BTN_PWR
	err_code = nrf_drv_gpiote_in_init(BTN_PWR, &config_pwr, PIN_EVT_Handler);
	APP_ERROR_CHECK(err_code);
	nrf_drv_gpiote_in_event_enable(BTN_PWR, true);

  • Input pin has external pullup, no pullup settings in code. It switche like this ESE22MV21 . And it pulls down.

  • What is your GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS defined to in sdk_config.h?

    And do you have logging enabled? Can you please try to define DEBUG in your preprocessor defines, and monitor the log? Does the log say anything?

    BR,

    Edvin

  • What do you mean by logging?

    // <o> GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins 
    #ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
    #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 8
    #endif

  • If you use one of the examples with BLE, then you probably see some calls to NRF_LOG_INFO(); in the project, do you?

    What is the following defines set to in your sdk_config.h:

    NRF_LOG_ENABLED
    NRF_LOG_BACKEND_UART
    NRF_LOG_BACKEND_RTT

  • Yes. I have this function and log_init(), but dont undestand, how it can help me. 

    // <h> nRF_Log 
    
    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 0
    #endif
    // <o> NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. 
    // <i> Size of the buffer is a trade-off between RAM usage and processing.
    // <i> if buffer is smaller then strings will often be fragmented.
    // <i> It is recommended to use size which will fit typical log and only the
    // <i> longer one will be fragmented.
    
    #ifndef NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE
    #define NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE 64
    #endif
    
    // </e>
    
    // <e> NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_UART_ENABLED
    #define NRF_LOG_BACKEND_UART_ENABLED 1
    #endif
    // <o> NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin 
    #ifndef NRF_LOG_BACKEND_UART_TX_PIN
    #define NRF_LOG_BACKEND_UART_TX_PIN 6
    #endif

Related