TIMERS and TIMER/COUNTERS
KS57C2308/P2308/C2316/P2316
11-6
+
+
PROGRAMMING TIP — Using the Basic Timer
1. To read the basic timer count register (BCNT):
BITS
EMB
SMB
15
BCNTR
LD
EA,BCNT
LD
YZ,EA
LD
EA,BCNT
CPSE
EA,YZ
JR
BCNTR
2. When stop mode is released by an interrupt, set the oscillation stabilization interval to 31.3 ms at 4.19 MHz:
BITS
EMB
SMB
15
LD
A,#0BH
LD
BMOD,A
; Wait time is 31.3 ms
NOP
STOP
; Get into stop for power-down mode
NOP
NOP
NOP
NORMAL
OPERATING MODE
STOP MODE
IDLE MODE
(31.3 ms)
CPU
OPERATION
STOP
INSTRUCTION
STOP MODE IS
RELEASED BY
INTERRUPT
NORMAL
OPERATING MODE
3. To set the basic timer interrupt interval time to 1.95 ms (at 4.19 MHz):
BITS
EMB
SMB
15
LD
A,#0FH
LD
BMOD,A
EI
BITS
IEB
; Basic timer interrupt enable flag is set to "1"
4. Clear BCNT and the IRQB flag and restart the basic timer:
BITS
EMB
SMB
15
BITS
BMOD.3
Summary of Contents for C2316
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......