Using A/D Pins For Standard Digital Input - Samsung S3F84B8 User Manual

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

Advertisement

S3F84B8_UM_REV 1.00

13.1.1 USING A/D PINS FOR STANDARD DIGITAL INPUT

The ADC module's input pins are alternatively used as digital input in port2.
13.1.1.1 A/D Converter Control Register (ADCON)
The A/D converter control register, ADCON, is located at FAH address.
ADCON has five functions:
Bits 7-5 select an analog input pin (ADC0–ADC7).
Bit 4 enables/disables the ADC interrupt.
Bit 3 indicates the status of A/D conversion.
Bits 2-1 select a conversion speed.
Bit 0 starts the A/D conversion.
Only one analog input channel can be selected at a time. You can dynamically select any one of the eight analog
input pins (ADC0–ADC7) by manipulating ADCON.7–ADCON.5.
A/D Conversion input pin selection bits
000
ADC0 (P2.0)
001
ADC1 (P2.1)
010
ADC2 (P2.2)
011
ADC3 (P2.3)
100
ADC4 (P2.4)
101
ADC5 (P2.5)
110
ADC6 (P2.6)
111
ADC7 (P2.7)
A/D Converter Control Register (ADCON)
MSB
.7
.6
.5
ADC Interrupt enable bit:
0 = disable
1 = enable
NOTE: Maximum ADC clock input = 4 MHz
Figure 13-1
A/D Converter Control Register (ADCON)
FAH, R/W
.4
.3
.2
.1
Conversion start bit:
0 = No effect
1 = A/D conversion start
Conversion speed selection bits:
00 = f
/8 (f
OSC
01 = f
/4 (f
OSC
10 = f
/2 (f
OSC
11 = f
/1 (f
OSC
ADC complete interrupt bit (EOC):
0 = No interrupt pending, Conversion in progress
(clear when write)
1 = Interrupt pending, AD conversion has completed
13-2
13 A/D CONVERTER
.0
LSB
(NOTE)
< 10 MHz)
OSC
< 10 MHz)
OSC
< 10 MHz)
OSC
< 4 MHz)
OSC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents