
ADSP-BF59x Blackfin Processor Hardware Reference
8-53
General-Purpose Timers
Since hardware only updates the written period and width values at the
end of periods, software can write new values immediately after the timers
have been enabled. Note that both timers’ period expires at exactly the
same times with the exception of the first timer 5 interrupt (at
IRQ1
)
which is not visible to timer 4.
Listing 8-5. Non-Overlapping Clock Pulses
#define P 0x1000
/* signal period */
#define W 0x0600
/* signal pulse width */
#define N 4
/* number of pulses before disable */
timer45_toggle_hi:
[--sp] = (r7:1, p5:5);
p5.h = hi(TIMER_ENABLE);
p5.l = lo(TIMER_ENABLE);
/* config timers */
r7.l = IRQ_ENA | PERIOD_CNT | TOGGLE_HI | PULSE_HI | PWM_OUT;
w[p5 + TIMER5_CONFIG - TIMER_ENABLE] = r7;
r7.l = PERIOD_CNT | TOGGLE_HI | PULSE_HI | PWM_OUT;
w[p5 + TIMER4_CONFIG - TIMER_ENABLE] = r7;
/* calculate timers widths and period */
r0.l = lo(P);
r0.h = hi(P);
r1.l = lo(W);
r1.h = hi(W);
r2 = r1 >> 1;
/* W/2 */
r3 = r0 >> 1;
/* P/2 */
r4 = r3 - r2;
/* P/2 - W/2 */
r5 = r0 - r2;
/* P - W/2 */
/* write values for initial period */
[p5 + TIMER4_PERIOD - TIMER_ENABLE] = r0;
[p5 + TIMER4_WIDTH - TIMER_ENABLE] = r5;
[p5 + TIMER5_PERIOD - TIMER_ENABLE] = r3;
[p5 + TIMER5_WIDTH - TIMER_ENABLE] = r4;
Содержание ADSP-BF59x Blackfin
Страница 64: ...Development Tools 1 22 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 74: ...Processor Specific MMRs 2 10 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 204: ...Unique Information for the ADSP BF59x Processor 5 104 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 244: ...Programming Examples 6 40 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 345: ...ADSP BF59x Blackfin Processor Hardware Reference 9 9 Core Timer Unique Information for the ADSP BF59x Processor None...
Страница 346: ...Unique Information for the ADSP BF59x Processor 9 10 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 398: ...Unique Information for the ADSP BF59x Processor 11 42 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 622: ...Unique Information for the ADSP BF59x Processor 15 38 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 700: ...Programming Examples 16 78 ADSP BF59x Blackfin Processor Hardware Reference...
Страница 738: ...Boundary Scan Architecture B 8 ADSP BF59x Blackfin Processor Hardware Reference...