beautypg.com

Chapter 3, Timers, Introduction – Cirrus Logic EP73xx User Manual

Page 43: Features, Timer register list, Programming example, Chapter 3. timers, Table 3-1: timer registers -1, Chapter 3 3 timers introduction, Timer register list programming example

background image

EP7309/11/12 User’s Manual - DS508UM4

3-1

Copyright Cirrus Logic, Inc. 2003

33

3

Chapter 3

3

Timers

Introduction

EP73xx has three general purpose timers that can serve as watchdogs for system
resources or and events. Two timers are based on the internal PLL or 13 MHz clock
and the third is fed by the RTC. Routines requiring periodic service to check status
and new values can make use of these timers.

Features

All timers have the following characteristics

• Programmable for two modes: free running and pre-scale

• Interrupt flags and corresponding mask for control and status

• Timer 16-bit read/write data register to set and read values. Can be

accessed at any time.

Timer Register List

Programming Example

;*****************************************************************************

; Enable TC1 Timer prescale = 2 kHz Program a 2 ms interrupt rate

;*****************************************************************************

;

TC1Prescale

EQU

0x10

; Set prescale in SYSCON1

TC1Timer

EQU

0x14

; Set 10 ms timer in TC1 timer

TC1Mask

EQU

0x100

; UnMask TC1 interrupt

ldr

r12, =0x80000000 ; base address for Timers

ldr

r1, =TC1Prescale

Table 3-1: Timer Registers

Address

Name

Type

Size

Description

Page

0x8000.0300

TC1D

R/W

16

TC1 Data Register

page 3-3

0x8000.0340

TC2D

R/W

16

TC2 Data Register

page 3-3

0x8000.0380

RTCDR

R/W

32

RTC Data Register

page 3-3

0x8000.03C0

RTCMR

R/W

32

RTC Match Register

page 3-4