Analog Devices ADSP-21261 SHARC Hardware Reference Manual page 588

Hide thumbs Also See for ADSP-21261 SHARC:
Table of Contents

Advertisement

Timer Programming Examples
IRQEN|
PRDCNT;
dm(TM1CTL) = ustat3;
R0 = TIM1EN;
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)
Status Register */
#define TM0CTL (0x1401)
#define TM0PRD (0x1403)
#define TM0W
/* Bit Definitions */#define TIMODEPWM
#define PRDCNT
#define IRQEN
#define TIM0EN
/* Main code section */
.global _main;
.section/pm seg_pmco;
14-18
/* Enable Timer 1 Interrupt */
/* Count to end of period */
/* enable timer 1 */
/* GP Timer 0 Control Register */
/* GP Timer 0 Period Register */
(0x1404)
/* GP Timer 0 Width Register */
(0x00000008)
(0x00000010)
(0x00000100)
ADSP-2126x SHARC Processor Hardware Reference
/* GP Timer
(0x00000001)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADSP-21261 SHARC and is the answer not in the manual?

This manual is also suitable for:

Adsp-21262 sharcAdsp-21266 sharcAdsp-21267 sharc

Table of Contents