Samsung S3F84B8 User Manual page 258

8-bit cmos
Hide thumbs Also See for S3F84B8:
Table of Contents

Advertisement

S3F84B8_UM_REV 1.00
;-----------------<< Interrupt Vector Address >>
VECTOR F0H, INT_ADC
;--------------<< Smart Option >>
ORG
DB
DB
DB
DB
ORG
RESET:
DI
LD
LD
LD
EI
;--------------<< Main loop >>
MAIN:
JR
AD_CONV:
LD
NOP
INT_ADC:
LD
LD
AND
ADCON, #11110111B
IRET
END
Example 13-1
003CH
0FFH
0FFH
0FFH
0FFH
0100H
BTCON,#10100011B
P2CONH,#11111111B ; Configures P2.4–P2.7 AD input
P2CONL,#11111111B ; Configures P2.0–P2.3 AD input
t, MAIN
ADCON, #00110001B ; Selects analog input channel  P2.1
R2, ADDATAH
R3, ADDATAL
Configuring A/D Converter
;
; 003CH, must be initialized to 1
; 003DH, must be initialized to 1
; 003EH, must be initialized to 1
; 003FH, disables LVR and internal RC oscillator
; Disables interrupt
; Disables Watchdog
; Enables interrupt
; Enables ADC interrupt
; Selects conversion speed  f
; Sets conversion start bit
; If you set conversion speed to f
; at least one NOP must be included
;
;
; Clears pending bit
;
;
13-6
13 A/D CONVERTER
/8
OSC
/8
OSC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents