Samsung S3F80JB Programming TIP Configuring the Basic Timer, Clr Sym, Clr Spl, Main BTCON,#52H

Models: S3F80JB

1 346
Download 346 pages 34.13 Kb
Page 253
Image 253

BASIC TIMER and TIMER 0

S3F80JB

 

 

PROGRAMMING TIP — Configuring the Basic Timer

This example shows how to configure the basic timer to sample specifications:

 

ORG

0100H

 

RESET

DI

 

; Disable all interrupts

 

LD

BTCON,#0AAH ; Disable the watchdog timer

 

LD

CLKCON,#18H ; Non-divided clock

 

CLR

SYM

; Disable global and fast interrupts

 

CLR

SPL

; Stack pointer low byte "0"

 

 

; Stack area starts at 0FFH

 

 

 

 

 

 

 

 

 

 

SRP

#0C0H

; Set register pointer 0C0H

 

EI

 

; Enable interrupts

 

 

 

 

 

 

 

 

 

MAIN

LD

BTCON,#52H

; Enable the watchdog timer

 

 

 

; Basic timer clock: fOSC/4096

 

NOP

 

; Clear basic timer counter

 

 

 

 

NOP

 

 

 

 

 

 

 

 

 

 

 

 

JP

T,MAIN

 

10-10

Page 253
Image 253
Samsung S3F80JB manual Programming TIP Configuring the Basic Timer, Clr Sym, Clr Spl, Main BTCON,#52H, NOP Main