KS57C2308/P2308/C2316/P2316

TIMERS and TIMER/COUNTERS

 

 

TC0 COUNTER REGISTER (TCNT0)

The 8-bit counter register for timer/counter 0, TCNT0, is read-only and can be addressed by 8-bit RAM control instructions. RESET sets all TCNT0 register values to logic zero (00H).

Whenever TMOD0.3 is enabled, TCNT0 is cleared to logic zero and counting resumes. TCNT0 register value is incremented at the selected edge each time an incoming pulse with reference clock specified by TMOD0 register (specifically, TMOD0.6, TMOD0.5, and TMOD0.4) is input.

Each time TCNT0 is incremented, the new value is compared with the reference value stored in the TC0 reference buffer, TREF0. When TCNT0 = TREF0, an match signal occurs in the comparator, the interrupt request flag, IRQT0, is set to logic one, and an interrupt request is generated to indicate that the specified timer/counter interval has elapsed.

COUNT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CLOCK

 

 

~

 

 

 

 

~

 

 

 

 

 

 

TREF0

 

 

 

 

 

REFERENCE VALUE = n

 

 

 

 

 

 

 

 

 

~

 

 

 

 

~

 

 

 

 

 

 

TCNT0

0

1

2

n-1

n

0

1

2

n-1

n

0

1

2

3

 

 

 

~

 

 

 

 

~

 

 

 

 

 

 

 

 

 

 

 

 

MATCH

 

 

 

MATCH

 

 

 

 

 

 

 

 

 

 

~

 

 

 

 

 

 

TOL0

 

 

~

 

 

 

INTERVAL TIME

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIMER START INSTRUCTION

 

IRQT0 SET

 

 

 

IRQT0 SET

 

 

 

(TMOD0.3 IS SET)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 11-3. TC0 Timing Diagram

 

 

 

 

 

 

11-19

Page 241
Image 241
Samsung KS57C2308 manual TC0 Counter Register TCNT0, TC0 Timing Diagram