p80c550efaa NXP Semiconductors, p80c550efaa Datasheet - Page 9

no-image

p80c550efaa

Manufacturer Part Number
p80c550efaa
Description
80c51 8-bit Microcontroller Family 4k/128 Otp/rom/romless, Channel Watchdog Timer
Manufacturer
NXP Semiconductors
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
P80C550EFAA
Manufacturer:
PHILIPS
Quantity:
5
Part Number:
P80C550EFAA
Manufacturer:
INTEL
Quantity:
12 388
Philips Semiconductors
Sample A/D Routines
The following routines demonstrate two methods of operating the
A/D converter. The first method uses polling to determine when the
A/D conversion is complete. The second method uses the A/D
interrupt to flag the end of conversion.
The routine ReadAD will start a read of the A/D channel identified by
R7, and wait for the conversion to complete, polling the A/D interrupt
flag. The result is returned in the accumulator.
ReadAD:MOV A,#08h
ADLoop: MOV A,ADCON
1998 May 01
80C51 8-bit microcontroller family
4K/128 OTP/ROM/ROMless, 8 channel 8 bit A/D, watchdog timer
Rm = 0.5 - 3 k
CS + CC = 15pF maximum
RS = Recommended < 9.6 k for 1 LSB @ 12MHz
NOTE:
Because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. When a conversion
is initiated, switch Sm closes for 8tcy (8 s @ 12MHz crystal frequency) during which time capacitance Cs + Cc is charged. It should
be noted that the sampling causes the analog input to present a varying load to an analog source.
ORL A,R7
MOV ADCON,A;
JNB
MOV A,ADAT
MOV ADCON,#0
RET
ACC.4,ADLoop;Wait for ADCI (A/D ;finished).
R
S
+
;Basic A/D start command.
;Add channel # to be read.
;Start A/D.
;Get A/D status.
;Get conversion result
;Clear ADCI.
V
ANALOG
INPUT
I
N+1
Figure 3.
I
N
A/D Input: Equivalent Circuit
C
Sm
Sm
S
N+1
N
Multiplexer
9
The routine StartAD will start a read of the A/D channel identified by
R7 and exit back to the calling program. When the conversion is
complete, the A/D interrupt occurs, calling the A/D interrupt service
routine. The result of the conversion is returned in register R6.
StartAD: MOV A,#08h
ADInt:
Rm
Rm
N+1
N
ORL A,R7
MOV ADCON,A
RET
ORG 2Bh
MOV R6,ADAT
MOV ADCON,#0
RETI
.
.
.
C
80C550/83C550/87C550
C
To Comparator
;Basic A/D start command.
;Add channel # to be read.
;Start A/D.
;A/D interrupt address.
;Get conversion result.
;Clear ADCI.
Product specification
SU00199

Related parts for p80c550efaa