English
Language : 

AD1175_15 Datasheet, PDF (8/8 Pages) Analog Devices – HIGH ACCURACY 22 BIT INTERGRATING A/D CONVERTER
INTERFACING TO AN 8051 MICROCONTROLLER
To initialize the interface, first write" I"s to the port pins connec[ecl
Figure II shows how the AD 1175 may be interfaced to an 8051
to the data bus and the RD/ and WR/ control lines. This puts
microcontroller using a technique commonly called "byte bang-
ing", where the control lines and data bus of a device are man-
ipulated under firmware control. This "byte banging" technique
the 8051 I/O lines into a lightly "pulled up" state, simulating a
tri-stated condition on the bus to insure that neither RD/ nor
WR/ are selected:
4
can be adapted to most microprocessors and is useful in situations
INIT:
SETB PI.2
;DISABLE RDI
where a conventional bus structure is either nonexistent or
SETB P1.3
;AND WR/
unavailable for use. I
The AD 1175's data bus is connected to the 8051 using I/O lines
MOV P2, #OFFH ;SET P2 TO ALL ONES
P2.0 through P2.7. The address lines AO and Al are connected
To write a command to the AD1l75, first set the state of the
to I/O lines PLO and PI. I respectively. The RD/ and WR/ lines
are connected to Pl.2 and P1.3. The CS/ line of the AD1l75 is
PI. I and PLO lines for the address corresponding to the byte to
be written to (00 = COMMAND BYTE, 01 = PARAMETER).
grounded when it is the only device connected to the 8051, but
Set the P2 port to the command data, then strobe the WR/ line
multiple AD 1175s could easily be connected in the same way if
each CS/ line were separately controlled.
by first clearing the Pl.3 line and then setting it:
WRCMD: CLR PI.O
;F1RSTCLEARAOANDAI
CLR Pl.l
;TOPOINTTOCMDBYTE
OBSOLETE 8051
MOV P2, #00
CLR P1.3
SETB P1.3
;00 IS THE arCaDE FOR
;A DEFAULT MODE
CONVERSION
;STROBE THE WR/ LINE
;ONE TIME
MOV P2, #OFFH
;SET DATA BUSTO
;ALL ONES
To read a byte from the AD 1175, first set the PLO and PI. I
lines to point to the address of the byte desired. Bring the RD/
line low, reading the contents of P2. Return the RD/ line high:
RDSTAT: CLR PI.O
CLR PI. I
;POINT TO STATUS BYTE
CLR PI.2
MOV A,P2
SETB PI.2
;BRING RDI LINE LOW
;READ CONTENTS OF BUS
;RESTORE RD/ LINE HIGH
«
4
Figure 11. Simple AD 1175 to BO51 Interface
'Note that the 8051 microcontroller does contain a conventional bus structure;
the "byte banging" interface shown here is presented as an example of an
alternative technique.
SAMTEC Part Number SSQ-122-03-G-S (2 Each Required Per AD1l75)
Available direct from the manufacturer or through distributors.
2.22 (56.4)
2.10 (53.3)
l0.095
(2.4)
~~
4
~~~~~~~~~~~~~~~~~@~~~
0.100 (2.54)
T
r-
0.335
(8.5)
~
--r
0.390
(9.9)
~
NOTE
~~ 0.025 (O..OJ SO.
4
0.025" (0.64) SQUARE SOCKET STRIP, 22-PIN POSITIONS
GOLD PLATED CONTACTS AND PINS, BODV IS MOLDED
DUPONT RVNITE PET POL VESTER.
-8-