ADuCM310 Hardware Reference Manual
UG-549
Rev. C | Page 15 of 192
CODE EXAMPLES
Code Example to Enter Power Saving Modes
SCB->SCR = 0x04;
// sleepdeep mode
pADI_PWRCTL->PWRKEY = 0x4859;
// key1
pADI_PWRCTL->PWRKEY = 0xF27B;
// key2
pADI_PWRCTL->PWRMOD = 0x3;
// Hibernate
__DSB();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
__WFI();
__nop();
__nop();
__nop();
__nop();
__nop();
__nop();
Code Example to Achieve Further Power Savings
pADI_ADC->ADCCON = 0;
// Power off the ADC
pADI_IDAC0->IDACCON = 0x1;
// Turn off IDAC0
pADI_IDAC1->IDACCON = 0x1;
// Turn off IDAC1
pADI_IDAC2->IDACCON = 0x1;
// Turn off IDAC2
pADI_IDAC3->IDACCON = 0x1;
// Turn off IDAC3
pADI_VDAC0->DACCON = 0x100;
// Turn off VDAC0
pADI_VDAC1->DACCON = 0x100;
// Turn off VDAC1
pADI_VDAC2->DACCON = 0x100;
// Turn off VDAC2
pADI_VDAC3->DACCON = 0x100;
// Turn off VDAC3
pADI_VDAC4->DACCON = 0x100;
// Turn off VDAC4
pADI_VDAC5->DACCON = 0x100;
// Turn off VDAC5
pADI_VDAC6->DACCON = 0x100;
// Turn off VDAC6
pADI_VDAC7->DACCON = 0x100;
// Turn off VDAC7
pADI_CLKCTL->CLKCON0 &= 0xFFFC;
// Switch to 16MHz clock
pADI_CLKCTL->CLKCON1 = 0x505;
// Slow down system clocks
pADI_CLKCTL->CLKCON5 = 0x7B;
// Turn off clocks to peripherals