Timer Programming Examples
14-18
ADSP-2126x SHARC Processor Hardware Reference
IRQEN| /* Enable Timer 1 Interrupt */
PRDCNT; /* Count to end of period */
dm(TM1CTL) = ustat3;
R0 = TIM1EN; /* enable timer 1 */
dm(TMSTAT) = R0;
/* Poll the Timer 1 interrupt latch, the interrupt will latch
when the measured period and pulse width are ready to read */
bit tst LIRPTL GPTMR1I;
if not tf jump(pc,-1);
/* Read the measured values */
r0 = dm(TM1PRD);
r1 = dm(TM1W);
/* r0 and r1 will match the Timer 0 settings above */
_main.end: jump (pc,0);
Listing 14-3. Using a General-Purpose Timer as a Core Timer
/* Register Definitions */#define TMSTAT (0x1400) /* GP Timer
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 */
/* Bit Definitions */#define TIMODEPWM (0x00000001)
#define PRDCNT (0x00000008)
#define IRQEN (0x00000010)
#define TIM0EN (0x00000100)
/* Main code section */
.global _main;
.section/pm seg_pmco;
Содержание 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 ...