SlideShare a Scribd company logo
1 of 88
Download to read offline
68HC11 Parallel I/O
Mr.B.Kannan, RIT 1
Microcontroller-Based System
CPUMemory
I/O
Interface
BUS
Microcontroller
e.g. M68HC11
To I/O
CPU: Central Processor Unit
I/O: Input/Output
Memory: Program and Data
Bus: Address signals, Control signals, and Data signals
Mr.B.Kannan, RIT 2
Terminology
• Pin – This is a physical point that connects the
microcontroller to the outside world.
• I/O – Input /Output
• Input – This is an input pin
• Output – This is an output pin
• Bidirectional I/O – This is pin which can be configured as
either input or output.
• Port I/O register= This is a data register that is physically
connected to a set of I/O pins
• Control register = This a control register used to configure
the operation of a data port or some other function on the
controller.
Mr.B.Kannan, RIT 3
Terminology
• Memory-mapped I/O: Microcontroller configuration in which
external I/O is accessed using normal memory access
instructions.
– The M68HC11 uses memory mapped I/O.
• This is in contrast to other microprocessors (e.g. Intel) which have
a separate I/O address space and use special instructions to
access it.
Mr.B.Kannan, RIT 4
Review of Data I/O
Mr.B.Kannan, RIT 5
Input Buffer
Y
Equation
inY D=
Din Y
0 0
1 1
Truth Table
Symbol
Din
Input pin
Mr.B.Kannan, RIT 6
Output Buffer
A
Equation
outD A=
A Dout
0 0
1 1
Truth Table
Symbol
Dout
Output pin
Mr.B.Kannan, RIT 7
Another meaning of “buffer”
• The word buffer is also frequently used in
computer engineering to refer to a region
of storage (registers or memory) that is
used to hold data temporarily while it is
being (or waiting to be) sent or received.
– This usage is contrasted with an electrical
buffer (previous slides) which just amplifies
and delays a signal.
Mr.B.Kannan, RIT 8
Tri-state drivers
(Three-state drivers)
Mr.B.Kannan, RIT 9
Multiple Outputs
Chip A Chip B
Let A_A = 0 Let B_A = 1
0 1
What is Y?
Y
Unknown
X
A AY Y
raise
lower
Mr.B.Kannan, RIT 10
Tri-State Driver
Equation
0
1
Y A when OEn
Z when OEn
= =
= =
A OEn Y
d 1 Z
0 0 0
1 0 1
Truth Table
Symbol
OEn
High Impedance State
“Open Circuit”
Active-low signal “OEn”
(Output Enable)
Mr.B.Kannan, RIT 11
One implementation
Of a tristate buffer in CMOS…
Y
GND
Vdd
A
CMOS
Transmission
Gate
OEn
A
A
Output-driving
inverter
OEn
Mr.B.Kannan, RIT 12
Multiple Outputs
Chip A Chip B
Let A_A=1 Let B_A=0
0 1
Y Bus
OEn OEn
controller
Floating Driver
Y=1
01
raise
Mr.B.Kannan, RIT 13
Multiple Outputs
Chip A Chip B
Let A_A=0
Let B_A=1
0 1
Y Bus
controller
FloatingDriver
Y=0
OEn OEn
0 1
Mr.B.Kannan, RIT 14
Open Drain Output Drivers
Mr.B.Kannan, RIT 15
Field Effect Transistors - FETS
Field Effect Transistor (FET)
FET acts like a “switch”
If Vgate is ONE, switch
is closed, connecting A
and B otherwise A and
B are isolated.
Vgate
A
B
Mr.B.Kannan, RIT 16
Din
Dout
Open Drain Output Driver
We can use an FET as an Output Driver
When Din=1, Dout=0
When Din=0, Dout=Z
“open circuit”
How does Dout become an ONE?Mr.B.Kannan, RIT 17
FPLD
Din
VDD
R
Dout
Open Drain Output Driver
When Din=1, Dout=0
FET is ON, Dout=0
When Din=0, Dout=1
FET is OFF, Dout is pulled
up to VDD
Why do this?
Use an external pull-up resistor
Mr.B.Kannan, RIT 18
VDD
R
Dout
B
Din
A
Din
Controller
Simple Data I/O Control
Data
Halt
AB
Controller sends data to Chip-A and Chip-B
However, either device can “Halt” the transfer by
bringing the halt line low.
“Wired-OR” configurationMr.B.Kannan, RIT 19
Bi-Directional I/O
Buffer/Drivers
Mr.B.Kannan, RIT 20
Bi-directional I/O Driver
• Allows a single pin to be configured as an
input buffer or an output buffer.
Mr.B.Kannan, RIT 21
Bi-Directional I/O Buffer
OEn Function
0 Output mode
1 Input mode
Function Table
Symbol
OEn Tri-state Buffer
Input
Buffer
dio Pin
From
Ckt
To
Ckt
Note: I/O buffer is either
Input or output
Mr.B.Kannan, RIT 22
Bi-Directional I/O Buffer
as Input Buffer
Symbol
OEn Floating
Input
Buffer
Dio
1
To_ckt
(Input)
To_ckt = Dio
Mr.B.Kannan, RIT 23
Bi-Directional I/O Buffer
as Output Buffer
Symbol
OEn Active
Input
Buffer
Dio
0
From_ckt
To_ckt (Output)
Note: To_ckt is also From_ckt
Dio is From_ckt
Mr.B.Kannan, RIT 24
68HC11 Parallel I/O Ports
Section 7.4
Mr.B.Kannan, RIT 25
M68HC11 Port Summary
• PortA
– 1 bidirectional, 3 input, and 4 output port
– Timer port
• PortB
– 8-bit fixed output port
• Used for high byte of mem. addr. in expanded mode
• PortC
– 8-bit bidirectional parallel port
• Used for low byte of address & for data in expanded mode
• PortD
– 6-bit bidirectional parallel or serial I/O port
• PortE
– 8-bit digital or analog input port
One of the 4 outputs is
bidirectional on the E9
Mr.B.Kannan, RIT 26
M68HC11E block diagram
From datasheet, p.17
Mr.B.Kannan, RIT 27
Tangent on Operating Modes
• The HC11 has four operating modes.
• These are selected by input signals on the
MODB and MODA inputs when the chip is
reset.
(from HC11 Reference Manual, p.47)
Mr.B.Kannan, RIT 28
Default Memory Maps of HC11E9
(From the HC11E series datasheet, p.37)
Mr.B.Kannan, RIT 29
Ports B and C are mode-dependent
Reference manual, p. 62
Mr.B.Kannan, RIT 30
Example pin connections in
single-chip HC11 systems
• Very simple configuration.
• A small amount of external
circuitry is still needed, for:
– Power supply conditioning
– External clocking
– Low-voltage reset
– Setting mode bits
• Note there is no external
ROM/RAM in this mode!
– But B and C ports are available
for doing parallel I/O.
(Reference manual, p.117)
Mr.B.Kannan, RIT 31
Demultiplexing address/data
in Expanded modes
Datasheet, p. 34Mr.B.Kannan, RIT 32
Connecting External memory
Reference
Manual,
pp. 117-118
PB
PC
Mr.B.Kannan, RIT 33
Connecting External Memory
Reference
Manual,
p. 118
• Note in this example,
the 8K EPROM Chip
is Selected (CS) if
A13 & A15 are high.
• And, A0-A12 are fed
to the EPROM.
• Therefore, what
range(s) of addresses
does the EPROM
chip map to?
Mr.B.Kannan, RIT 34
Port A – Address $1000
• An 8-bit, parallel I/O port.
• Data address $1000 (normally)
• Multi-Function
– I/O Port
– Timer Port
• PACTL – Port A Control Register ($1026)
– determines port function
Mr.B.Kannan, RIT 35
Port A – I/O Pin Modes
• Bits 0-2: Input Bits
– PA0-PA2
• Bits 3-6: Output Bits
– PA3-PA6
• Bit 7 Bidirectional Bit
– Direction set in PACTL
Except that PA3 is
bidirectional in the E9
Mr.B.Kannan, RIT 36
Port A - $1000 Data
7 6 5 4 3 2 1 0
Bits
IIO IOOOB
O=Output
I =Input
B=Bidirectional
Notation:
PA7 = Bit 7 of Port A
PA6 = Bit 6 of Port A
PA5 = Bit 5 of Port A
……………………………….
PA0 = Bit 0 of Port A
Mr.B.Kannan, RIT 37
Port A Circuit Schematic
OEn
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7(output)
PA7(Input)
INPUT PINS Output PINS BiDir Pin
This one is also bidirectional in the HC11E’s
Mr.B.Kannan, RIT 38
Port A – I/O Port Mode
• Example:
* Bit 7 configured as input (default)
PortA EQU $1000
* Output a $C to Port A
Outdata EQU %01101000 ;Sets bits 3,5,6
…………
* Output data to PortA
LDAA #Outdata
STAA PortA
* Read Data from PortA
LDAA PortA
Mr.B.Kannan, RIT 39
PACTL: $1026
Port A Control Register
7 6 5 4 3 2 1 0
Bits
RTR0RTR1PEDGEPAMODPAENDDRA7 00
DDRA7 = Data Direction Register A7
0 = Input Direction (Default)
1 = Output Direction
PAEN = Pulse Accumulator System Enable
0 = Disable (Default)
Port A is set for I/O function
1 = Enable
Port A is set for Pulse Accumulator function
(part of timer system, to be discussed later)
This is DDRA3 in the E series
Mr.B.Kannan, RIT 40
LED Circuit Example
R
VCC
Light On
R
VCC
Light Off
Switch
Mr.B.Kannan, RIT 41
68HC11 LED Example
• We’ll use PA7 for Input, PA6 for output
– PA7=0 switch open, PA7=1 switch closed
– PA6=0 LED off, PA6=1 LED on
• Pseudo-code:
– Configure PortA ;
– Repeat
• IF(PA7=0) then ; Switch is open
– PA6=0 ; Turn LED OFF
• Else
– PA6=1 ; Turn LED ON
• EndIF
– Until Forever
Mr.B.Kannan, RIT 42
Program, using BRSET/BSET/BCLR
• These instructions allow us to manipulate
individual bits, but they force us to use indexed
addressing to refer to the I/O registers
– Extended direct mode is not available with these
particular instructions
BIT6 EQU %01000000 ; Mask for bit 6
BIT7 EQU %10000000 ; Mask for bit 7
IOBASE EQU $1000 ; Base of I/O config registers
PORTA EQU $00 ; Offset of PORTA ($1000)
PACTL EQU $26 ; Offset of PACTL ($1026)
start: LDX #IOBASE ; Point X at I/O config registers
CLR PACTL,X ; Clear all PACTL control flags.
loop: BRSET PORTA,X BIT7 on ; If port A bit 7 is set, turn LED on
BCLR PORTA,X BIT6 ; else, turn LED off. (Clear bit 6)
BRA endif ; Go to end of if statement.
on: BSET PORTA,X BIT6 ; Turn LED on (set bit 6).
endif: JMP loop ; Repeat.Mr.B.Kannan, RIT 43
Simulator Example
Mr.B.Kannan, RIT 44
Port B
• 8-bit port
– Fixed Direction: Output
• Data address: $1004
– Writing to Address $1004 will write to the port.
• Example:
PortB EQU $1004
Value EQU $F2
...
LDAA #Value
STAA PortB
• When the HC11 is in expanded mode, on boards with
no Port Replacement Unit,
– Port B is reserved for the upper 8 address bits (AD9-AD15)
Mr.B.Kannan, RIT 45
Port B - $1004 Data
7 6 5 4 3 2 1 0
Bits
OOO OOOOO
O=Output
Mr.B.Kannan, RIT 46
Port C
• 8-bit bidirectional port
• Data address: $1003
• Multi-Function:
– In single-chip mode, or with a Port Replacement Unit
• I/O Port
• Latched data from Port C is available at address $1005
– It’s latched when a rising edge occurs on STRA pin
• Handshaking port
– In expanded mode with no Port Replacement Unit,
• Used for low 8 bits (AD0-AD7) of memory address bus and
for memory data bus (D0-D7)
• PIOC – Parallel I/O Control Register C
determines function
Mr.B.Kannan, RIT 47
Port C - $1003 Data
7 6 5 4 3 2 1 0
Bits
BBB BBBBB
O=Output
I =Input
B=Bidirectional
Mr.B.Kannan, RIT 48
DDRC - $1007
7 6 5 4 3 2 1 0
Bits
DDC0
DDCn:
0 = Input (Default)
1 = Output
DDC1DDC2DDC3DDC4DDC5DDC6DDC7
DDCn= Data Direction Bit n
Mr.B.Kannan, RIT 49
PORTCL - $1005 Latched Data
7 6 5 4 3 2 1 0
Bits
BBB BBBBB
O=Output
I =Input
B=Bidirectional
Mr.B.Kannan, RIT 50
PIOC - $1002 (STAF Bit)
Parallel I/O Control Register
7 6 5 4 3 2 1 0
Bits
INVBEGAHNDSCWOMSTAISTAF OIN PLS
STAF = Strobe A Flag
0 = Inactive (default)
1 = Set at the active edge of STRA pin
Read only bit. Used to determine when data have
been latched into Port C. Cleared after bit has been
set and read.
Mr.B.Kannan, RIT 51
PIOC - $1002 (STAI Bit)
Parallel I/O Control Register
7 6 5 4 3 2 1 0
Bits
INVBEGAHNDSCWOMSTAISTAF OIN PLS
STAI = Strobe A Interrupt Enable
0 = No hardware interrupt generated (default)
1 = Interrupt requested when STAF=1
Enables or disables the interrupt request from being
generated when STRA is asserted.
Mr.B.Kannan, RIT 52
PIOC - $1002
Parallel I/O Control Register
(CWOM and EGA Bit)
7 6 5 4 3 2 1 0
Bits
INVBEGAHNDSCWOMSTAISTAF OIN PLS
CWOM = Port C Wire-OR Mode
0 = Normal Outputs (default)
1 = Open Drain Outputs
EGA = Active Edge Select for STRA
0 = Falling edge (High to Low)
1 = Rising edge (Low to High)Mr.B.Kannan, RIT 53
Port D
• 6-bit
• Address $1008
• Multi-Function
– Bidirectional Port
– Serial I/O Port
• Serial Communications Interface (SCI)
– Asynchronous (i.e. no clock signal needed)
• Serial Peripheral Interface (SPI)
– Synchronous (i.e. a clock signal needed)
Mr.B.Kannan, RIT 54
Port D - $1008 Data Register
7 6 5 4 3 2 1 0
Bits
BBB BBBXX
X=Not Used
B=Bidirectional
Mr.B.Kannan, RIT 55
DDRD - $1009
7 6 5 4 3 2 1 0
Bits
DDD0
DDDn:
0 = Input (Default)
1 = Output
DDD1DDD2DDD3DDD4DDD5XX
DDDn= Data Direction Bit n
Mr.B.Kannan, RIT 56
SPCR - $1028
SPI Control Register
7 6 5 4 3 2 1 0
Bits
SPR0SPR1MSTRDWOMSPESPIE CPOL CPOH
SPIE = SPI System Enable
0 = Disable (default)
1 = Enable
This bit should be 0 to use Port D for parallel I/O
DWOM = Port D Wire-OR Mode
0 = Normal Outputs (default)
1 = Open Drain Outputs
Mr.B.Kannan, RIT 57
SCCR2 - $102D
SCI Control Register 2
7 6 5 4 3 2 1 0
Bits
SBKRWUILIERIETCIETIE TE RE
TE = Transmit Enable
0 = Disable (default)
1 = Enable
This bit should be 0 to used Port D for parallel I/O
RE = Receiver Enable
0 = Disable (default)
1 = Enable
This bit should be 0 to used Port D for parallel I/O
Mr.B.Kannan, RIT 58
Port E
• 8-bit
• Address $100A
• Multi-Function
– Digital Input Port
– Analog Input Port (Built-in A/D)
Mr.B.Kannan, RIT 59
Port E - $100A Data Register
7 6 5 4 3 2 1 0
Bits
III IIIII
O=Output
I =Input
B=Bidirectional
Mr.B.Kannan, RIT 60
Handshaking I/O
Section 7.5
Mr.B.Kannan, RIT 61
Problem
• Need to transfer data to and from Source to
6811
Data
Source
6811
Mr.B.Kannan, RIT 62
Several Approaches
• Simple Strobed I/O
• Full Handshaking I/O
• Let’s look at several examples
Mr.B.Kannan, RIT 63
Simple Strobed I/O
• Data Bus
• Single Control line
between Source and
6811
Data Bus
Control
Bus
Data
Source/
RCVR
6811
Mr.B.Kannan, RIT 64
Simple Strobed Input
Data source places data on bus, uses strobe to indicate
“the data is now valid”
6811
Data
Source
Data_out Data_in
N
Strobe STRA
Mr.B.Kannan, RIT 65
Simple Strobed Input
• Timing Diagram
DATA
Strobe
This edge indicates that the “data are now valid”
Use this edge to “latch” the data into the 6811
Mr.B.Kannan, RIT 66
Simple Strobed Output
6811 uses strobe to indicate to the receiver that
Data are available
Data
Rcvr
6811
Data_in Data_out
N
Ready STRB
Mr.B.Kannan, RIT 67
Simple Strobed Output
• Timing Diagram
This edge indicates that the data are “ready”
DATA
STRB
Mr.B.Kannan, RIT 68
Simple Strobed I/O
• Advantage -
– Simple
• Disadvantage
– Must know timing relationship between data
source/rcvr and 6811.
• Input: How fast can 6811 accept new data.
• Output: How fast can receiver accept data
from 6811
Mr.B.Kannan, RIT 69
Simple Strobed I/O:
Using the 6811
Page 131
Mr.B.Kannan, RIT 70
Simple Strobed I/O:
Using the 6811
• PORTC is used for strobed input
– Read data from PORTCL ($1005)
– External pin: STRA is used to latch data
• PORTB is used for strobed output
– External pin: STRB is used as output ready
Mr.B.Kannan, RIT 71
Simple Strobed I/O:
Using the 6811
• SET HNDS bit (bit 4) in PIOC control register
($1002) to 0
• SET EGA bit (bit 1) in PIOC control register
($1002) to desired active edge
– 0 = High to Low (falling)
– 1 = Low to High (rising)
• SET INVB to set active edge of output strobe
– 0 = active low (High to low)
– 1 = active high (low to high) (default)
Mr.B.Kannan, RIT 72
Simple Stobed Input
PORTC PORTCLLATCH
$1003 $1005
STRA PIN
Input
Pins
Mr.B.Kannan, RIT 73
Reading Input
• STAF bit in PIOC is set when new data
are written into latch.
• Reading STAF bit will reset it to zero
• Let’s look at an example
Mr.B.Kannan, RIT 74
Reading Input
• Configure PortC for input
– Write $00 to DDRC ($1007)
• Configure PortC via PIOC ($1002) for
– No interrupts (STAI=0)
– Active High Inputs (EGA=1)
– Active High Outputs (INVB=1)
– Simple Handshaking (HNDS=0)
– Config bits = %00000011
Mr.B.Kannan, RIT 75
Reading Input
• Repeat
• Read STAF
• Until STAF=1
• Read PORTCL ($1005) ; This clears STAF
Mr.B.Kannan, RIT 76
Simple Stobed Output
PORTB
STRB
$1004
Mr.B.Kannan, RIT 77
Writing Output
• Writing to Port B will automatically assert the
STRB pin for two clock periods.
• Use INVB to control the polarity on STRB
– 0 = Active low
– 1 = Active high
Mr.B.Kannan, RIT 78
Full Handshaking I/O
Page 130
Mr.B.Kannan, RIT 79
Full Handshaking I/O Protocol
• Data Bus
• Two Control Lines
Data Bus
Control
Bus
Ext
Device
6811
Mr.B.Kannan, RIT 80
Full Handshaking I/O
• Disadvantages
– More complicated I/O
• Advantages
– Control timing relationship between 6811
and External Device
Mr.B.Kannan, RIT 81
Input Handshaking
• Input Handshaking
1. Ext. Device places data on bus
2. Device asserts “strobe” to indicate “data is available.”
3. Ext. Device asserts “strobe” to indicate
“acknowledgement” or “I have the data.”
Ext
Device
6811
Data_out PortC
N
Ack STRB
Strobe STRA
Mr.B.Kannan, RIT 82
Input Handshaking
This edge indicates to the 6811 that “data are available.”
This edge indicates to the External Device that “I have the data.”
Ext. Device can send the next byte
Data
STRA
STRF
STRB
Internal
Flag
Mr.B.Kannan, RIT 83
Reading Input Full Handshaking
• Configure PortC for input
– Write $00 to DDRC ($1007)
• Configure PortC via PIOC ($1002) for
– No interrupts (STAI=0)
– Active High Inputs (EGA=1)
– Active High Outputs (INVB=1)
– Full Handshaking (HNDS=1)
– Input Handshaking (OIN=0)
– STRB Level mode select (PLS=0)
– Config bits = %00010011
• Read input as in Simple Input example
Mr.B.Kannan, RIT 84
Output Handshaking
1. 6811 asserts STRB that says “data are available.”
2. Ext. Device reads data.
3. Ext. Device asserts “strobe” to indicate that
I have the “data.” Ready for another byte.
Ext
Device
6811
Data_out PortC
N
Ready STRB
Strobe STRA
Mr.B.Kannan, RIT 85
Output Handshaking
This edge indicates to the External Device that “data are available.”
This edge indicates to the 6811 that “I have the data.” 6811 can
Send another data byte
Data
STRA
STRF
STRB
Mr.B.Kannan, RIT 86
Writing Full Handshaking
• Configure PortC for output
– Write $FF to DDRC ($1007)
• Configure PortC via PIOC ($1002) for
– No interrupts (STAI=0)
– Active High Inputs (EGA=1)
– Active High Outputs (INVB=1)
– Full Handshaking (HNDS=1)
– Output Handshaking (OIN=1)
– STRB Level mode select (PLS=0)
– Config bits = %00011011
• Read input as in Simple Input example
Mr.B.Kannan, RIT 87
Reference:
M68HC11-Reference Manual
Mr.B.Kannan, RIT 88

More Related Content

What's hot

What's hot (20)

1204 Ppi 8255
1204 Ppi 82551204 Ppi 8255
1204 Ppi 8255
 
8255 ppi
8255 ppi8255 ppi
8255 ppi
 
Avr report
Avr reportAvr report
Avr report
 
I/O Ports
I/O Ports I/O Ports
I/O Ports
 
Abc2
Abc2Abc2
Abc2
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
8085 lab
8085 lab8085 lab
8085 lab
 
Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.Interfacing of 8255 IC By Er. Swapnil Kaware.
Interfacing of 8255 IC By Er. Swapnil Kaware.
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Class10
Class10Class10
Class10
 
Lec12
Lec12Lec12
Lec12
 
8085 ppi 8255 and 8155
8085 ppi 8255 and 81558085 ppi 8255 and 8155
8085 ppi 8255 and 8155
 
I o ports.ppt
I o ports.pptI o ports.ppt
I o ports.ppt
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha8255_utkarsh_kulshrestha
8255_utkarsh_kulshrestha
 
Programming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerProgramming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontroller
 
1203 Ppi 8155
1203 Ppi 81551203 Ppi 8155
1203 Ppi 8155
 
8255 Programmable parallel I/O
8255 Programmable parallel I/O 8255 Programmable parallel I/O
8255 Programmable parallel I/O
 
8255_Ppi new
8255_Ppi new8255_Ppi new
8255_Ppi new
 
Embedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programmingEmbedded system (Chapter 3) io_port_programming
Embedded system (Chapter 3) io_port_programming
 

Similar to Motorola parallel port

Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptsharan Kumar
 
MICROCONTROLLER.pptx
MICROCONTROLLER.pptxMICROCONTROLLER.pptx
MICROCONTROLLER.pptxfiqrie mohd
 
Mod-2 M&M.pptx
Mod-2 M&M.pptxMod-2 M&M.pptx
Mod-2 M&M.pptxTechCook1
 
An Overview Study on I/O Expander with I2C and SMBus Interface
An Overview Study on I/O Expander with I2C and SMBus InterfaceAn Overview Study on I/O Expander with I2C and SMBus Interface
An Overview Study on I/O Expander with I2C and SMBus InterfacePremier Farnell
 
MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3deepakdmaat
 
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...Rajan Gautam
 
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptCHANDRA KUMAR S
 
Microcontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumarMicrocontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumarMitesh Kumar
 
EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5PRADEEP
 
8051 architecture
8051 architecture8051 architecture
8051 architecturesb108ec
 
UNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxUNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxGowrishankar C
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Sadiq Rahim
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiramang6
 

Similar to Motorola parallel port (20)

Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 ppt
 
MICROCONTROLLER.pptx
MICROCONTROLLER.pptxMICROCONTROLLER.pptx
MICROCONTROLLER.pptx
 
unit-3-8255.pdf
unit-3-8255.pdfunit-3-8255.pdf
unit-3-8255.pdf
 
Mod-2 M&M.pptx
Mod-2 M&M.pptxMod-2 M&M.pptx
Mod-2 M&M.pptx
 
8051 full ppt
8051 full ppt8051 full ppt
8051 full ppt
 
An Overview Study on I/O Expander with I2C and SMBus Interface
An Overview Study on I/O Expander with I2C and SMBus InterfaceAn Overview Study on I/O Expander with I2C and SMBus Interface
An Overview Study on I/O Expander with I2C and SMBus Interface
 
MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3MicroProcessors and MicroControllersUnit3
MicroProcessors and MicroControllersUnit3
 
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
Atmel 8271-8-bit-avr-microcontroller-a tmega48-a-48pa-88a-88pa-168a-168pa-328...
 
PPI-MECHATRONICS
PPI-MECHATRONICSPPI-MECHATRONICS
PPI-MECHATRONICS
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
L4-L6 8255 A.pptx
L4-L6 8255 A.pptxL4-L6 8255 A.pptx
L4-L6 8255 A.pptx
 
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
 
Microcontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumarMicrocontroller 8051 By Mitesh kumar
Microcontroller 8051 By Mitesh kumar
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5EMBEDDED SYSTEMS 5
EMBEDDED SYSTEMS 5
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
8051 architecture
8051 architecture8051 architecture
8051 architecture
 
UNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxUNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptx
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unit
 

More from Bkannan2

3. Types of Managers, Mangerial roles and skills.pptx
3. Types of Managers, Mangerial roles and skills.pptx3. Types of Managers, Mangerial roles and skills.pptx
3. Types of Managers, Mangerial roles and skills.pptxBkannan2
 
4. Evolution of Management - Scientific Management.pptx
4. Evolution of Management - Scientific Management.pptx4. Evolution of Management - Scientific Management.pptx
4. Evolution of Management - Scientific Management.pptxBkannan2
 
Lesson 8_et438b (2).ppsx
Lesson 8_et438b (2).ppsxLesson 8_et438b (2).ppsx
Lesson 8_et438b (2).ppsxBkannan2
 
Pom-delegation of authority, centralization and decentralization
Pom-delegation of authority, centralization and decentralizationPom-delegation of authority, centralization and decentralization
Pom-delegation of authority, centralization and decentralizationBkannan2
 
8051 timer
8051 timer8051 timer
8051 timerBkannan2
 
Root locus
Root locusRoot locus
Root locusBkannan2
 
Energy band diagram
Energy band diagramEnergy band diagram
Energy band diagramBkannan2
 
Io interfacing
Io interfacingIo interfacing
Io interfacingBkannan2
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction setBkannan2
 
Cisc pentium
Cisc pentiumCisc pentium
Cisc pentiumBkannan2
 

More from Bkannan2 (13)

3. Types of Managers, Mangerial roles and skills.pptx
3. Types of Managers, Mangerial roles and skills.pptx3. Types of Managers, Mangerial roles and skills.pptx
3. Types of Managers, Mangerial roles and skills.pptx
 
4. Evolution of Management - Scientific Management.pptx
4. Evolution of Management - Scientific Management.pptx4. Evolution of Management - Scientific Management.pptx
4. Evolution of Management - Scientific Management.pptx
 
Lesson 8_et438b (2).ppsx
Lesson 8_et438b (2).ppsxLesson 8_et438b (2).ppsx
Lesson 8_et438b (2).ppsx
 
IOT.pptx
IOT.pptxIOT.pptx
IOT.pptx
 
USP.ppt
USP.pptUSP.ppt
USP.ppt
 
Pom-delegation of authority, centralization and decentralization
Pom-delegation of authority, centralization and decentralizationPom-delegation of authority, centralization and decentralization
Pom-delegation of authority, centralization and decentralization
 
CNTFET
CNTFETCNTFET
CNTFET
 
8051 timer
8051 timer8051 timer
8051 timer
 
Root locus
Root locusRoot locus
Root locus
 
Energy band diagram
Energy band diagramEnergy band diagram
Energy band diagram
 
Io interfacing
Io interfacingIo interfacing
Io interfacing
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Cisc pentium
Cisc pentiumCisc pentium
Cisc pentium
 

Recently uploaded

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Motorola parallel port

  • 2. Microcontroller-Based System CPUMemory I/O Interface BUS Microcontroller e.g. M68HC11 To I/O CPU: Central Processor Unit I/O: Input/Output Memory: Program and Data Bus: Address signals, Control signals, and Data signals Mr.B.Kannan, RIT 2
  • 3. Terminology • Pin – This is a physical point that connects the microcontroller to the outside world. • I/O – Input /Output • Input – This is an input pin • Output – This is an output pin • Bidirectional I/O – This is pin which can be configured as either input or output. • Port I/O register= This is a data register that is physically connected to a set of I/O pins • Control register = This a control register used to configure the operation of a data port or some other function on the controller. Mr.B.Kannan, RIT 3
  • 4. Terminology • Memory-mapped I/O: Microcontroller configuration in which external I/O is accessed using normal memory access instructions. – The M68HC11 uses memory mapped I/O. • This is in contrast to other microprocessors (e.g. Intel) which have a separate I/O address space and use special instructions to access it. Mr.B.Kannan, RIT 4
  • 5. Review of Data I/O Mr.B.Kannan, RIT 5
  • 6. Input Buffer Y Equation inY D= Din Y 0 0 1 1 Truth Table Symbol Din Input pin Mr.B.Kannan, RIT 6
  • 7. Output Buffer A Equation outD A= A Dout 0 0 1 1 Truth Table Symbol Dout Output pin Mr.B.Kannan, RIT 7
  • 8. Another meaning of “buffer” • The word buffer is also frequently used in computer engineering to refer to a region of storage (registers or memory) that is used to hold data temporarily while it is being (or waiting to be) sent or received. – This usage is contrasted with an electrical buffer (previous slides) which just amplifies and delays a signal. Mr.B.Kannan, RIT 8
  • 10. Multiple Outputs Chip A Chip B Let A_A = 0 Let B_A = 1 0 1 What is Y? Y Unknown X A AY Y raise lower Mr.B.Kannan, RIT 10
  • 11. Tri-State Driver Equation 0 1 Y A when OEn Z when OEn = = = = A OEn Y d 1 Z 0 0 0 1 0 1 Truth Table Symbol OEn High Impedance State “Open Circuit” Active-low signal “OEn” (Output Enable) Mr.B.Kannan, RIT 11
  • 12. One implementation Of a tristate buffer in CMOS… Y GND Vdd A CMOS Transmission Gate OEn A A Output-driving inverter OEn Mr.B.Kannan, RIT 12
  • 13. Multiple Outputs Chip A Chip B Let A_A=1 Let B_A=0 0 1 Y Bus OEn OEn controller Floating Driver Y=1 01 raise Mr.B.Kannan, RIT 13
  • 14. Multiple Outputs Chip A Chip B Let A_A=0 Let B_A=1 0 1 Y Bus controller FloatingDriver Y=0 OEn OEn 0 1 Mr.B.Kannan, RIT 14
  • 15. Open Drain Output Drivers Mr.B.Kannan, RIT 15
  • 16. Field Effect Transistors - FETS Field Effect Transistor (FET) FET acts like a “switch” If Vgate is ONE, switch is closed, connecting A and B otherwise A and B are isolated. Vgate A B Mr.B.Kannan, RIT 16
  • 17. Din Dout Open Drain Output Driver We can use an FET as an Output Driver When Din=1, Dout=0 When Din=0, Dout=Z “open circuit” How does Dout become an ONE?Mr.B.Kannan, RIT 17
  • 18. FPLD Din VDD R Dout Open Drain Output Driver When Din=1, Dout=0 FET is ON, Dout=0 When Din=0, Dout=1 FET is OFF, Dout is pulled up to VDD Why do this? Use an external pull-up resistor Mr.B.Kannan, RIT 18
  • 19. VDD R Dout B Din A Din Controller Simple Data I/O Control Data Halt AB Controller sends data to Chip-A and Chip-B However, either device can “Halt” the transfer by bringing the halt line low. “Wired-OR” configurationMr.B.Kannan, RIT 19
  • 21. Bi-directional I/O Driver • Allows a single pin to be configured as an input buffer or an output buffer. Mr.B.Kannan, RIT 21
  • 22. Bi-Directional I/O Buffer OEn Function 0 Output mode 1 Input mode Function Table Symbol OEn Tri-state Buffer Input Buffer dio Pin From Ckt To Ckt Note: I/O buffer is either Input or output Mr.B.Kannan, RIT 22
  • 23. Bi-Directional I/O Buffer as Input Buffer Symbol OEn Floating Input Buffer Dio 1 To_ckt (Input) To_ckt = Dio Mr.B.Kannan, RIT 23
  • 24. Bi-Directional I/O Buffer as Output Buffer Symbol OEn Active Input Buffer Dio 0 From_ckt To_ckt (Output) Note: To_ckt is also From_ckt Dio is From_ckt Mr.B.Kannan, RIT 24
  • 25. 68HC11 Parallel I/O Ports Section 7.4 Mr.B.Kannan, RIT 25
  • 26. M68HC11 Port Summary • PortA – 1 bidirectional, 3 input, and 4 output port – Timer port • PortB – 8-bit fixed output port • Used for high byte of mem. addr. in expanded mode • PortC – 8-bit bidirectional parallel port • Used for low byte of address & for data in expanded mode • PortD – 6-bit bidirectional parallel or serial I/O port • PortE – 8-bit digital or analog input port One of the 4 outputs is bidirectional on the E9 Mr.B.Kannan, RIT 26
  • 27. M68HC11E block diagram From datasheet, p.17 Mr.B.Kannan, RIT 27
  • 28. Tangent on Operating Modes • The HC11 has four operating modes. • These are selected by input signals on the MODB and MODA inputs when the chip is reset. (from HC11 Reference Manual, p.47) Mr.B.Kannan, RIT 28
  • 29. Default Memory Maps of HC11E9 (From the HC11E series datasheet, p.37) Mr.B.Kannan, RIT 29
  • 30. Ports B and C are mode-dependent Reference manual, p. 62 Mr.B.Kannan, RIT 30
  • 31. Example pin connections in single-chip HC11 systems • Very simple configuration. • A small amount of external circuitry is still needed, for: – Power supply conditioning – External clocking – Low-voltage reset – Setting mode bits • Note there is no external ROM/RAM in this mode! – But B and C ports are available for doing parallel I/O. (Reference manual, p.117) Mr.B.Kannan, RIT 31
  • 32. Demultiplexing address/data in Expanded modes Datasheet, p. 34Mr.B.Kannan, RIT 32
  • 33. Connecting External memory Reference Manual, pp. 117-118 PB PC Mr.B.Kannan, RIT 33
  • 34. Connecting External Memory Reference Manual, p. 118 • Note in this example, the 8K EPROM Chip is Selected (CS) if A13 & A15 are high. • And, A0-A12 are fed to the EPROM. • Therefore, what range(s) of addresses does the EPROM chip map to? Mr.B.Kannan, RIT 34
  • 35. Port A – Address $1000 • An 8-bit, parallel I/O port. • Data address $1000 (normally) • Multi-Function – I/O Port – Timer Port • PACTL – Port A Control Register ($1026) – determines port function Mr.B.Kannan, RIT 35
  • 36. Port A – I/O Pin Modes • Bits 0-2: Input Bits – PA0-PA2 • Bits 3-6: Output Bits – PA3-PA6 • Bit 7 Bidirectional Bit – Direction set in PACTL Except that PA3 is bidirectional in the E9 Mr.B.Kannan, RIT 36
  • 37. Port A - $1000 Data 7 6 5 4 3 2 1 0 Bits IIO IOOOB O=Output I =Input B=Bidirectional Notation: PA7 = Bit 7 of Port A PA6 = Bit 6 of Port A PA5 = Bit 5 of Port A ………………………………. PA0 = Bit 0 of Port A Mr.B.Kannan, RIT 37
  • 38. Port A Circuit Schematic OEn PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7(output) PA7(Input) INPUT PINS Output PINS BiDir Pin This one is also bidirectional in the HC11E’s Mr.B.Kannan, RIT 38
  • 39. Port A – I/O Port Mode • Example: * Bit 7 configured as input (default) PortA EQU $1000 * Output a $C to Port A Outdata EQU %01101000 ;Sets bits 3,5,6 ………… * Output data to PortA LDAA #Outdata STAA PortA * Read Data from PortA LDAA PortA Mr.B.Kannan, RIT 39
  • 40. PACTL: $1026 Port A Control Register 7 6 5 4 3 2 1 0 Bits RTR0RTR1PEDGEPAMODPAENDDRA7 00 DDRA7 = Data Direction Register A7 0 = Input Direction (Default) 1 = Output Direction PAEN = Pulse Accumulator System Enable 0 = Disable (Default) Port A is set for I/O function 1 = Enable Port A is set for Pulse Accumulator function (part of timer system, to be discussed later) This is DDRA3 in the E series Mr.B.Kannan, RIT 40
  • 41. LED Circuit Example R VCC Light On R VCC Light Off Switch Mr.B.Kannan, RIT 41
  • 42. 68HC11 LED Example • We’ll use PA7 for Input, PA6 for output – PA7=0 switch open, PA7=1 switch closed – PA6=0 LED off, PA6=1 LED on • Pseudo-code: – Configure PortA ; – Repeat • IF(PA7=0) then ; Switch is open – PA6=0 ; Turn LED OFF • Else – PA6=1 ; Turn LED ON • EndIF – Until Forever Mr.B.Kannan, RIT 42
  • 43. Program, using BRSET/BSET/BCLR • These instructions allow us to manipulate individual bits, but they force us to use indexed addressing to refer to the I/O registers – Extended direct mode is not available with these particular instructions BIT6 EQU %01000000 ; Mask for bit 6 BIT7 EQU %10000000 ; Mask for bit 7 IOBASE EQU $1000 ; Base of I/O config registers PORTA EQU $00 ; Offset of PORTA ($1000) PACTL EQU $26 ; Offset of PACTL ($1026) start: LDX #IOBASE ; Point X at I/O config registers CLR PACTL,X ; Clear all PACTL control flags. loop: BRSET PORTA,X BIT7 on ; If port A bit 7 is set, turn LED on BCLR PORTA,X BIT6 ; else, turn LED off. (Clear bit 6) BRA endif ; Go to end of if statement. on: BSET PORTA,X BIT6 ; Turn LED on (set bit 6). endif: JMP loop ; Repeat.Mr.B.Kannan, RIT 43
  • 45. Port B • 8-bit port – Fixed Direction: Output • Data address: $1004 – Writing to Address $1004 will write to the port. • Example: PortB EQU $1004 Value EQU $F2 ... LDAA #Value STAA PortB • When the HC11 is in expanded mode, on boards with no Port Replacement Unit, – Port B is reserved for the upper 8 address bits (AD9-AD15) Mr.B.Kannan, RIT 45
  • 46. Port B - $1004 Data 7 6 5 4 3 2 1 0 Bits OOO OOOOO O=Output Mr.B.Kannan, RIT 46
  • 47. Port C • 8-bit bidirectional port • Data address: $1003 • Multi-Function: – In single-chip mode, or with a Port Replacement Unit • I/O Port • Latched data from Port C is available at address $1005 – It’s latched when a rising edge occurs on STRA pin • Handshaking port – In expanded mode with no Port Replacement Unit, • Used for low 8 bits (AD0-AD7) of memory address bus and for memory data bus (D0-D7) • PIOC – Parallel I/O Control Register C determines function Mr.B.Kannan, RIT 47
  • 48. Port C - $1003 Data 7 6 5 4 3 2 1 0 Bits BBB BBBBB O=Output I =Input B=Bidirectional Mr.B.Kannan, RIT 48
  • 49. DDRC - $1007 7 6 5 4 3 2 1 0 Bits DDC0 DDCn: 0 = Input (Default) 1 = Output DDC1DDC2DDC3DDC4DDC5DDC6DDC7 DDCn= Data Direction Bit n Mr.B.Kannan, RIT 49
  • 50. PORTCL - $1005 Latched Data 7 6 5 4 3 2 1 0 Bits BBB BBBBB O=Output I =Input B=Bidirectional Mr.B.Kannan, RIT 50
  • 51. PIOC - $1002 (STAF Bit) Parallel I/O Control Register 7 6 5 4 3 2 1 0 Bits INVBEGAHNDSCWOMSTAISTAF OIN PLS STAF = Strobe A Flag 0 = Inactive (default) 1 = Set at the active edge of STRA pin Read only bit. Used to determine when data have been latched into Port C. Cleared after bit has been set and read. Mr.B.Kannan, RIT 51
  • 52. PIOC - $1002 (STAI Bit) Parallel I/O Control Register 7 6 5 4 3 2 1 0 Bits INVBEGAHNDSCWOMSTAISTAF OIN PLS STAI = Strobe A Interrupt Enable 0 = No hardware interrupt generated (default) 1 = Interrupt requested when STAF=1 Enables or disables the interrupt request from being generated when STRA is asserted. Mr.B.Kannan, RIT 52
  • 53. PIOC - $1002 Parallel I/O Control Register (CWOM and EGA Bit) 7 6 5 4 3 2 1 0 Bits INVBEGAHNDSCWOMSTAISTAF OIN PLS CWOM = Port C Wire-OR Mode 0 = Normal Outputs (default) 1 = Open Drain Outputs EGA = Active Edge Select for STRA 0 = Falling edge (High to Low) 1 = Rising edge (Low to High)Mr.B.Kannan, RIT 53
  • 54. Port D • 6-bit • Address $1008 • Multi-Function – Bidirectional Port – Serial I/O Port • Serial Communications Interface (SCI) – Asynchronous (i.e. no clock signal needed) • Serial Peripheral Interface (SPI) – Synchronous (i.e. a clock signal needed) Mr.B.Kannan, RIT 54
  • 55. Port D - $1008 Data Register 7 6 5 4 3 2 1 0 Bits BBB BBBXX X=Not Used B=Bidirectional Mr.B.Kannan, RIT 55
  • 56. DDRD - $1009 7 6 5 4 3 2 1 0 Bits DDD0 DDDn: 0 = Input (Default) 1 = Output DDD1DDD2DDD3DDD4DDD5XX DDDn= Data Direction Bit n Mr.B.Kannan, RIT 56
  • 57. SPCR - $1028 SPI Control Register 7 6 5 4 3 2 1 0 Bits SPR0SPR1MSTRDWOMSPESPIE CPOL CPOH SPIE = SPI System Enable 0 = Disable (default) 1 = Enable This bit should be 0 to use Port D for parallel I/O DWOM = Port D Wire-OR Mode 0 = Normal Outputs (default) 1 = Open Drain Outputs Mr.B.Kannan, RIT 57
  • 58. SCCR2 - $102D SCI Control Register 2 7 6 5 4 3 2 1 0 Bits SBKRWUILIERIETCIETIE TE RE TE = Transmit Enable 0 = Disable (default) 1 = Enable This bit should be 0 to used Port D for parallel I/O RE = Receiver Enable 0 = Disable (default) 1 = Enable This bit should be 0 to used Port D for parallel I/O Mr.B.Kannan, RIT 58
  • 59. Port E • 8-bit • Address $100A • Multi-Function – Digital Input Port – Analog Input Port (Built-in A/D) Mr.B.Kannan, RIT 59
  • 60. Port E - $100A Data Register 7 6 5 4 3 2 1 0 Bits III IIIII O=Output I =Input B=Bidirectional Mr.B.Kannan, RIT 60
  • 62. Problem • Need to transfer data to and from Source to 6811 Data Source 6811 Mr.B.Kannan, RIT 62
  • 63. Several Approaches • Simple Strobed I/O • Full Handshaking I/O • Let’s look at several examples Mr.B.Kannan, RIT 63
  • 64. Simple Strobed I/O • Data Bus • Single Control line between Source and 6811 Data Bus Control Bus Data Source/ RCVR 6811 Mr.B.Kannan, RIT 64
  • 65. Simple Strobed Input Data source places data on bus, uses strobe to indicate “the data is now valid” 6811 Data Source Data_out Data_in N Strobe STRA Mr.B.Kannan, RIT 65
  • 66. Simple Strobed Input • Timing Diagram DATA Strobe This edge indicates that the “data are now valid” Use this edge to “latch” the data into the 6811 Mr.B.Kannan, RIT 66
  • 67. Simple Strobed Output 6811 uses strobe to indicate to the receiver that Data are available Data Rcvr 6811 Data_in Data_out N Ready STRB Mr.B.Kannan, RIT 67
  • 68. Simple Strobed Output • Timing Diagram This edge indicates that the data are “ready” DATA STRB Mr.B.Kannan, RIT 68
  • 69. Simple Strobed I/O • Advantage - – Simple • Disadvantage – Must know timing relationship between data source/rcvr and 6811. • Input: How fast can 6811 accept new data. • Output: How fast can receiver accept data from 6811 Mr.B.Kannan, RIT 69
  • 70. Simple Strobed I/O: Using the 6811 Page 131 Mr.B.Kannan, RIT 70
  • 71. Simple Strobed I/O: Using the 6811 • PORTC is used for strobed input – Read data from PORTCL ($1005) – External pin: STRA is used to latch data • PORTB is used for strobed output – External pin: STRB is used as output ready Mr.B.Kannan, RIT 71
  • 72. Simple Strobed I/O: Using the 6811 • SET HNDS bit (bit 4) in PIOC control register ($1002) to 0 • SET EGA bit (bit 1) in PIOC control register ($1002) to desired active edge – 0 = High to Low (falling) – 1 = Low to High (rising) • SET INVB to set active edge of output strobe – 0 = active low (High to low) – 1 = active high (low to high) (default) Mr.B.Kannan, RIT 72
  • 73. Simple Stobed Input PORTC PORTCLLATCH $1003 $1005 STRA PIN Input Pins Mr.B.Kannan, RIT 73
  • 74. Reading Input • STAF bit in PIOC is set when new data are written into latch. • Reading STAF bit will reset it to zero • Let’s look at an example Mr.B.Kannan, RIT 74
  • 75. Reading Input • Configure PortC for input – Write $00 to DDRC ($1007) • Configure PortC via PIOC ($1002) for – No interrupts (STAI=0) – Active High Inputs (EGA=1) – Active High Outputs (INVB=1) – Simple Handshaking (HNDS=0) – Config bits = %00000011 Mr.B.Kannan, RIT 75
  • 76. Reading Input • Repeat • Read STAF • Until STAF=1 • Read PORTCL ($1005) ; This clears STAF Mr.B.Kannan, RIT 76
  • 78. Writing Output • Writing to Port B will automatically assert the STRB pin for two clock periods. • Use INVB to control the polarity on STRB – 0 = Active low – 1 = Active high Mr.B.Kannan, RIT 78
  • 79. Full Handshaking I/O Page 130 Mr.B.Kannan, RIT 79
  • 80. Full Handshaking I/O Protocol • Data Bus • Two Control Lines Data Bus Control Bus Ext Device 6811 Mr.B.Kannan, RIT 80
  • 81. Full Handshaking I/O • Disadvantages – More complicated I/O • Advantages – Control timing relationship between 6811 and External Device Mr.B.Kannan, RIT 81
  • 82. Input Handshaking • Input Handshaking 1. Ext. Device places data on bus 2. Device asserts “strobe” to indicate “data is available.” 3. Ext. Device asserts “strobe” to indicate “acknowledgement” or “I have the data.” Ext Device 6811 Data_out PortC N Ack STRB Strobe STRA Mr.B.Kannan, RIT 82
  • 83. Input Handshaking This edge indicates to the 6811 that “data are available.” This edge indicates to the External Device that “I have the data.” Ext. Device can send the next byte Data STRA STRF STRB Internal Flag Mr.B.Kannan, RIT 83
  • 84. Reading Input Full Handshaking • Configure PortC for input – Write $00 to DDRC ($1007) • Configure PortC via PIOC ($1002) for – No interrupts (STAI=0) – Active High Inputs (EGA=1) – Active High Outputs (INVB=1) – Full Handshaking (HNDS=1) – Input Handshaking (OIN=0) – STRB Level mode select (PLS=0) – Config bits = %00010011 • Read input as in Simple Input example Mr.B.Kannan, RIT 84
  • 85. Output Handshaking 1. 6811 asserts STRB that says “data are available.” 2. Ext. Device reads data. 3. Ext. Device asserts “strobe” to indicate that I have the “data.” Ready for another byte. Ext Device 6811 Data_out PortC N Ready STRB Strobe STRA Mr.B.Kannan, RIT 85
  • 86. Output Handshaking This edge indicates to the External Device that “data are available.” This edge indicates to the 6811 that “I have the data.” 6811 can Send another data byte Data STRA STRF STRB Mr.B.Kannan, RIT 86
  • 87. Writing Full Handshaking • Configure PortC for output – Write $FF to DDRC ($1007) • Configure PortC via PIOC ($1002) for – No interrupts (STAI=0) – Active High Inputs (EGA=1) – Active High Outputs (INVB=1) – Full Handshaking (HNDS=1) – Output Handshaking (OIN=1) – STRB Level mode select (PLS=0) – Config bits = %00011011 • Read input as in Simple Input example Mr.B.Kannan, RIT 87