Chapter-8 (Part-I) : (Programmable Peripheral Interface)
Chapter-8 (Part-I) : (Programmable Peripheral Interface)
Chapter-8 (Part-I) : (Programmable Peripheral Interface)
(Part-I)
8155 PPI
(Programmable Peripheral Interface)
1
8155 (PPI)
• It is a multifunction device
designed to use in minimum mode
system
• It contain RAM, I/O ports and
Timer
2
Features
1. 2k static RAM cell organized as 256 bytes
2. 2 programmable 8 bit I/O ports (A,B)
3. 1 programmable 6 bit I/O port (c)
4. 1 programmable 14 bit binary down counter/timer
5. An internal address latch to de multiplex AD 0-
AD7 using ALE
6. Internal selection logic for memory & I/O. using
command register
3
4
Pin out
• ADo-AD7: address & data lines internally de
multiplex by using internal latch & ALE signal
address lines are used to access the memory or I/O
port depending on the status of IO/M pin i/p
• D0-D7 lines act as data bus
• ALE: used to de multiplex the AD0-AD7
• IO/M : used to differentiate between IO or memory
• CE : used to select the 8155
• RD : used to read the data from memory or I/O
• WR: used to write the data to memory or I/O
5
Cont’d…
7
Control Word of 8155
D7 D6 D5 D4 D3 D2 D1 D0
• D0=Port A 0=Input
• D1=Port B 1=Output
• D2 &D3 used with port C
• D4 (IEA= Interrupt Enable Port A) 1= Enable
• D5 (IEB= Interrupt Enable Port B) 0=
Disable
• D6&D7
D7 D6 used
timerin timer mode
commands
0 0 NOP
0 1 Stop counting if timer is running
1 0 Stop after TC (stop after at the count)
1 1 Start timer if is not running 8
Timer mode
MSB M2 M1 D13 D12 D11 D10 D9 D8
LSB D7 D6 D5 D4 D3 D2 D1 D0
11
Control word
• To start the timer D7 & D6 bit must be 1
• set the bit of CWR and send to address 20h
• therefore C0h (11000000) must be load in CWR
register.
• Program for square wave
MVI A,5Eh
OUT 24H
MVI A,42H
OUT 25H
MVI A,C0H
OUT 20H
HLT 12