Samsung S3C9454B User Manual page 156

Table of Contents

Advertisement

S3C9454B/F9454B
F
PROGRAMMING TIP1 – Configuring Timer 0 (Interval Mode)
The following sample program sets Timer 0 to interval timer mode.
ORG
VECTOR
ORG
DB
DB
DB
DB
ORG
RESET:
DI
LD
LD
LD
LD
LD
LD
LD
LD
;--------------<< Timer 0 settings >>
LD
LD
EI
;--------------<< Main loop >>
MAIN:
NOP
CALL
CALL
JR
0000H
00H,INT_9454
003CH
00H
00H
0E7H
03H
0100H
BTCON,#10100011B
CLKCON,#00011000B
SP,#0C0H
P0CONH,#10101010B
P0CONL,#10101010B
P1CON,#00001010B
P2CONH,#01001010B
P2CONL,#10101010B
T0DATA,#50H
T0CON,#01001010B
LED_DISPLAY
JOB
T,MAIN
; S3C9454B/F9454B has only one interrupt vector
; 003CH, must be initialized to 0
; 003DH, must be initialized to 0
; 003EH, enable LVR (2.3 V)
; 003FH, internal RC (3.2 MHz in V
; Disable interrupt
; Watchdog disable
; Select non-divided CPU clock
; Set stack pointer
;
; P0.0–0.7 push-pull output
; P1.0–P1.1 push-pull output
;
; P2.0–P2.6 push-pull output
; CPU = 3.2 MHz, interrupt interval = 4 msec
; f
/256, Timer 0 interrupt enable
OSC
; Enable interrupt
; Start main loop
; Sub-block module
; Sub-block module
;
BASIC TIMER and TIMER 0
= 5 V)
DD
10-11

Advertisement

Table of Contents
loading

This manual is also suitable for:

F9454b

Table of Contents