The document discusses various peripherals that can be interfaced with microcontrollers, including the 8255 Programmable Peripheral Interface (PPI), ADC0809 analog to digital converter, DAC0800 digital to analog converter, and serial communication standards like RS-232. It provides details on the architecture and interfacing of the 8255 PPI and describes how its ports are selected and programmed. It also provides interfacing diagrams and example programs for interfacing the 8255 with an 8051 microcontroller, as well as for interfacing the ADC0809 and DAC0800 for analog to digital and digital to analog conversion respectively. Finally, it discusses serial communication standards like RS-232, RS-485, RS-
MICROPROCESSOR AND INTERFACING
8255A : ppi
8259A : pic
Basics of 8255A PPI
Different I/O mode of 8255A
Basics of 8259A PIC
Different interrupt mode of 8259A
Programming Mode of 8259A
An analog-to-digital converter (ADC, A/D, or A to D) is a device that converts a continuous physical quantity (usually voltage) to a digital number that represents the quantity's amplitude.
The conversion involves quantization of the input, so it necessarily introduces a small amount of error. Instead of doing a single conversion, an ADC often performs the conversions ("samples" the input) periodically. The result is a sequence of digital values that have been converted from a continuous-time and continuous-amplitude analog signal to a discrete-time and discrete-amplitude digital signal.
MICROPROCESSOR AND INTERFACING
8255A : ppi
8259A : pic
Basics of 8255A PPI
Different I/O mode of 8255A
Basics of 8259A PIC
Different interrupt mode of 8259A
Programming Mode of 8259A
An analog-to-digital converter (ADC, A/D, or A to D) is a device that converts a continuous physical quantity (usually voltage) to a digital number that represents the quantity's amplitude.
The conversion involves quantization of the input, so it necessarily introduces a small amount of error. Instead of doing a single conversion, an ADC often performs the conversions ("samples" the input) periodically. The result is a sequence of digital values that have been converted from a continuous-time and continuous-amplitude analog signal to a discrete-time and discrete-amplitude digital signal.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Build a Module in Odoo 17 Using the Scaffold Method
Unit iii microcontrollers final1
1. Dr. C. SARITHA
DEPT. OF ELECTRONICS
UNIT III
Interfacing of Peripherals to Microcontrollers
Programmable Peripheral Interface (PPI-8255):
The Intel 8255 is a programmable peripheral interface (PPI). It has three 8-bit ports, namely
Port A, Port B and Port C. The Port C has been further divided into two 4-bit ports, Port C lower
and Port C upper. Thus, a total of 4 ports are available, two 8-bit ports and two 4-bit ports. Each
port can be programmed either as an input port or an output port.
Architecture of Intel 8255 :
`
Data Bus (D7-D0):
The data pins of the 8255 are connected to the data pins of the microcontroller. These lines are
used to send data back and forth between the controller and the 8255 chip.
Chip Select (CS ):
A low on this input selects the chip and enables the communication between the 8255 & the CPU.
RD (Read) :
A low on this pin enables the 8255 to send the data or status information to the CPU on the data
bus.
WR (Write) :
A low on this pin enables the CPU to write data or control words into the 8255.
A1, A0 port select lines:
While CS selects the entire chip, A0 and A1 lines selects the specific port.
CS A1 A0 Selection
0 0 0 Port A
0 0 1 Port B
0 1 0 Port C
1
2. Dr. C. SARITHA
DEPT. OF ELECTRONICS
0 1 1 Control Register
1 x x 8255 is not selected
RESET:
A high on this pin clears the control register and all ports (A, B & C) are initialized as
input ports.
PORTA:
It is an 8 bit port, can be programmed as either input or output port. It can also be used as a
bidirectional port.
PORT B:
It is an 8 bit port, can be programmed as either input or output port.
PORT C:
It is an 8 bit port, can be programmed as either input or output port. This port is again divided into
two 4-bit ports and each 4 bit port can be programmed individually.
Interfacing of 8255 with 8051:
In the 8051, Port 0 and Port 2 provide the 16-bit address to access external memory.
Among these two ports, P0 provides the lower 8 bit addresses A0-A7 and P2 provides the upper 8
bit addresses A8-A15. More importantly, P0 is also used to provide the 8-bit data bus D0-D7. In
other words, pins P0.0 – P0.7 are used for both the address and data paths. This is called
address/data multiplexing. To extract the addresses from the P0 pins, keep ALE=1 and connect a
74LS373 D latch to P0. Data lines are directly taken from the P0 by keeping ALE=0 in 8051. Only
A1 and A0 lines are used to select the ports of 8255.
Fig: Interfacing of 8255 with 8051
2
3. Dr. C. SARITHA
DEPT. OF ELECTRONICS
As shown in the diagram the P0.0 (A0) and P0.1 (A1) are used to select the ports of
8255 and the remaining lines of P0.2- P0.7(A2-A7) are kept at 0. The P2 lines i.e., P2.0 to P2.6
(A8 to A14) are kept at 0 and the remaining line P2.7 (A15) is connected to the CS line of 8255
through a not gate. The P3.6 (WR ) and P3.7 ( RD) lines of P3 are connected to the WR and
RD pins of 8255 respectively.
According to the diagram, the addresses of Port A, Port B, Port C and control
register are 8000H, 8001H, 8002H and 8003H respectively. By using these addresses a program is
written for generating a square wave of 50 % duty cycle using PA0.
MOV A,#80H ; Move control word to A
MOV DPTR, #8003H ; Load control register address
MOVX @DPTR, A ; Issue control word to control register
MOV DPTR, #8000H ; DPTR points to Port A
START: MOV A, #01H ; A=01H
MOVX @DPTR,A ; PA0 =1
ACALL DELAY ; Call a delay for the ON time
MOV A,#00H ; A=00H
MOVX @DPTR,A ; PA0 = 0
ACALL DELAY ; Call delay for OFF time
SJMP START ; Repeat to generate a continuous waveform
Interfacing of ADC to the 8051 :
An analog to digital converter is used to convert analog signals to digital quantity (binary
word). The digital output is fed to the microcontroller for processing. The most popular method of
analog to digital conversion is successive approximation method. A widely used ADC chip is
ADC0809.
Features of ADC 0809:
· It is an 8-bit A/D converter with 8 channel analog multiplexer.
· It is a National semiconductor make CMOS device.
· It uses successive approximation as the conversion technique.
· The device operates with single +5V power supply.
· The conversion time is 100μs at 640 KHz.
· The resolution is 8 bits
3
4. Dr. C. SARITHA
DEPT. OF ELECTRONICS
· Error is ±1 LSB
Interfacing diagram of ADC0809 with 8051:
As shown in the diagram Port 1 of 8051 microcontroller is connected to the data lines of
ADC0809. The address lines C, B, and A are grounded. So, Channel 0 is selected to apply the
analog input. To deactivate the remaining channels, they are grounded. Vref(+), Vcc and OE all are
connected to +5V. Vref (-) and GND pins are connected to ground. CLK must be applied to the
10th pin of ADC by using a clock source. SOC line is used to start the conversion and ALE line is
used to latch the address. To start the conversion and latch the address make these lines high
through the microcontroller. Then conversion begins. After some time EOC line becomes high, to
indicate the conversion is completed and the equivalent digital word is at Port 1. The timing
diagram shows the entire procedure of analog to digital conversion.
Fig: Timing diagram for ADC 0809
4
5. Dr. C. SARITHA
DEPT. OF ELECTRONICS
Program:
START: SETB P3.4 ; Set SOC = 1, ALE = 1
ACALL DELAY ; Call for the delay
CLR P3.4 ; Clear SOC and ALE
HERE: JNB P3.5,HERE ; Check, for EOC = 1
MOV A, P1 ; Move the data from Port 1 to A
SJMP START ; Continue the same
Result :
Analog input in Volts Digital output in Hex
0
1
2
3
4
5
00
33
66
99
CC
FF
Interfacing of DAC0800 with 8051 :
Digital to analog converters are used to convert digital quantity to analog quantity. D/A converter
produces an output proportional to the digital quantity (binary word) applied to its input. A most
widely used DAC chip is DAC 0800.
Features of DAC0800:
· It is an 8-bit DAC
· It has fast settling time : 100ns
· The conversion technique used is R-2R ladder network method
· It operates at +4.5V to +18V supply
· Low cost
· Full scale error: ±1 LSB
· Low power consumption
5
6. Dr. C. SARITHA
DEPT. OF ELECTRONICS
Interfacing diagram of DAC with 8051:
As shown in the diagram Port 1of 8051 microcontroller is connected to the data lines of
DAC. The supply V+ is connected to the +5V or +12V. V- is connected to the -12V. The DAC
0800 is a current output device. So, an op-amp is used, to convert the output of DAC i.e., current to
voltage. One of the applications of an op amp is as a current to voltage converter. The output of
the op amp is the actual analog voltage, which is equivalent to the applied digital word through the
microcontroller.
Program:
START: MOV A, #DATA ; Move the digital input to A
MOV P1, A ; Move data 80H to Port 1
SJMP START ; Continue the same
Result :
Digital input
In Hex
Analog output
In volts
00
40
80
CC
FF
0
2.5
5
7.5
10
6
7. Dr. C. SARITHA
DEPT. OF ELECTRONICS
Digital Data transmission :
The transmission of binary data across a link can be accomplished either in parallel mode or
serial mode.
Parallel transmission :
In parallel transmission, multiple bits are sent at a time. The advantage of parallel
transmission is speed. But, the disadvantage of this parallel transmission is cost. Because, it
requires n channels to transmit n bits. So, Parallel transmission is usually limited to short distances.
Examples of parallel transmission include connections between a computer and a printer.
Serial transmission :
In serial transmission one bit follows another. It needs only one communication channel.
The advantage of serial communication is cost. Examples of serial transmission include
connections between a computer and a modem using the RS-232 protocol .
Serial communication occurs in one of two ways : Asynchronous and Synchronous.
7
8. Dr. C. SARITHA
DEPT. OF ELECTRONICS
Asynchronous transmission :
In asynchronous transmission, the timing of the signal is unimportant. In asynchronous
transmission, we send one start bit (0) at the beginning and one or more stop bits (1s) at the end of
each byte. There may be a gap between each byte.
Synchronous transmission :
In synchronous transmission, timing is important. In synchronous transmission, we send
bits one after another without start/stop bits or gaps. It is the responsibility of the receiver to group
the bits.
Serial Communication – Modes :
The transmission mode is used to define the direction of signal flow between two devices.
There are three types of transmission modes : Simplex, half-duplex and full duplex.
Simplex Mode :
In simplex mode, the communication is unidirectional, as on a one way street. Only one of
the two stations on a link can transmit, the other can only receive.
Keyboards and traditional monitors are both examples of simplex devices. The keyboard
can only introduce input, the monitor can only accept output.
8
9. Dr. C. SARITHA
DEPT. OF ELECTRONICS
Half-duplex Mode :
In half-duplex mode, each station can both transmit and receive, but not at the same time.
When one device is sending, the other can only receive, and vice versa.
The half-duplex mode is like a one-lane road with two directional traffic. Walkie-talkies
and CB (Citizen’s Band) radios are both half duplex systems.
Full-duplex Mode :
In full-duplex mode (also called duplex), both stations can transmit and receive
simultaneously.
The full-duplex mode is like a two way street with traffic flowing in both directions at the
same time. One common example of full duplex communication is the telephone network.
Serial Communication Protocols :
A variety of communication protocols have been developed based on serial communication in the
past few decades. Some of them are:
1. RS-232
2. RS-423
3. RS-485
4. RS422
5. USB
6. Fire Wire
7. Ethernet
8. MIDI
9. PCI Express
10. SPI & SCI
11. I2C
12. IrDA
9
10. Dr. C. SARITHA
DEPT. OF ELECTRONICS
RS-232 – Recommended Standard 232:
RS-232 has been a standard for decades as an electrical interface between Data Terminal
Equipment (DTE) and Data Circuit-Terminating Equipment (DCE). A DTE is any device that is
source or destination for binary data. A DCE is any device that transmits or receives data in the
form of an analog or digital signal through a network.
RS-232 is the oldest and most popular serial communication standard. RS232 stands for
Recommended Standard number 232. It is developed by EIA (Electronics Industries Association)
in 1960. It is the standard used in PCs and various types of equipment. It is used to connect only
two devices. This RS232 standard defines the interface as a 25 wire cable with male and a female
DB 25 pin connector attached to either end. The length of the cable may not exceed 15 meters (50
feet).
However, since the standard was set long before the advent of TTL logic family, its input
and output voltage level are not TTL compatible. In RS232, a 1 bit is represented by -3 to -15V,
while a 0 bit is represented by +3 to +15V, making -3 to +3 undefined. For this reason, to connect
any RS232 to a microcontroller system , we must use voltage converters such as MAX 232 to
convert the TTL logic levels to the RS232 voltage level, and vice-versa.
8051 connection to RS232 :
The 8051 has two pins that are used specifically for transferring and receiving data serially.
These two pins are called TxD and RxD and are part of the port 3 (P3.0 and P3.1). Pin 11 of the
8051 (P3.1) is assigned to TxD and pin 10 (P3.0) is designated as RxD. These pins are TTL
compatible. Therefore, they require line driver to make them RS232 compatible. One such line
driver is the MAX232 chip.
10
11. Dr. C. SARITHA
DEPT. OF ELECTRONICS
The MAX232 has two sets of line drivers for transferring and receikving data. The line
drivers used for TxD are called T1 and T2, while the line drivers for RxD are designated as R1 and
R2. In many applications only one set is used. For example, T1 and R1 are used together for TxD
and RxD of the 8051, and the second set is left unused. In MAX232 the T1 line driver has a
designation of T1 in and T1 out on pin numbers 11 and 14, respectively. The T1 in pin is the TTL
side and is connected to TxD of the microcontroller, while T1 out is the RS 232 side that is
connected to the RxD pin of the RS232 DB connector. The R1 line driver has a designation of R1
in and R1 out on pin numbers 13 and 12 respectively. The R1 in (pin 13) is the RS232 side that is
connected to the TxD pin of the RS232 DB connector, and R1 out (pin 12) is the TTL side that is
connected to the RxD pin of the microcontroller.
RS-485 :
RS-485 is an improved RS-422 with the capability to connect up to 16 devices (transceivers)
on one serial bus to form a network. Such a network can have a "daisy chain" topology where each
device is connected to two other devices except for the devices on the ends. Only one device may
drive data onto the bus at a time. The standard does not specify the rules for deciding who transmits
and when on such a network. That is up to the system designer to define.
RS-423 :
RS-423 is similar to RS-232C except that it allows for higher baud rates and longer cable
lengths because it tolerates ground voltage differences between sender and receiver. The maximum
signal voltage levels are ±6 volts. Ground voltage differences can occur in electrically noisy
environments where heavy electrical machinery is operating.
RS-422 :
RS-422, like RS-232, is used to connect only two systems. It uses differential, or "double
ended" data transmission, which means that data is transmitted simultaneously on two wires
between two stations independent of the ground wire. Each signal requires 2 wires with a ground
present in the system. The advantage of this method over RS-232 is higher speeds and longer cable
lengths - 4000 feet at a 100K baud rate, for example.
11
12. Dr. C. SARITHA
DEPT. OF ELECTRONICS
SPI – Serial Peripheral Interface:
It is a three-wire based communication system. One wire each for Master to slave and Vice-versa,
and one for clock pulses. There is an additional SS (Slave Select) line, which is mostly used
when we want to send/receive data between multiple ICs.
I2C – Inter-Integrated Circuit:
Pronounced eye-two-see or eye-square-see, this is an advanced form of USART. The
transmission speeds can be as high as a whopping 400KHz. The I2C bus has two wires – one for
clock, and the other is the data line, which is bi-directional – this being the reason it is also
sometimes (not always – there are a few conditions) called Two Wire Interface (TWI). It is a pretty
new and revolutionary technology invented by Philips.
FireWire :
Developed by Apple, they are high-speed buses capable of audio/video transmission. The
bus contains a number of wires depending upon the port, which can be either a 4-pin one, or a 6-pin
one, or an 8-pin one.
Ethernet:
Used mostly in LAN connections, the bus consists of 8 lines, or 4 Tx/Rx pairs.
Universal serial bus (USB):
This is the most popular of all. Is used for virtually all type of connections. The bus has 4
lines: VCC, Ground, Data+, and Data-.
×××××
12