Samsung KS57C2308 Manual page 228

Single-chip cmos microcontroller
Table of Contents

Advertisement

TIMERS and TIMER/COUNTERS
+ +
PROGRAMMING TIP — Using the Basic Timer
1. To read the basic timer count register (BCNT):
BITS
SMB
BCNTR
LD
LD
LD
CPSE
JR
2. When stop mode is released by an interrupt, set the oscillation stabilization interval to 31.3 ms at 4.19 MHz:
BITS
SMB
LD
LD
NOP
STOP
NOP
NOP
NOP
CPU
OPERATION
3. To set the basic timer interrupt interval time to 1.95 ms (at 4.19 MHz):
BITS
SMB
LD
LD
EI
BITS
4. Clear BCNT and the IRQB flag and restart the basic timer:
BITS
SMB
BITS
11-6
EMB
15
EA,BCNT
YZ,EA
EA,BCNT
EA,YZ
BCNTR
EMB
15
A,#0BH
BMOD,A
NORMAL
OPERATING MODE
STOP
INSTRUCTION
EMB
15
A,#0FH
BMOD,A
IEB
EMB
15
BMOD.3
; Wait time is 31.3 ms
; Get into stop for power-down mode
STOP MODE
IDLE MODE
(31.3 ms)
STOP MODE IS
RELEASED BY
INTERRUPT
; Basic timer interrupt enable flag is set to "1"
KS57C2308/P2308/C2316/P2316
NORMAL
OPERATING MODE

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents