Samsung KS57C2308 Manual page 243

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
+ +
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
10
clock = fxx/2
, and TREF0 is set to FFH):
2. Calculate the TREF0 value:
30 ms =
TREF0 + 1 =
TREF0 value = 7AH – 1 = 79H
3. Load the value 79H to the TREF0 register:
BITS
SMB
LD
LD
LD
LD
TREF0 value + 1
4.09 kHz
30 ms
= 122.9 = 7AH
244 µs
EMB
15
EA,#79H
TREF0,EA
EA,#4CH
TMOD0,EA
TIMERS and TIMER/COUNTERS
11-21

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents