0% found this document useful (0 votes)
39 views

Unit 7

The 8255 PPI chip allows a microcontroller to interface with peripheral devices. It has three 8-bit ports (A, B, C) that can be independently programmed as input or output. A control register determines the I/O mode for each port. The 8051 microcontroller connects to the 8255 via its data and control lines to read from and write data to the ports. Analog signals from sensors are converted to digital for use by computers using an ADC like the 8-bit ADC0804 chip.

Uploaded by

Suresh Meesala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Unit 7

The 8255 PPI chip allows a microcontroller to interface with peripheral devices. It has three 8-bit ports (A, B, C) that can be independently programmed as input or output. A control register determines the I/O mode for each port. The 8051 microcontroller connects to the 8255 via its data and control lines to read from and write data to the ports. Analog signals from sensors are converted to digital for use by computers using an ADC like the 8-bit ADC0804 chip.

Uploaded by

Suresh Meesala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

UNIT VII

8255 PROGRAMBLE PERIPHIRAL INTERFACE: (8255PPI)


The 8255 is a 40 – pin DIP chip. It has three separately accessible ports. The
ports are each 8 bit, and are name A, B, and C. the individual ports of the 8255 can be
programmed to be input or output, and can be changed dynamically. In addition, 8255
ports have handshaking capability, thereby allowing interface with devices that also have
handshaking signals, such as printers.
PA0 – PA7: The 8 bit port A can be programmed as all input, or as all output, or all
bits as bidirectional input/output.

PB0 – PB7: The 8 bit port B can be programmed as all input or as all output. Port B
cannot be used as a bidirectional port.

PC0 – PC7: This 8 bit port C can be all input or all output. It can also be split into
two parts, CU (port c upper PC4 – PC7) and CL (port c lower PC0- PC3). Each can be
used for input or output.

RD and WR: These tow active - low control signals are inputs to the 8255. The RD
and WR signals from the 8051 are connected to these inputs, to read data from
8051 or to write data to the 8051 microcontroller.

D0 – D7: The data pins of the 8255 are connected to the data pins of the
microcontroller allowing it to send data back and forth between the controller and the
8255 chip.

RESET: This is an active – high signal input into the 8255 used to clear the control
register. When RESET is activated, all ports are initialized as input ports. In many
designs this pin is connected to the RESET output of the system bus or grounded to
make it inactive.

A0, A1 and CS: While CS (chip select) selects the entire chip, it is A0 and A1 that select
specific ports. These three pings are used to access ports A, B,C or the control register.
BLOCK DIAGRAM OF 8255 PPI:

PA7- PA0
GROUP
GROUP A
A
CONTROL PORT A

D0-D7 DATA PC7-PC4


BUS GROUP A
PORT C
BUFFER UPPER
BDB

8 bit internal PC3-PC0


GROUP B
RD Data bus
PORT C
WR READ LOWER

WRITE
A0
CONTROL
A1 LOGIC GROUP PB7-PB0
B
GROUP B
RESET CONTROL
PORT B

CS
CONTROLWORD REGISTER OF 8255:

D7 D6 D5 D4 D3 D2 D1 D0

PORT C
1 = I/O MODE
MODE SELECTION (LOWER
PORT A
0 = BSR MODE 0 = MODE 0 PC3 – PC0)
1= INPUT
1 = MODE 1 1 = INPUT
0 = OUTPUT
0 = OUTPUT

MODE SELECTION PORT B


PORT C 1 = INPUT
00 = MODE 0 (UPPERPC7- 0 = OUTPUT
01 = MODE 1 PC4)
1 = INPUT
1X = MODE 2 0 = OUTPUT

MODE SELECTION OF THE 8255:

While ports A, B, and C are used to input or output data, it is the control
register that must be programmed to select the operation mode of the three ports.
The ports of the 8255 can be programmed in any of the following modes.

MODE 0 (SIMPLE I/0 MODE): In this mode, any of the ports A, B, CL and CU can be
programmed as input or output in this mode, all bits are out or all are in. in other
words, there is no such things as single bit control as we have seen in P0-P3 of the
8051. Since the vast majority of applications involving the 8255 use this simple I/O
mode.

MODE 1: in this mode, ports A and B can be used as input or output port with
handshaking capabilities. Handshaking signals are provided by the bits of port C.
MODE 2: In this mode, port A can be used as a bidirectional I/O port with
handshaking capabilities whose signals are provided by port C. Port B can be used as
simple I/O mode or MODE 1.

BSR (BIT SET / RESET) MODE: In this mode, only the individual bits of port C can be
programmed.

INTERFACING OF 8051 TO 8255 :

P3.7
P3.6
P2.7
WR RD

ALE CS PA

8051 P2.0
8255 PB
P0.7
P0.6
A1 PC
P0.5
P0.4
P0.3
74LS373 A0

P0.2
P0.1 D7 D6 D5 D4 D3 D2 D1 D0 RES
P0.0

The 8255 chip is programmed in any of the 4 modes


mentioned earlier by sending a byte to the control register of the 8255. We first
find the port addresses assigned to each of ports A, B, C and the control register.
This is called as mapping the I/O devices
ANALOG TO DIGITAL CONVERTERS (ADC):
Analog to digital converters are among the most widely used
devices for data acquisition. Digital computers use binary (discrete) values, but in the
physical world everything is analog (continuous). Temperature, pressure (wind or
liquid), humidity, and velocity are a few examples of physical quantities that we deal
with every day.
A physical quantity is converted to electrical (voltage, current)
signals using a device called a transducer. Transducers are also referred to as sensors.
Sensors for temperature, velocity, pressure, light, and many other natural quantities
produce an output that is voltage or current
An ADC has n- bit resolution where n can be 8, 10, 12, 16 or even 24
bits. In addition to resolution, step size and conversion time is another major factor in
judging an ADC.
Conversion time: it is defined as the time it takes the ADC to convert the analog input
to a digital (binary) number.
Step size: step size is the smallest change that can be discerned by an ADC.

ADC0804 CHIP:

The ADC0804 IC is an 8 – bit parallel ADC in the family of the


ADC0800 series from national semiconductor. It is also available from many other
manufactures. It works with +5v and has a resolution of 8 – bit. In the ADC0804, the
conversion timer varies depending on the clock frequency.

CS (CHIP SELECT):
Chip select is an active low input used to activate the ADC0804
chip. To access the ADC0804, this pin must be low.

RD (READ):
This is an input signal and is active low. The ADC converts the
analog input to its binary equivalent and holds it in an internal register to get the
converted data out of the ADC0804 using RD, if high to low pulse is applied to the RD
pin; the 8 bit digital output shows up at the D0 – D7 data pins. The RD pin is also
referred to as output enable (OE).
PIN DIAGRAM OF ADC0804

+5v

10K
V in (+) D0

V in (-) D1

A GND A D2

V ref/2 D D3 LED’S
10K CLK R C D4

150PF CLK in 0 D5

8 D6

CS 0 D7

RD 4 WR

D GND INTR

WR (WRITE OR START CONVERSION):

This is an active low input used to inform the ADC0804 to start


the conversion process. If CS=0 when WR makes a low to high transition, the ADC0804
starts converting the analog input value of v in to an 8 bit digital number. The amount
of time it takes to convert varies depending on the CLK IN and CLK R values .
CLK IN and CLK R:

CLK IN is an input pin connected to an external clock source when


an external clock is used for timing. However, the ADC0804 has an internal clock
generator. To use the internal clock generator (also called as self clocking) of the
ADC0804, the CLK IN and CLK R pins are connected to a capacitor and a resistor.

In the case of clock frequency is determined by the equation.

f = 1/1.1RC

Typical values are R = 10Kohms and C = 150pf. Substituting in the above equation, we
get f= 606KHZ. In that case, the conversion time is 110 micro seconds.

INTR (interrupt or end of conversion):

This is an output pin and is active low. It is an normally high pin


and when the conversion is finished, it goes low to signal the CPU that the converted
data is ready to be picked up. After INTR goes low, we make CS=0 and send a high to
low pulse to the RD pin to get the data out of the ADC0804.

V in (+) AND V in (-):


These are the differential analog inputs where V in (+) – V in (-) pin
is connected to ground and the V in (+) pin is used as the analog input to be converted
to digital.
VCC:
This is the +5v power supply. It is also used as a reference voltage
when the V ref/2 input is opening (not connected).

V ref/2:
If V ref/2 is not connected, the analog input voltage for the
ADC0804 is in the range of 0 to 5v. However, there are many applications where the
analog input applied to V in needs to be other than the 0 to 5v range. V ref/2 is used
to implement analog input voltage other than 0 to 5v.
D0 - D7:
The data bus used to carry data back and forth between ADC0804 to
8051 micro controller.

A GND and D GND:


These are the input pins providing the ground for both the analog
signal and the digital signal. Analog ground is connected to the ground of the analog V
in while digital ground is connected to the ground of the Vcc pin.

INTERFACING OF ADC0804 TO 8051: 5V

P2.5 RD VCC 10K 150PF


P2.6 WR CLK R
P1.0 D0 CLK IN
P1.1 D1 V ref/2
P1.2 10K D2 V in (+)
P1.3 POT D3 V in (-)
P1.4 D4 A GND
P1.5 D5 CS
P1.6 D6 D GND
P1.7 D7
P2.7 INTR
8051 ADC0804
DIGITAL TO ANALOG CONVERTOR:
The digital to analog converter (DAC) is a device widely used to
convert digital pulses to analog signal. In digital electronics the two methods of creating
a DAC: binary weighted and R/2R ladder. The majority of DAC integrated circuits
including MC1408 (DAC 0808) used in R/2R ladder method since it can achieve a much
higher degree of precision.
The first criterion for judging a DAC is its resolution which is the
function of the number of binary inputs. The common ones are 8, 10, and 12. The
number of data bits inputs decides the resolution of the DAC since the number of analog
output levels is equal to 2n, where n is the number of data bit inputs therefore, an 8
input DAC such as the DAC 0808 provides 256 discrete voltage or current levels of
output, the 12 bit DAC provides 4096 discrete voltage levels. There are also 16 bit DAC’s,
but they are more expensive.

DAC 0808 or MC1408:


In MC1408 or DAC0808 the digital inputs are converting into voltage, the total voltage
provided by the V out is a function of binary numbers at the A0 – A7 inputs and hence
the output voltage V out can be finding based on the formula of

VOUT = V ref /r14 [A0/2 + A1/4 + A2/8 + A3/16 + A4/32 + A5/64 + A6/128 + A7/256]

Where A0 is the LSB and A7 is the MSB for the inputs and V ref is
the input voltage that must be applied to pin 14. Some DAC’s also use the Zener diode
(LM336), which overcomes any fluctuation associated with the power supply voltage.
CHARACTERSTICS OF DAC:
Digital to analog converter mainly depending upon the two characteristics
(1)Resolution (2) full scale output voltage
Resolution: The first characteristic of the DAC to consider as a resolution this is
determined by the no of bits in the binary input, a converter with 8 binary inputs means
it has 28 or 256 possible levels.
Full scale output voltage: Let us assume if DAC is a 10 volts output converter, it will not
get the 10 volts output voltage. Because due to the full scale output voltage. And the
method of full-scale output voltage is explained below
V out = V ref/R14 XR0 [A0/2 +A1/4 +A2/8 +A3/16 + A4/32 + A5/64 +A6/128 + A7/256]
If all the bits are high A0 – A7 = 11111111, V ref = 2v, R14 = 1K, R0 = 5K
V out = 2/1x103 x 5 x 103 [ 1/2 + 1/4 + 1/8 + 1/16+ 1/32+ 1/64+ 1/128+ 1/256]
V out = 10[255/256] = = 9.961 = 10v
PIN DIGRAM OF MC1408 OR DAC0808:

(+5V)

13 R14
A0 5 14 V ref

A1 6 15
D
A2 7 A 1
C
A3 8 0 2
8
A4 9 0
R0 8
A5 10 V0 4

A6 11

A7 12
16 3
INTERFACING OF 8051 TO MC1408 OR DAC0808:

13
P1.0 5 14

P1.1 6 15
8 D
P1.2 7 A 1
0 C
P1.3 8 0 2
5 8
P1.4 9 0
1 8
P1.5 10 4

P1.6 11

P1.7 12
16 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy