Microcontroller Interfacing

Topics: Serial Peripheral Interface Bus, I²C, Serial buses Pages: 32 (2361 words) Published: December 16, 2012
Microcontroller
Interfacing Techniques
Document Revision: 1.01
Date: 3rd April, 2005

16301 Blue Ridge Road, Missouri City, Texas 77489 USA
Telephone: 1-713-283-9970 Fax: 1-281-416-2806
E-mail: info@bipom.com
W eb: www.bipom.com

This document is available for download from www.bipom.com

Overview
Micro-controllers are useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other micro-controllers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, manufacturability.

Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a micro-controller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to ( controls ) outputs.

Input Devices

Microcontroller

Output Devices

Microcontroller Interfaces

Digital

On/Off

Analog

Parallel

Serial

Asynchronous

Voltage

Synchronous

1-wire

2-wire (I2C)

RS232/RS485
Ethernet

4-wire (SPI, Microwire)

Page 2

Current

Digital Inputs/Outputs
On/OFF control and monitoring.
Advantages





Disadvantages

Simplest interface
Lowest-cost to implement
(built into the microcontroller)
High speed
Low programming overhead





Only on/off control/monitoring
Short distance, few feet maximum.
Single device control/monitoring

Digital Input Example: Reading the status of buttons or switches

Single-ended
(non-matrix) switches

P2.7
P2.6
P2.5

8051
Microcontroller
(AT89C51ED2)

P2.4
P2.3
P2.2
P2.1
P2.0

Digital Input Example: Keypad Interface

4X4 Matrix Keypad
Interface

Columns

P2.7
P2.6

Columns
P2.5

8051
Microcontroller
(AT89C51ED2)

1

2

3

A

4

5

6

B

7

8

9

C

*

0

#

D

P2.4
P2.3
P2.2

Rows
P2.1
P2.0

Page 3

Rows

Digital Output Example: LED control

VCC
LED Interface
Current
Limiting
Resistors
8051
Microcontroller
(AT89C51ED2)

LED's
P0.3
P 0.2
P0.1
P0.0

Digital Output Example: Relay control

VCC
Relay Interface

8051
Microcontroller
(AT89C51ED2)

7407
P1.4

Page 4

Analog Inputs/Outputs
Voltage-based control and monitoring.
Disadvantages





Advantages
Simple interface
Low cost for low-resolutions
High speed
Low programming overhead






High cost for higher resolutions
Not all microcontrollers have analog
inputs/outputs built-in
Complicates the circuit design when external ADC
or DAC are needed.
Short distance, few feet maximum.

Voltage type: Typical ranges







0 to 2.5V
0 to 4V
0 to 5V
+/- 2.5V
+/- 4V
+/- 5V

Current type: Typical ranges



0-20mA
4-20mA

Analog Interface
Vcc

Amplifier
Potentiometer

LM35
Temperature
Sensor
Vcc

Vcc

Analog/
Digital
Converter
(ADC)

8051
Microcontroller
(AT89C51ED2)

Digital/
Analog
Converter
(DAC)

4-20mA
Output

Strain-gage

Page 5

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 )

Advantages
High speed
High throughput: Several bits are transmitted
on one clock transition
Low cost

Disadvantages


Large number of microcontroller pins that
needed for implementing the parallel bus

Example: LCD Interface

4-bit LCD Interface
Alphanumeric LCD

8051
Microcontroller
(AT89C51ED2)

P0.7
P0.6
P0.5
P0.4

P0.2
P0.1
P0.0

D7
D6
D5
D4
D3
D2
D1
D0
E
R/W
RS

Hello World

8-bit LCD Interface
Alphanumeric LCD

8051
Microcontroller
(AT89C51ED2)

P0.7
P0.6
P0.5
P0.4
P0.3
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • 8052 to Serial Interfacing Research Paper
  • P89V51Rd2 Microcontroller Essay
  • Avr Microcontroller Essay
  • Microcontroller Based Ultrasonicdistance Meter Essay
  • Essay about Microcontroller Market to Grow in America and the EMEA and APAC regions by 2018
  • Microcontroller: Output and Pin Essay
  • 8051 Microcontroller Based Essay
  • AUTOMATIC STREET LIGHT USING MICROCONTROLLER Essay

Become a StudyMode Member

Sign Up - It's Free