KS57C2308/P2308/C2316/P2316

TIMERS and TIMER/COUNTERS

 

 

+PROGRAMMING TIP — Setting a TC0 Timer Interval

To set a 30 ms timer interval for TC0, given fxx = 4.19 MHz, follow these steps.

1.Select the timer/counter 0 mode register with a maximum setup time of 62.5 ms (assume the TC0 counter clock = fxx/210, and TREF0 is set to FFH):

2.Calculate the TREF0 value:

TREF0 value + 1

30 ms =

4.09 kHz

 

 

 

TREF0 + 1 =

30 ms

= 122.9 = 7AH

244 µs

 

 

TREF0 value = 7AH – 1 = 79H

3. Load the value 79H to the TREF0 register:

BITS

EMB

SMB

15

LD

EA,#79H

LD

TREF0,EA

LD

EA,#4CH

LD

TMOD0,EA

11-21

Page 243
Image 243
Samsung KS57C2308 manual + Programming TIP Setting a TC0 Timer Interval, TREF0,EA