
Programming Examples
8-48
ADSP-BF59x Blackfin Processor Hardware Reference
[--sp] = (r7:7, p5:5);
p5.h = hi(PORTG_FER);
p5.l = lo(PORTG_FER);
r7.l = PG5|PG6|PG7|PG8|PG9|PG10|PG11;
w[p5] = r7;
p5.l = lo(PORTG_MUX);
r7.l = PFTE;
w[p5] = r7;
(r7:7, p5:5) = [sp++];
rts;
timer_port_setup.end:
Listing 8-2
generates signals on the
TMR4
and
TMR5
outputs. By default,
timer 5 generates a continuous PWM signal with a duty cycle of 50%
(period = 0x40 SCLKs, width = 0x20 SCLKs) while the PWM signal gen-
erated by timer 4 has the same period but 25% duty cycle (width = 0x10
SCLKs).
If the preprocessor constant
SINGLE_PULSE
is defined, every
TMR
pin out-
puts only a single high pulse of 0x20 (timer 4) and 0x10 SCLKs (timer 5)
duration.
In any case the timers are started synchronously and the rising edges are
aligned. That is, the pulses are left aligned.
Listing 8-2. Signal Generation
// #define SINGLE_PULSE
timer45_signal_generation:
[--sp] = (r7:7, p5:5);
p5.h = hi(TIMER_ENABLE);
p5.l = lo(TIMER_ENABLE);
#ifdef SINGLE_PULSE
r7.l = PULSE_HI | PWM_OUT;
#else
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...