ADSP-BF59x Blackfin Processor Hardware Reference
8-19
General-Purpose Timers
Then when
TOGGLE_HI
=
1
, the pseudo-code would be:
int period, width ;
int per1, per2, wid1, wid2 ;
for (;;) {
period = generate_period(...) ;
width = generate_width(...) ;
per1 = period/2 ;
wid1 = width/2 ;
per2 = period/2 ;
wid2 = width/2 ;
waitfor (interrupt) ;
write (TIMER_PERIOD, per1) ;
write (TIMER_WIDTH, per1 - wid1) ;
waitfor (interrupt) ;
write (TIMER_PERIOD, per2) ;
write (TIMER_WIDTH, wid2) ;
}
As shown in this example, the pulses produced do not need to be symmet-
ric (
wid1
does not need to equal
wid2
). The period can be offset to adjust
the phase of the pulses produced (
per1
does not need to equal
per2
).
The
TRUN
bit in the
TIMER_STATUS
register is updated only at the end of
even-numbered periods in
TOGGLE_HI
mode. When
TIMER_DISABLE
is writ-
ten to "1", the current pair of counter periods (one waveform period)
completes before the timer is disabled.
Summary of Contents for ADSP-BF59x Blackfin
Page 64: ...Development Tools 1 22 ADSP BF59x Blackfin Processor Hardware Reference...
Page 74: ...Processor Specific MMRs 2 10 ADSP BF59x Blackfin Processor Hardware Reference...
Page 244: ...Programming Examples 6 40 ADSP BF59x Blackfin Processor Hardware Reference...
Page 700: ...Programming Examples 16 78 ADSP BF59x Blackfin Processor Hardware Reference...
Page 738: ...Boundary Scan Architecture B 8 ADSP BF59x Blackfin Processor Hardware Reference...