Timer Programming Examples
14-14
ADSP-2126x SHARC Processor Hardware Reference
Timer Programming Examples
This section provides three programming examples written for the
ADSP-2126x.
The first listing,
, sets up Timer 0 in External Watchdog
mode, using DAI pin 1 as its input. The Timer generates an interrupt
when it senses the number of edges are equal to the Timer Period setting.
The second listing,
, uses both Timer 0 and Timer 1. Timer 0
is set up in PWMOUT mode, using DAI pin 1 as its output. Timer 1 is
set up in Width Capture mode, using Timer 0 as its input. The period and
pulse width measured by Timer 1 are identical to the settings of Timer 0.
Listing 14-1. External Watchdog Mode Example
/* Register Definitions */
#define TMSTAT (0x1400) /* GP Timer 0 Status register */
#define TM0CTL (0x1401) /* GP Timer 0 Control register */
#define TM0PRD (0x1403) /* GP Timer 0 Period register */
#define TM0W (0x1404) /* GP Timer 0 Width register */
#define SRU_EXT_MISCB (0x2471)
/* SRU definitions */
#define DAI_PB01_O 0x00
/* Bit Positions */
#define TIMER0_I 0
/* Bit Definitions */
#define TIMODEEXT 0x00000003
#define PULSE 0x00000004
#define PRDCNT 0x00000008
#define IRQEN 0x00000010
Содержание ADSP-21261 SHARC
Страница 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Страница 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Страница 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Страница 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Страница 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...