MPMC U3 PDF
MPMC U3 PDF
Data Transfers
Synchronous ----- Usually occur when
peripherals are located within the same
computer as the CPU. Close proximity
allows all state bits change at same
time on a common clock.
Asynchronous ----- Do not require that
the source and destination use the
same system clock.
322
Parallel communication
interface
INTEL 8255
8255 PPI
• The 8255 chip is also called as Programmable
Peripheral Interface.
• The Intel’s 8255 is designed for use with Intel’s
8-bit, 16-bit and higher capability
microprocessors
• The 8255 is a 40 pin integrated circuit (IC),
designed to perform a variety of interface
functions in a computer environment.
• It is flexible and economical.
328
Signals of 8085
8255 PIO/PPI
330
Control Logic
CS signal is the master Chip Select
A0 and A1 specify one of the two I/O Ports
CS A1 A0 Selected
0 0 0 Port A
0 0 1 Port B
0 1 0 Port C
0 1 1 Control
Register
1 X X 8255 is not
selected
Block Diagram of 8255A 334
335
CS , RD , WR , RESET , A1 , A0
338
interrupt capability
345
346
Solution:
1 0 1 0 1 1 1 0 = AEH
349
Solution:
1 0 0 0 0 0 0 0 = 80H
Solution:
1 0 0 1 1 0 1 1 = 9BH
- A parallel-in, serial-out
shift register
- A serial-in, parallel-out
shift register.
-
351
TRANSMITTER 352
Receiver
Serial communication
353
interface
INTEL 8251 USART
UNIVERSAL SYNCHRONOUS 354
ASYNCHRONOUS RECEIVER
TRANSMITTER (USART)
Programmable chip designed for
synchronous and asynchronous serial data
transmission
28 pin DIP
Coverts the parallel data into a serial stream
of bits suitable for serial transmission.
Receives a serial stream of bits and convert
it into parallel data bytes to be read by a
microprocessor.
355
BLOCK DIAGRAM 356
357
Five Sections
– Read/Write Control Logic
• Interfaces the chip with MPU
– Transmitter
• Converts parallel word received from MPU into serial bits
– Receiver
• Receives serial bits from peripheral
telephone line
358
Input Signals
CS – Chip Select
When this signal goes low, 8251 is selected by
MPU for communication
C/D – Control/Data
When this signal is high, the control register
or status register is addressed
When it is low, the data buffer is addressed
Control and Status register is differentiated by
WR and RD signals, respectively
359
• WR – Write
– writes in the control register or sends outputs to the
data buffer.
– This connected to IOW or MEMW
• RD – Read
– Either reads a status from status register or accepts
data from the data buffer
– This is connected to either IOR or MEMR
• RESET - Reset
• CLK - Clock
– Connected to system clock
– Necessary for communication with microprocessor.
360
CS C/D RD WR Function
0 1 1 0 MPU writes instruction in the
control register
0 1 0 1 MPU reads status from the status
register
0 0 1 0 MPU outputs the data to the Data
Buffer
0 0 0 1 MPU accepts data from the Data
Buffer
1 X X X USART is not Selected
361
• Control Register
– 16-bit register
– This register can be accessed an output port
when the C/D pin is high
• Status Register
– Checks ready status of a peripheral
• Data Buffer
362
Transmitter Section
Section
• TxD – Transmit Data
– Serial bits are transmitted on this line
register is empty
364
Receiver Section
Section
RxD – Receive Data
Bits are received serially on this line and
converted into parallel byte in the receiver input
RxC – Receiver Clock
RxRDY – Receiver Ready
It goes high when the USART has a character in
the buffer register and is ready to transfer it to
the MPU
Signals Associated with Modem 366
Control
• DSR- Data Set Ready
– Normally used to check if the Data Set is ready when
communicating with a modem
• DTR – Data Terminal Ready
– device is ready to accept data when the 8251 is
communicating with a modem.
• RTS – Request to send Data
– the receiver is ready to receive a data byte from
modem
• CTS – Clear to Send
367
Control words
368
369
370
371
372
Interfacing of 8255(PPI) with 8085 processor:
373
11-
374
Programming 8251
8251 mode register
7 6 5 4 3 2 1 0 Mode register
TIMER/COUNTER
390
RD: read signal 391
11-394
8254 Modes
Gate is low the
count will be Mode 0: An events counter enabled with G.
paused
Gate is high
Will continue
counting
Gate is
High output
will be high
395
Mode 2: Counter generates a series of pulses 1 clock
pulse wide
397
398
Keyboard/Display
Controller
INTEL 8279
399
Keyboard section
Display section
Scan section
a) Keyboard Display Mode Set : The format of the command word to select different
modes of operation of 8279 is given below with its bit definitions.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 D D K K K
413
SENSOR MATRIX
SENSOR MATRIX
414
B) Programmable clock :
0 0 1 P P P P P
c) Read FIFO / Sensor RAM : The format of this command is given 415
below.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 0 AI X A A A
D7 D6 D5 D4 D3 D2 D1 D0
0 1 1 AI A A A A
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 AI A A A A
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 X IW IW BL BL
E- Error mode
X- don’t care
INTERRUPT
CONTROLLER
8259 Programmable Interrupt Controller (PIC)
1. This IC is designed to simplify the implementation of the interrupt interface in the 8088
and 8086 based microcomputer systems.
2. This device is known as a ‘Programmable Interrupt Controller’ or PIC.
3. It is manufactured using the NMOS technology and It is available in 28-pin DIP.
4. The operation of the PIC is programmable under software control (Programmable)and it
can be configured for a wide variety of applications.
5. 8259A is treated as peripheral in a microcomputer system.
6. 8259A PIC adds eight vectored priority encoded interrupts to the microprocessor.
7. This controller can be expanded without additional hardware to accept up to 64
interrupt request inputs. This expansion required a master 8259A and eight 8259A
slaves.
8. Some of its programmable features are:
· The ability to accept level-triggered or edge-triggered inputs.
· The ability to be easily cascaded to expand from 8 to 64 interrupt-inputs.
· Its ability to be configured to implement a wide variety of priority schemes.
8259A PIC- PIN DIGRAM
8
2
5
9
ASSINGMENT OF SIGNALS FOR 8259:
1. D7- D0 is connected to microprocessor data bus D7-D0 (AD7-AD0).
2. IR7- IR0, Interrupt Request inputs are used to request an interrupt and to connect to a slave
in a system with multiple 8259As.
3. WR - the write input connects to write strobe signal of microprocessor.
4. RD - the read input connects to the IORC signal.
5. INT - the interrupt output connects to the INTR pin on the microprocessor from the master,
and is connected to a master IR pin on a slave.
6. INTA - the interrupt acknowledge is an input that connects to the INTA signal on the system.
In a system with a master and slaves, only the master INTA signal is connected.
7. A0 - this address input selects different command words within the 8259A.
8. CS - chip select enables the 8259A for programming and control.
9. SP/EN - Slave Program/Enable Buffer is a dual-function pin.
When the 8259A is in buffered mode, this pin is an
output that controls the data bus transceivers in a
large microprocessor-based system.
When the 8259A is not in buffered mode, this pin
programs the device as a master (1) or a slave (0).
CAS2-CAS0, the cascade lines are used as outputs from
the master to the slaves for cascading multiple
8259As in a system.
8259A PIC- BLOCK DIAGRAM
Programming the 8259A: -
The 82C59A accepts two types of command words generated by the
CPU:
1. Initialization Command Words (ICWs):
Before normal operation can begin, each 82C59A in the
system must be brought to a starting point - by a sequence of 2 to
4 bytes timed by WR pulses.
2. Operational Command Words (OCWs):
These are the command words which command the 82C59A
to operate in various interrupt modes. Among these modes are:
a. Fully nested mode.
b. Rotating priority mode.
c. Special mask mode.
d. Polled mode.
The OCWs can be written into the 82C59A anytime after
initialization.
ICW1:
Selects the vector number used with the interrupt request inputs.
For example, if we decide to program the 8259A so that it functions at vector
locations 08H-0FH, we place a 08H into this command word.
Likewise, if we decide to program the 8259A for vectors 70H-77H, we place a
70H in this ICW.
ICW3:
Is used only when ICW1 indicates that the system is operated in cascade mode.
This ICW indicates where the slave is connected to the master.
For example, if we connected a slave to IR2, then to program ICW3 for this
connection, in both master and slave, we place a 04H in ICW3.
Suppose we have two slaves connected to a master using IR0 and IR1. The
master is programmed with an ICW3 of 03H; one slave is programmed with an
ICW3 of 01H and the other with an ICW3 of 02H.
ICW4:
Is programmed only when the AEOI mod is not selected for the 8259A.
In this case, this OCW selects how the 8259A responds to an interrupt.
The modes are listed as follows in next slide:
OCW3:
Selects the register to be read, the operation of the special mask register, and
the poll command.
If polling is selected, the P-bit must be set and then output to the 8259A. The
next read operation would read the poll word. The rightmost three bits of the
poll word indicate the active interrupt request with the highest priority.
The leftmost bit indicates whether there is an interrupt, and must be checked
to determine whether the rightmost three bits contain valid information.
8237DMA CONTROLLER
453
Introduction:
Direct Memory Access (DMA) is a method of allowing data
to be moved from one location to another in a computer
without intervention from the central processor (CPU).
It is also a fast way of transferring data within (and
sometimes between) computer.
The DMA I/O technique provides direct access to the
memory while the microprocessor is temporarily disabled.
The DMA controller temporarily borrows the address bus,
data bus and control bus from the microprocessor and
transfers the data directly from the external devices to a
series of memory locations (and vice versa).
454
The 8237 DMA controller
• Supplies memory and I/O with control signals and addresses during DMA
transfer
• 4-channels (expandable)
– 0: DRAM refresh
– 1: Free
– 2: Floppy disk controller
– 3: Free
• 1.6MByte/sec transfer rate
• 64 KByte section of memory address capability with single programming
• “fly-by” controller (data does not pass through the DMA-only memory to I/O
transfer capability)
• Initialization involves writing into each channel:
• i) The address of the first byte of the block of data that must be transferred (called
the base address).
• ii) The number of bytes to be transferred (called the word count).
455
8237 pins
• CLK: System clock
• CS΄: Chip select (decoder output)
• RESET: Clears registers, sets mask register
• READY: 0 for inserting wait states
• HLDA: Signals that the μp has relinquished buses
• DREQ3 – DREQ0: DMA request input for each channel
• DB7-DB0: Data bus pins
• IOR΄: Bidirectional pin used during programming
and during a DMA write cycle
• IOW΄: Bidirectional pin used during programming
and during a DMA read cycle
• EOP΄: End of process is a bidirectional signal used as input to terminate a DMA process or
as output to signal the end of the DMA transfer
• A3-A0: Address pins for selecting internal registers
• A7-A4: Outputs that provide part of the DMA transfer address
• HRQ: DMA request output
• DACK3-DACK0: DMA acknowledge for each channel.
• AEN: Address enable signal
• ADSTB: Address strobe
• MEMR΄: Memory read output used in DMA read cycle
• MEMW΄: Memory write output used in DMA write cycle
456
8237 block diagram
457
Block Diagram Description
461
Programming and
applications Case
studies
1.Traffic Light control
2.LED display
3.LCD display
4.Keyboard display interface
462 5.Alarm Controller
1. TRAFFIC
LIGHT
CONTROL
463
Traffic lights, which may also be known as stoplights, traffic
lamps, traffic signals, signal lights, robots or semaphore, are
signaling devices positioned at road intersections, pedestrian
crossings and other locations to control competing flows of
traffic.
INTERFACING TRAFFIC LIGHT WITH 8086
The Traffic light controller section consists of 12 Nos.
point led’s arranged by 4Lanes in Traffic light interface card.
Each lane has Go(Green), Listen(Yellow) and Stop(Red) LED
is being placed.
464
LAN Direction 8086 LINES MODULES
465
CIRCUIT DIAGRAM TO INTERFACE TRAFFIC LIGHT WITH 8086
466
8086 ALP:
1100: START: MOV BX, 1200H
MOV CX, 0008H
MOV AL,[BX]
MOV DX, CONTROL PORT
OUT DX, AL
INC BX
NEXT: MOV AL,[BX]
MOV DX, PORT A
OUT DX,AL
CALL DELAY
INC BX
LOOP NEXT
JMP START
DELAY: PUSH CX
MOV CX,0005H
REPEAT: MOV DX,0FFFFH
LOOP2: DEC DX
JNZ LOOP2
LOOP REPEAT
POP CX
RET
467
Lookup Table
1200 80H
1201 21H,09H,10H,00H (SOUTH WAY)
1205 0CH,09H,80H,00H (EAST WAY)
1209 64H,08H,00H,04H (NOURTH WAY)
120D 24H,03H,02H,00H (WEST WAY)
1211 END
468
2. LED DISPLAY
469
Light Emitting Diodes (LED) is the most commonly
used components, usually for displaying pins digital states.
Typical uses of LEDs include alarm devices, timers and
confirmation of user input such as a mouse click or keystroke.
INTERFACING LED
Anode is connected through a resistor to GND & the
Cathode is connected to the Microprocessor pin. So when the
Port Pin is HIGH the LED is OFF & when the Port Pin is LOW
the LED is turned ON.
470
PIN ASSIGNMENT WITH 8086
471
INTERFACE LED WITH 8255
472
8086 ALP LED interface
1100: START: MOV AL, 80
MOV DX, FF36
OUT DX, AL
BEGIN: MOV AL, 00
MOV DX, FF30
OUT DX, AL
CALL DELAY
MOV AL, FF
OUT DX, AL
CALL DELAY
JMP BEGIN
DELAY: MOV CX, FFFF
PO: DEC CX
JNE PO
RET
473
3. LCD DISPLAY
474
475
HARDWARE CONFIGURATION OF LCD
WITH 8051/8086/8085
476
LCD INTERFACING WITH 8086
TRAINER KIT
GPIO- I (8255) J1 Connector
PORTS ADDRESS
Control port FF26
PORT A FF20
PORT B FF22
PORT C FF24
477
478
Used in UNIT 5 also
479
480
4. Keyboard display interface
481
HARDWARE DESCRIPTION OF 8279 INTERFACE CARD
Keyboard and display is configured in the encoded mode.
In the encoded mode, a binary count sequence is put on the scan
lines SL0-SL3.These lines must be externally decoded to provide
the scan lines for keyboard and display. A 3 to 8 decoder
74LS138 is provided for this purpose. The S0-S1 output lines of
this decoder are connected to the two rows of the keyboard.
And QA0 to QA7 is connected to 7 Segment Display
482
483
5. ALARM
CONTROLLER
Relevant
Material
Not exact
488
489
GPIO- I J1 Connecter
PORTS ADDRESS
Control port FF26
PORT A FF20
PORT B FF22
PORT C FF24
GPIO- II J1 Connecter
PORTS ADDRESS
Control port FF36
PORT A FF30
PORT B FF32
PORT C FF34
490
Basics
Microprocessor &
Microcontroller
491
What is Microcontroller?
Micro Controller
A smaller computer
On-chip RAM, ROM, I/O ports...
Example: Motorola’s 6811, Intel’s 8051, Zilog’s
Z8 and PIC
494
495
Microprocessor Microcontroller
Not Expansive
Expansive
Single-purpose
General-purpose
496
Home
Appliances, intercom, telephones, security systems, garage door
openers, answering machines, fax machines, home computers,
TVs, cable TV tuner, VCR, camcorder, remote controls, video
games, cellular phones, musical instruments, sewing machines,
lighting control, paging, camera, pinball machines, toys, exercise
equipment etc.
Office
Telephones, computers, security systems, fax machines,
microwave, copier, laser printer, color printer, paging etc.
Auto
Trip computer, engine control, air bag, ABS, instrumentation,
security system, transmission control, entertainment, climate
control, cellular phone, keyless entry
497