Hi,
I'm using nRF52833 DK and SDK v17 to test my applications.
I have to use ADC on nRF52811 SoC, and I wanted to develop a demo on nRF52833DK before implementing on nRF52811.
I've used saadc example in the SDK, and results of the conversion are not what I expected. I also connected the analog pin (P0.03) to GND, and the results were not 0V.
I'm sharing result of GND:
Also sharing result of a test circuit that uses potentiometer to change input voltage:
I changed the resistance of potentiometer bw pic.1 and 2.
I've also written a test code:
void wacon_adcIrqHandler(nrf_drv_saadc_evt_t const * p_event) { /* not used in polling mode */ } void saadc_init(void) { nrf_saadc_channel_config_t channel_config = NRFX_SAADC_DEFAULT_CHANNEL_CONFIG_SE(28); /* P0.28 */ (void)nrf_drv_saadc_init(NULL, wacon_adcIrqHandler); (void)nrfx_saadc_channel_init(0, &channel_config); } int main(void) { u16 length = 9; bsp_board_init(BSP_INIT_LEDS); bool erase_bonds; u8 mesaj[30] = {0}; nrf_saadc_value_t adc_val = 0u; uart_init(); log_init(); timers_init(); buttons_leds_init(&erase_bonds); power_management_init(); ble_stack_init(); saadc_init(); gap_params_init(); gatt_init(); services_init(); advertising_init(); conn_params_init(); saadc_init(); advertising_start(); while(1) { nrfx_saadc_sample_convert(0, &adc_val); snprintf(mesaj, 30, "\r\nADC:%d\r\n", adc_val); ble_nus_data_send(&m_nus, mesaj, &length, m_conn_handle); nrf_delay_ms(1000); } }
Result of the test code:
What is the mistake that I've done? Thanks for your help!
BR,