Adc Interfacing
Adc Interfacing
Background
Majority of signal processing is done using digital
systems because of their efficient, and reliable
operation.
(i)
8-bit ADC has 28 = 256 levels and 28– 1 = 255 steps.
The resolution is 1/(28–1) = 1/255, i.e. 1 part in 255.
For input range of 0 to 5 V, the resolution is
VMAX / (28–1) = 5 V/255 = 19.60 mV
f = 1/1.1RC
i.e. Dout ?
For Vin=1.28V and VREF/2 is open
Output = 1.28 V/19.60 mv = 65D
0
Handshaking
CS and WR’ simultaneously low, the ADC will remain
in a reset state until the CS’ and WR’ inputs remain low.
Conversion will start when WR’ input make a low to
high transition.
Monitor the ‘end of conversion’ (INTR’) pin until it
becomes 0; when it is 0, it indicates that the conversion
is completed.
To read data from the ADC, make CS and RD low,
this will output the data on D7–D0 pins, read this data
using appropriate instruction.
When RD is made low, INTR will become high
automatically.
ORG 0000H
MOV R0, #80H // pointer to store samples
MOV R2, #100 // counter for 100 samples
SETB P1.0 // configure P1.0 as input for connecting INTR
MOV P2, #0FFH // configure P2 as input for reading data
CLR P1.1 // make CS low
NEXT: CLR P1.2 // make WR’ low
SETB P1.2 // WR’ = 1, low-to-high pulse for starting ADC
HERE: JB P1.0, HERE // wait until the end of conversion
CLR P1.3 // make RD’ low to read conversion result
MOV A, P2 // read data from ADC
MOV @R0, A // store the sample at 80H onwards
INC R0 // increment the pointer
SETB P1.3 // make RD high before taking the next sample
LCALL DELAY // delay of 10 second
DJNZ R2, NEXT // repeat until 100 samples are taken
HERE1: SJMP HERE1
Write a program by considering following interfacing
such that VR reference voltage should change the
ON/OFF of the corresponding LED as per followings.