Grand Central in standby sleep mode

HI all,

I am starting to work with the grand central and having problems getting to micro amp current levels in standby sleep mode.

When i execute the code below i get a current consumption of 7-9 mA How can I achieve better results ?

USBDevice.detach();
USBDevice.end();
USBDevice.standby();

PM->SLEEPCFG.bit.SLEEPMODE = 0x4;
while (PM->SLEEPCFG.bit.SLEEPMODE != 0x4);

__DSB();
__WFI();

Thanks for the help

Did you set the “sen” (sleep enable) in sleepcfg as well?

westfw:
Did you set the “sen” (sleep enable) in sleepcfg as well?

i can’t find “sen” in STDBCFG struct that can be found in pm.h.
am i missing something ?
Is there another way to set it?

/* -------- PM_SLEEPCFG : (PM Offset: 0x01) (R/W  8) Sleep Configuration -------- */
#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
typedef union {
  struct {
    uint8_t  SLEEPMODE:3;      /*!< bit:  0.. 2  Sleep Mode                         */
    uint8_t  :5;               /*!< bit:  3.. 7  Reserved                           */
  } bit;                       /*!< Structure used for bit  access                  */
  uint8_t reg;                 /*!< Type      used for register access              */
} PM_SLEEPCFG_Type;
#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */

also i can’t find it in the data sheet see attachment

Oops! I was looking at the wrong datasheet. (Mega0 series has a sleepcfg register with a separate SEN bit.) Sorry.

I haven’t used one of these , but looking at the board there are voltage regulators and other chips - if you put the processor to sleep , I would have thought these would still take power ?

Yes you are right but the current consumption should be lower than 9mA if the SAMD51 is in standby mode.