0% found this document useful (0 votes)
64 views

Periphrals & Interfacing Basics

The document discusses various peripherals used in microcontrollers including GPIO controllers, timers, PWM controllers, DACs, ADCs, serial communication controllers, memory, interrupt controllers, and DMA controllers. It also describes how to interface these peripherals with microcontrollers using digital and analog input and output.

Uploaded by

hefawoj62
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Periphrals & Interfacing Basics

The document discusses various peripherals used in microcontrollers including GPIO controllers, timers, PWM controllers, DACs, ADCs, serial communication controllers, memory, interrupt controllers, and DMA controllers. It also describes how to interface these peripherals with microcontrollers using digital and analog input and output.

Uploaded by

hefawoj62
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Microcontroller

Peripherals
By,
Ipshita Tasnim
Lecturer
Dept. of CSE, VU

6/6/2020 MC Peripheral & Interfacing 1


Peripherals
A peripheral is a part of a microcontroller that interfaces with the
outside world.
9 Essential Embedded Microcontroller Peripherals:
• 1. GPIO controllers
• 2. Timers
• 3. Pulse Width Modulation (PWM) controllers
• 4. Digital to analog converters(DAC)
• 5. Analog to digital converters(ADC)
• 6. Serial communication Controllers
• 7. Memory
• 8. Interrupt controllers
• 9. Direct Memory Access Controller
Besides them there are many external peripherals.

6/6/2020 MC Peripheral & Interfacing 2


1. GPIO controllers
GPIO stands for General Purpose Input and Output.
The basic functionality of a GPIO controller includes:

• reading the voltage level, if they are


set as input
• writing the voltage to 0 or 1 if they are
set as output.
can be routed to other peripherals such
as ADCs and DACs to serve some
alternate functions as needed by the
peripherals.
6/6/2020 MC Peripheral & Interfacing 3
1. GPIO Pins

6/6/2020 MC Peripheral & Interfacing 4


2. Timers
• Timing is a crucial part of any embedded system.
• It maintains the timing of an operation in sync with a system
clock or an external clock.

• The timer has so many applications such as


• measure time
• generating delays,

6/6/2020 MC Peripheral & Interfacing 5


3. Pulse Width Modulation (PWM)
controllers
These are special kinds of timers that are directly able to
control the voltage output at a given GPIO pin.
• The microcontrollers are digital devices that can only deal
with binary voltage levels, level 0 (0v) and level 1(5v).
• If we need some other voltages in the middle, let’s say 1.25v,
the only way to accomplish this is by turning on and off the
pins continuously at a very fast rate so that the average
voltage becomes 1.25v.
• The device that does this is called PWM controllers.

6/6/2020 MC Peripheral & Interfacing 6


4. Digital to analog converters(DAC)
They take integers (digital numbers) as input and produce an
equivalent analog signal as output.

6/6/2020 MC Peripheral & Interfacing 7


5. Analog to digital converters(ADC)
• These ADCs are devices that can sense the voltage at a given
GPIO pin. It takes an analog voltage and converts it to a
digital number.
• It does so using a method called sampling and quantization.

6/6/2020 MC Peripheral & Interfacing 8


6. Serial communication Controllers
To talk to the external peripherals, some sort of
communication protocol is needed. This is taken care of using
devices called serial communication controllers.
• The most common examples of serial communication
protocols include UART, I2C, and SPI.
• There are several others like I2S, USART, USB, Ethernet,
Bluetooth, Wifi and so on.

6/6/2020 MC Peripheral & Interfacing 9


7. Memory
There are 2 types of memory
• Primary memory and
• Secondary memory

Primary memory is volatile and holds data and the source


code that is presently being processed, while the secondary
memory is nonvolatile and used to hold constants and the
source code.

6/6/2020 MC Peripheral & Interfacing 10


8. Interrupt controllers
Interrupt controllers listen to the peripherals for events and
reports to the processor once an event occurs.
real-life examples of interrupts:
• You are reading a book and your phone rings to alert you of a call

• Examples of events that can produce interrupts include


• GPIO reads 1 or 0
• Timer countdown reached 0
• Serial communication received a packet of data and
• DMA has completed a transfer

6/6/2020 MC Peripheral & Interfacing 11


9. Direct Memory Access Controller
One of the major operation of a microprocessor besides
arithmetic operations, logical operations to perform
include data move operations. But the microprocessor doesn’t
do that by itself.

• Its done by DMA controller.


• The term DMA stands for direct memory access.
• DMA can transfer blocks of data between I/O devices and
main memory with minimal intervention from the processor.

6/6/2020 MC Peripheral & Interfacing 12


