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

nrf52840 saadc ladder 160k resistors

hi Engineers! I am trying to use int. pullup of 160k but no effect. the voltage remains zero on pin.

config.resistor_p = NRF_SAADC_RESISTOR_PULLUP;

what problem?

thx.

Parents
  • Hi dear J0rn, if I use nrf_gpio_cfg_input(2, NRF_GPIO_PIN_PULLDOWN) (it is ADC0) it works, but 13K too much for me.

    // CODE:

    void saadc_init(void)
    {
        ret_code_t err_code;
    
        // nrf_gpio_cfg_input(2, NRF_GPIO_PIN_PULLDOWN); // < IT WORKS (13K Resistor)
    
        nrf_saadc_channel_config_t channel_config =
            NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);
    
        channel_config.resistor_p 	= NRF_SAADC_RESISTOR_PULLUP; // < 160K NOT Connected !!!
        channel_config.pin_n 		= NRF_SAADC_INPUT_DISABLED;
        channel_config.reference 	= NRF_SAADC_REFERENCE_INTERNAL;//NRF_SAADC_REFERENCE_VDD4;
    
        err_code = nrf_drv_saadc_init(NULL, saadc_callback);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_channel_init(0, &channel_config);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    }
    
Reply
  • Hi dear J0rn, if I use nrf_gpio_cfg_input(2, NRF_GPIO_PIN_PULLDOWN) (it is ADC0) it works, but 13K too much for me.

    // CODE:

    void saadc_init(void)
    {
        ret_code_t err_code;
    
        // nrf_gpio_cfg_input(2, NRF_GPIO_PIN_PULLDOWN); // < IT WORKS (13K Resistor)
    
        nrf_saadc_channel_config_t channel_config =
            NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);
    
        channel_config.resistor_p 	= NRF_SAADC_RESISTOR_PULLUP; // < 160K NOT Connected !!!
        channel_config.pin_n 		= NRF_SAADC_INPUT_DISABLED;
        channel_config.reference 	= NRF_SAADC_REFERENCE_INTERNAL;//NRF_SAADC_REFERENCE_VDD4;
    
        err_code = nrf_drv_saadc_init(NULL, saadc_callback);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_channel_init(0, &channel_config);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);
    }
    
Children
No Data
Related