BASIC TIMER and TIMER 0
PROGRAMMING TIP — Configuring the Basic Timer
This example shows how to configure the basic timer to sample specifications:
ORG
RESET
DI
LD
LD
CLR
CLR
•
•
•
SRP
EI
•
•
•
MAIN
LD
NOP
NOP
•
•
•
JP
•
•
•
10-10
0100H
; Disable all interrupts
BTCON,#0AAH ; Disable the watchdog timer
CLKCON,#18H ; Non-divided clock
SYM
; Disable global and fast interrupts
; Stack pointer low byte → "0"
SPL
; Stack area starts at 0FFH
; Set register pointer → 0C0H
#0C0H
; Enable interrupts
BTCON,#52H ; Enable the watchdog timer
; Basic timer clock: f
; Clear basic timer counter
T,MAIN
/4096
OSC
S3F80JB