Help Triggering a SUPC interrupt

Go To Last Post
3 posts / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

     Hello, I have a project using an ATSAME70-N19A where I need to detect power loss so that I can call the appropriate functions to go into backup mode.

The circuit has a lithium coin cell that is little below 3V and the basic idea is to use the supply controller to detect the 3.3V supply fading, and then to call the SUPC_Handler() function. 

Following the documentation, I have set a threshold at 3 V on the SUPC, enabled the interrupt, and configured the SUPC for continuous monitoring.

This is the code I use for configuring the SUPC:


    //enable continuous measuring

    supc_enable_monitor_reset(SUPC);             //Enable reset on SUPC detection

    supc_set_monitor_threshold(SUPC, 5);         //see page 2045

    supc_backup_sram_off(SUPC);                     //Disable backup SRAM

    supc_enable_monitor_interrupt(SUPC);        //Enable SUPC interrupt


    SUPC->SUPC_WUMR    |= (1<<1);                    //Enable SUPC wakeup

    SUPC->SUPC_WUMR    |= (1<<6);                    //Enable WKUP1 for tamper events

    SUPC->SUPC_SMMR    |= (1<<8);                    //Enable continuous monitoring  


    //read the SMS register to clear flags (make sure interrupts are ready) 

    U32 tmp = SUPC->SUPC_SR;




    NVIC_SetPriority(SUPC_IRQn, 0);



In a perfect world, the SUPC would then call the handler below when the power is pulled:

    void SUPC_Handler(void)


        //if we get here, power is pulled, goto sleep




However, I have the following evidence to suggest it is not being called. After pulling the power I made the following observations


1.) The function I call from the handler disables the internal regulator, however, I still see 1.2 V coming from the core regulator on my board. 

2.) The chip draws about 5 mA from the battery, It appears to be in some kind of sleep. But certainly not backup mode. 


*it should be noted the function "enterBackUpMode()" is tested and works fine


The circuit I have strongly resembled the reference circuit in the datasheet, and it is possible that I have 1 mA of reverse current leakage back to the regulator. but certainly not 5!


So my single most pressing question is how do get the SUPC_Handler() function to trigger!


any help is appreciated greatly!




Last Edited: Wed. Mar 3, 2021 - 09:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having this same issue with SUPC_Handler() not triggering. Did you ever figure out how to get it to trigger?


I can say though that I'm also seeing around 5mA in this sleep mode but the reason I need to call SUPC_Handler() is I know there are some shutdown tasks to complete, including turning off pullups and other peripherals in my application. I can easily get down below 400 uA or less once that is done. I just can't get the customer handler to trigger!


I've created a case with Microchip to see if they can help.