Analog Devices ADSP-BF535 Blackfin Hardware Reference Manual page 699

Table of Contents

Advertisement

Timers
Listing 16-1. PWM Mode Initialization Sequence
/* A typical PWM mode initialization: */
#define lo(const32) (const32 & 0xFFFF)
#define hi(const32) ((const32 >> 16) & 0xFFFF)
PO.H = hi(TIMER0_CONFIG);
PO.L = lo(TIMER0_CONFIG);
R0.L = 0x0019;
W[P0] = R0.L;
/* */
PO.L = lo(TIMER0_PERIOD_HI);
W[P0] = R1.H;
PO.L = lo(TIMER0_PERIOD_LO);
W[P0] = R1.L;
/* */
PO.L = lo(TIMER0_WIDTH_HI);
W[P0] = R2.H;
PO.L = lo(TIMER0_WIDTH_LO);
W[P0] = R2.L;
/* */
PO.L = lo(TIMER0_STATUS);
R0.L = 0x0100;
W[P0] = R0.L;
SSYNC;
If enabled, a timer interrupt is generated at the end of each period. An
interrupt service routine must clear the interrupt latch bit (
) and
IRQx
might alter the period and/or width values. In PWM applications, the
software may need to update period and width values while the timer is
running. To guarantee coherency between Timer Period and Timer
Width registers, a buffer mechanism is used.
ADSP-BF535 Blackfin Processor Hardware Reference
16-15

Advertisement

Table of Contents
loading

Table of Contents