Samsung S3C9454B User Manual page 171

Table of Contents

Advertisement

A/D CONVERTER
F
PROGRAMMING TIP – Configuring A/D Converter
ORG
VECTOR 00H,INT_9454
ORG
003CH
DB
DB
DB
DB
ORG
RESET:
DI
LD
LD
LD
LD
EI
;--------------<< Main loop >>
MAIN:
CALL
JR
AD_CONV:
LD
NOP
NOP
NOP
12-6
0000H
00H
00H
0E7H
03H
0100H
BTCON,#10100011B
P0CONH,#11111111B
P0CONL,#11111111B
P2CONH,#00100000B
AD_CONV
t,MAIN
ADCON,#00000001B
; S3C9454/F9454 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
; Configure P0.4–P0.7 AD input
; Configure P0.0–P0.3 AD input
; Configure P2.6 AD input
; Enable interrupt
; Subroutine for AD conversion
;
; Select analog input channel → P0.0
; select conversion speed → f
; set conversion start bit
; If you select conversion speed to f
; at least three nop must be included
S3C9454B/F9454B
= 5 V)
DD
/16
OSC
/16
OSC

Advertisement

Table of Contents
loading

This manual is also suitable for:

F9454b

Table of Contents