Introduction to
Microcontroller
Peripheral Interfacing
By,
Ipshita Tasnim
Lecturer
Dept. of CSE, VU

6/6/2020 MC Peripheral & Interfacing 13


Interfacing
• Transfer of data between microcontrollers and
peripherals(memory, I/O devices etc.) implemented using
buses called interfacing.

• ‘Interfacing’ is a
term used to
describe the
hardware and
software needed to
connect devices
together efficiently.

6/6/2020 MC Peripheral & Interfacing 14


Need of Interfacing
• The basic need is to have some input/output peripherals and
man-machine interface.
• Interactions with a computer or TV are possible using the
mouse /keyboard/display screen.
• The no. of real world devices and systems like mobile phone
and washing m/c need the keypad and display to enable
human-computer interactions

6/6/2020 MC Peripheral & Interfacing 15


Interfacing
• There are four basic types of interface:

– Digital input
– Digital output
– Analog input
– Analog output

6/6/2020 MC Peripheral & Interfacing 16


Digital input
• Simple switches and push buttons can be connected to the
microcontroller parallel I/O port configured as an input port.
Each switch connects to one input pin and is able to change
the logic state (low/high)

• Digital sensors can be


similarly connected to
indicate various physical
states (e.g. door open,
temperature high etc.)

6/6/2020 MC Peripheral & Interfacing 17


Digital Outputs
• The output from the microcontroller I/O port is a logic
signal (0 or 5Volts normally). This signal can be used to
drive LEDs or low power digital devices

• For higher power applications the logic


signal must be ‘amplified’ to increase
the voltage/current available

6/6/2020 MC Peripheral & Interfacing 18


Other Digital Interfaces
• Serial I/O

– Many microcontrollers include serial input/output hardware that


is used to send/receive data over a serial communications link

– Generally used over short distances (<100m) or over any


distance via an external modem

• Serial Peripheral Interface (SPI)

– A ‘synchronous’ serial interface used to connect external


peripherals to the microcontroller chip over short distances (<30
cm)

6/6/2020 MC Peripheral & Interfacing 19


Analog Inputs
• Many microcontrollers incorporate an Analog to Digital
Converter (ADC) to convert analog voltages to a quantized
digital value

• An external ADC may also be connected via the SPI or


using the external data/address bus lines (if available)

6/6/2020 MC Peripheral & Interfacing 20


Analog Sensors
• An ADC allows the microcontroller to interface to sensors
such as:

– Temperature sensors
– Pressure sensors
– Light intensity sensors
– Sound sensors (microphone)

6/6/2020 MC Peripheral & Interfacing 21


Input Signal Conditioning

• The transducer output (which could be mV or a small


change in resistance etc.) must be ‘conditioned’ by an
input signal conditioning circuit before it can be used by
the microcontroller ADC

6/6/2020 MC Peripheral & Interfacing 22


Input Signal Conditioning
• The DAC output signal may need to be
amplified/filtered/converted in order to drive an
external device e.g.

• Loudspeaker
• Hydraulic servo (position/load control)
• RF modulator
• Motor drive unit

6/6/2020 MC Peripheral & Interfacing 23


Analog Output
An output signal (analog voltage) can be produced using a
Digital to Analog Converter (DAC)
• The DAC takes a digital word (normally 8-16 bits) and converts
it to a voltage

• By converting a series of digital words in sequence a signal can


be produced

• Few microcontrollers include a DAC on chip

6/6/2020 MC Peripheral & Interfacing 24


Basic I/O Concepts
Peripherals such as LEDs and keypads are essential
components of microcontroller-based systems
• Input devices
– Provide digital information to an MPU
– Examples: switch, keyboard, scanner, and digital camera
• Output devices
– Receive digital information from an MPU
– Examples: LED, seven-segment display, LCD, and printer

6/6/2020 MC Peripheral & Interfacing 25


I/O Interfacing

6/6/2020 MC Peripheral & Interfacing 26


I/O Interfacing
– To read binary data from an input peripheral
• MPU places the address of an input port on the address bus

• Enables the input port by asserting the RD signal

• Reads data using the data bus

– To write binary data to an output peripheral


• MPU places the address of an output port on the address bus

• Places data on data bus

• Asserts the WR signal to enable the output port


6/6/2020 MC Peripheral & Interfacing 27
Interfacing
• Interfaces can be classified into many types as the given
picture below:

6/6/2020 MC Peripheral & Interfacing 28


Digital Input/output (On/off based)

6/6/2020 MC Peripheral & Interfacing 29


Examples

6/6/2020 MC Peripheral & Interfacing 30


Analog Input/output (On/off based)

6/6/2020 MC Peripheral & Interfacing 31

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy