ADSP-BF537 Blackfin Processor Hardware Reference
18-13
Real-Time Clock
3. Write
RTC_STAT
to current time, 13:10:59.
4. Read
RTC_STAT
, still get old time 10:45:30.
5. Wait for 1 Hz tick.
6. Read
RTC_STAT
, get new current time, 13:11:00.
Using the Stopwatch
The RTC stopwatch count register (
RTC_SWCNT
) contains the countdown
value for the stopwatch. The stopwatch counts down seconds from the
programmed value and generates an interrupt (if enabled) when the count
reaches 0. The counter stops counting at this point and does not resume
counting until a new value is written to
RTC_SWCNT
. Once running, the
counter may be overwritten with a new value. This allows the stopwatch
to be used as a watchdog timer with a precision of one second.
The stopwatch can be programmed to any value between 0 and (2
16
– 1)
seconds, which is a range of 18 hours, 12 minutes, and 15 seconds.
Typically, software should wait for a 1 Hz tick, then write
RTC_SWCNT
. One
second later,
RTC_SWCNT
changes to the new value and begins decrement-
ing. Because the register write occupies nearly one second, the time from
writing a value of N until the stopwatch interrupt is nearly N + 1 seconds.
To produce an exact delay, software can compensate by writing N – 1 to
get a delay of nearly N seconds. This implies that you cannot achieve a
delay of 1 second with the stopwatch. Writing a value of 1 immediately
after a 1 Hz tick results in a stopwatch interrupt nearly two seconds later.
To wait one second, software should just wait for the next 1 Hz tick.
The
RTC_SWCNT
register is not reset. After initial powerup, it may be run-
ning. When the stopwatch is not used, writing it to 0 to force it to stop
saves a small amount of power.
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 ...