ADSP-2126x SHARC Processor Hardware Reference
14-19
Peripheral Timer
_main:
/* Using PWM Out mode as a core timer */
ustat3 = TIMODEPWM| /* PWM Out Mode */
PRDCNT| /* Count to end of period */
IRQEN;
dm(TM0CTL) = ustat3;
R0 = 0x8000;
dm(TM0PRD) = R0; /* Timer 0 period = 0x8000 */
R1 = 1;
dm(TM0W) = R1; /* Timer 0 Pulse width = 1 */
R0 = TIM0EN; /* enable timer 0 */
dm(TMSTAT) = R0;
/* Get start clock count */
R1 = EMUCLK;
// Wait until TIM0IRQ is set
// Alternatively, we could test GPTMR0I in IRPTL
r0=dm(TMSTAT);
btst r0 by 0;
if not sz jump (pc,2);
jump(pc,-3) (db);
/* Get end clock count */
R2=EMUCLK;
/* Subtract the start count from the end count
to obtain the number of cycles before the interrupt */
R4=R2-R1;
// R4 will be double the value of TM0PRD
_main.end: jump(pc,0);
Summary of Contents for ADSP-21261 SHARC
Page 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Page 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Page 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Page 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Page 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Page 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Page 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Page 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Page 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Page 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Page 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Page 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...