beautypg.com

Timer registers, 1 registers, 1 free running counter – Cypress enCoRe CY7C63310 User Manual

Page 43

background image

CY7C63310, CY7C638xx

Document 38-08035 Rev. *K

Page 43 of 83

16. Timer Registers

All timer functions of the enCoRe II are provided by a single timer block. The timer block is asynchronous from the CPU clock.

16.1 Registers

16.1.1 Free Running Counter
The 16 bit free-running counter is clocked by the Timer Capture Clock (TCAPCLK). It is read in software for use as a general purpose

time base. When the low order byte is read, the high order byte is registered. Reading the high order byte reads this register, allowing

the CPU to read the 16-bit value atomically (loads all bits at one time). The free-running timer generates an interrupt at 1024

μs rate

when clocked by a 4 MHz source. It also generates an interrupt when the free running counter overflow occurs every 16.384 ms (with

a 4 MHz source). This allows extending the length of the timer in software.

Figure 16-1. 16-Bit Free Running Counter Block Diagram

Tim er C apture

C lock

16-bit Free

Running Counter

O verflow

Interrupt/W rap

Interrupt

1024µs Tim er

Interrupt

Table 16-1. Free Running Timer Low order Byte (FRTMRL) [0x20] [R/W]

Bit #

7

6

5

4

3

2

1

0

Field

Free running Timer [7:0]

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Default

0

0

0

0

0

0

0

0

Bit [7:0]:

Free running Timer [7:0]

This register holds the low order byte of the 16-bit free running timer. Reading this register causes the high order byte to be

moved into a holding register allowing an automatic read of all 16 bits simultaneously.
For reads, the actual read occurs in the cycle when the low order is read. For writes, the actual time the write occurs is the cycle

when the high order is written.
When reading the Free Running Timer, the low order byte must be read first and the high order second. When writing, the low

order byte must be written first then the high order byte.

Table 16-2. Free Running Timer High-order Byte (FRTMRH) [0x21] [R/W]

Bit #

7

6

5

4

3

2

1

0

Field

Free-running Timer [15:8]

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Default

0

0

0

0

0

0

0

0

Bit [7:0]:

Free-running Timer [15:8]

When reading the Free-running Timer, the low order byte must be read first and the high order second. When writing, the low

order byte must be written first then the high order byte.

[+] Feedback

[+] Feedback

This manual is related to the following products: