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

working with 2 saadc configurations does not work

hello Nordic

i am working with nrf52840, sdk 16.0 

i am building my project over the peripheral app_ble_blinky example 

i whish to have 2 seprate configs for saadc

i call the following init function twice (with 2 different saadc_configs (different naming as well) ):

err_code = nrf_drv_saadc_init(&saadc_config, saadc_sample_event_handler);
    APP_ERROR_CHECK(err_code);

it does not seem to be working.. is there a way to initialize 2 saadc configs

best regards

Ziv

  • I think the best and fastest way forward is to send me a project that I can compile and run here on an nRF52840-DK to recreate this. Then I will be able to help you properly.

    Best regards,
    Kenneth

  • my code contains  a lot of other modules and algorithms so sharing it is not my first choice

     

    any way, the issue and source for lack of logic in the assert is that i was advised to change it for another project a while ago and the correct form is actually as follows:


    // Oversampling can be used only with one channel.
     NRFX_ASSERT((nrf_saadc_oversample_get() == NRF_SAADC_OVERSAMPLE_DISABLED) ||
     (m_cb.active_channels == 0));

    == instead of != NRF_SAADC_OVERSAMPLE_DISABLED which is the original SDK code 

    i must admit that i am a bit disappointed that no one could relate to this lack of logic and correct my miss use of the nrfx_saadc.c file and save me a tone of time and so many changes to the my original organized code.

     

    i have some more issues with timing of the adc but i will open a new thread for that

    best regards 

    Ziv

Related