Programming Examples
18-24
ADSP-BF537 Blackfin Processor Hardware Reference
RTC Stopwatch For Exiting Deep Sleep Mode
sets up the RTC to utilize the stopwatch feature to come out
of deep sleep mode. This code assumes that the
_RTC_Interrupt
is prop-
erly registered as the ISR for the real-time clock event, the RTC interrupt
is enabled in both
IMASK
and
SIC_IMASK
, and that the RTC prescaler has
already been enabled properly.
Listing 18-2. RTC Stopwatch Interrupt to Exit Deep Sleep
/* RTC Wake-Up Interrupt To Be Used With Deep Sleep Code */
_RTC_Interrupt:
P0.H = HI(PLL_CTL);
P0.L = LO(PLL_CTL);
R0 = W[P0](Z);
BITCLR (R0, BITPOS(BYPASS));
W[P0] = R0;
/* BYPASS Set By Default, Must Clear It */
IDLE;
/* Must go to IDLE for PLL changes to be effected */
R0 = 0x807F(Z);
P0.H = HI(RTC_ISTAT);
P0.L = LO(RTC_ISTAT);
W[P0] = R7;
/* clear pending RTC IRQs */
R0 = WRITE_COMPLETE(Z);
/* mask for WRITE-COMPLETE bit */
Poll_WC_IRQ:
R1 = W[P0](Z);
R1 = R1 & R0;
/* wait for Write Complete */
CC = AZ;
IF CC JUMP Poll_WC_IRQ;
RTI;
Deep_Sleep_Code:
P0.H = HI(RTC_SWCNT);
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...