Samsung KS57C2308 Manual page 237

Single-chip cmos microcontroller
Table of Contents

Advertisement

KS57C2308/P2308/C2316/P2316
TC0 CLOCK FREQUENCY OUTPUT
Using timer/counter 0, a modifiable clock frequency can be output to the TC0 clock output pin, TCLO0. To select
the clock frequency, load the appropriate values to the TC0 mode register, TMOD0. The clock interval is
selected by loading the desired reference value into the reference register TREF0. To enable the output to the
TCLO0 pin, the following conditions must be met:
— TC0 output enable flag TOE0 must be set to "1"
— I/O mode flag for P2.0 must be set to output mode ("1")
— Output latch value for P2.0 must be set to "0"
In summary, the operational sequence required to output a TC0-generated clock signal to the TCLO0 pin is as
follows:
1. Load a reference value to TREF0.
2. Set the internal clock frequency in TMOD0.
3. Initiate TC0 clock output to TCLO0 (TMOD0.2 = "1").
4. Set P2.0 mode flag to "1".
5. Clear P2.0 output latch to "0".
6. Set TOE0 flag to "1".
Each time TCNT0 overflows and an interrupt request is generated, the state of the output latch TOL0 is inverted
and the TC0-generated clock signal is output to the TCLO0 pin.
+ +
PROGRAMMING TIP — TC0 Signal Output to the TCLO0 Pin
Output a 30 ms pulse width signal to the TCLO0 pin:
BITS
SMB
LD
LD
LD
LD
LD
LD
BITR
BITS
EMB
15
EA,#79H
TREF0,EA
EA,#4CH
TMOD0,EA
EA,#04H
PMG2,EA
P2.0
TOE0
; P2.0
output mode
; Clear P2.0 output latch
TIMERS and TIMER/COUNTERS
11-15

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents