Interfacing MC
Interfacing MC
Interfacing MC
Wikipedia
Overview
Simplest interface
Lowest-cost to
implement (built into
the microcontroller)
High speed
Low programming
overhead
Disadvantages
Only on/off
control/monitoring
Single device
control/monitoring
Digital Input Example: Reading the status of
buttons or switches
Digital Input : Keypad
Digital Output : LED display
Digital Output : Relay Control
Analog I/O : Voltage-based control
and monitoring
Simple interface
High speed
Low programming
overhead
Complicates the
circuit design when
external ADC or
DAC are needed
0 to 2.5 V
0 to 4 V
0 to 5 V
+/- 2.5 V
+/- 4 V
+/- 5 V
Current Ranges
0-20 mA
4-20 mA
Analog Interface
Parallel Bus
High speed
High throughput:
Several bits are
transmitted on one
clock transition
Low cost
Large number of
microcontroller pins
needed for
implementing the
parallel bus
Consists of multiple digital inputs/outputs. Most common types:
4-bit
8-bit ( e.g. Centronics )
16-bit ( e.g. ISA )
32-bit ( e.g. PCI )
Parallel Example : 4 bit LCD
interface
8 Bit LCD Interface
Serial Buses : I
2
C (Inter Integrated
Circuit bus)
By definition, I
2
C is 5V
Multiple slave
devices - with only 3
wires
Low-cost to
implement
Implemented in
hardware or
software
Ease to implement,
many examples
Supports multi-
master configuration
Short distance
Limited device
addresses
Start & Stop
An I
2
C master prepares to communicate with a
slave device first by generating a Start
condition on the bus
Multiple slave
devices - with only
few wires
Low-cost
HW/SW Implement
Ease to implement,
many examples
Short distance
SS Slave Select
(active low; output from
master
Sometimes, the following
naming convention is
used:
CS Chip Select
(active low; output from
master)
SPI Bus with multiple slaves
Multimedia Card ( MMC ) Interface
using SPI
1-wire
Low-cost
Implemented in HW/SW
Ease to implement,
many examples
Relatively long
distance. Theoretically
300 meters but this is
limited in practice due
to noise and cable
capacitance
Slow speed
Popular interface
Implemented in
hardware or software
Ease to implement
Widely used in
industrial automation
communications, not so
much for chip to chip or
chip to sensor
Requires transceiver
chips and twisted pair
cable with terminating
resistors which add to
system cost
Immune to noise
Widely used in
industrial automation
due to noise immunity
Cost
Complicated to implement
Hardware interface
USB
RS-422
CAN
FIREWIRE
CONTROLLER AREA NETWORK
(CAN)