I started developing a project on nRF52. My task is to read the value from the light sensor (phototransistor).
The sensor is connected in this way:

my code:
init:
void saadc_callback(nrf_drv_saadc_evt_t const * p_event)
{
(void) p_event;
}
void saadc_init(void)
{
uint32_t err_code;
err_code = nrf_drv_saadc_init(NULL, saadc_callback);
APP_ERROR_CHECK(err_code);
nrf_saadc_channel_config_t cfg = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN7);
nrf_drv_saadc_channel_init(NRF_SAADC_INPUT_AIN7-1,&cfg);
}
reading:
while(1)
{
nrf_saadc_value_t als;
nrf_drv_saadc_sample_convert(7, &als);
...
but it doesn't work .. The chip is reset every time I try to read smth.
Also I checked the voltage on the sensor and it is too low, it looks like AIN7 is not tuned or ... I don't know ... I read a lot of forums and tried 1001 options to read something from the sensor but no luck
here is general view to my config
...