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

multi channel SAADC disable in nRF52832

Hi,

I'm currently trying to use 2 channel SAADC to measure 2 analog input port

I've searched other questions in this forum and referred SDK example

Actually, I could measure 2 analog input using 2 channel SAADC,

but disabling (uninitialization) not working normally.

There is no fault error, but after once 2 channel SAADC enabled

current consumption is measured up to 1.2 mA after uninit()..

so.. is there any method to disable multi-channel SAADC ?

I used SDK 15.3.0 with softdevice s132 6.1.1

Thanks

- D.W Kim

  • Hi,

    I'm suspecting that your issue is caused by the EasyDMA. Could you try to reset the peripheral by adding this code after you uninitialize  the peripheral:

    volatile uint32_t temp1;
    volatile uint32_t temp2;
    volatile uint32_t temp3;
    
    temp1 = *(volatile uint32_t *)0x40007640ul;
    temp2 = *(volatile uint32_t *)0x40007644ul;
    temp3 = *(volatile uint32_t *)0x40007648ul;
    
    *(volatile uint32_t *)0x40007FFCul = 0ul; 
    *(volatile uint32_t *)0x40007FFCul; 
    *(volatile uint32_t *)0x40007FFCul = 1ul;
    
    *(volatile uint32_t *)0x40007640ul = temp1;
    *(volatile uint32_t *)0x40007644ul = temp2;
    *(volatile uint32_t *)0x40007648ul = temp3;

    The code block will reset the peripheral. Note that you need to re-configure all registers before you use the peripheral again.

    regards

    Jared 

  • Thanks, Jared

    It works well !!

    There is no additional current.

    I just want to know one more thing...

    What is this address 0x40007640 to 0x40007648 ??

    I 've confirmed that 0x40007000 is base address of SAADC, but

    I couldn't see the information related to offset address 0x640 to 0x648

    - D.W Kim

Related