1
Gnther Gridling
Bettina Weiss
Grundlagen Microcontroller
Introduction
2
Lecture Overview
Introduction
What is a microcontroller?
difference between microcontroller and microprocessor
reasons for existence of microcontrollers
fields of application
microcontroller types
frequently used terms
3
A Simple Control Task: Heating
periodically read temperature (4 bit digital value)
turn on/off heating according to temp. (1 control line)
current temperature is displayed (display 8+3 bits)
user can adjust temp. thresholds with buttons (4 btns)
serial interface to download temp. data for last 24 h (2 bit)
-> 20 digital I/O lines, timer, serial interface
What is a Microcontroller?
4
Components we need:
CPU (Z80)
2x PIO (2x 16 = 32 digital I/O lines)
SIO (serial I/O)
CTC (timer)
memory (SRAM, Flash, EEPROM)
requires 8 chips (+ their connections) on PCB
Heat Control With Z80
5
PCB: euro format 10x16 cm
6
(Autorouter 81% finished)
7
If we do this with a microcontroller:
require
CPU
at least 20 digital I/O lines
serial interface
timer
memory (SRAM, Flash, EEPROM)
Heat Control With ATmega16
8
Components we need: 1 microcontroller
All components are integrated into one single chip!
What is a Microcontroller?
PCB: less than quarter euro format 5x8 cm
9
size reduction of more than factor 4!
10
microcontroller integrates several components:
CPU
memory
digital I/O lines
analog I/O lines
interrupt controller
counter/timer
serial interface(s)
What is a Microcontroller?
11
smaller board area
faster development
easier debugging and upgradability
low cost
low power consumption
high reliability
Why Microcontrollers?
microcontrollers save time & money!
12
telecommunication
automotive industry
aerospace industry
household appliances, home automation
factory automation
...
Fields of Application
mostly high quantities (90 in car) -> huge market!
13
Many different controllers from many
different vendors
(e.g. PIC, ATmega16, HC11, 8051)
controller family:
same CPU
different peripherals (number of I/Os, timers, ...)
e.g.: Atmel AVR ATmega family
Types of Microcontrollers
14
controllers are (4), 8, 16, 32 bit
we concentrate on small 8-bit controllers
no MMU (memory management unit)
no DMA (direct memory access)
no Cache
clocking frequency about 1 - 25 MHz
Types of Microcontrollers
15
Microprocessor: a CPU (e.g. in a PC)
Microcontroller: single chip computer,
contains I/O lines to directly monitor and
control environment
Digital Signal Processor: designed for signal
processing (fast multiplications), often
hybrid
Some Technical Terms
16
Embedded System: the microcontroller is
part of the system, has a dedicated function
(microwave, mobile phone, ...)
Real-Time System: a system which has to
react to events within a given time frame; if
the reaction comes too late, the results may
be disastrous
(break-by-wire in car)
Some Technical Terms
17
Microcontroller: CPU + peripherals on one
chip
Microcontroller can be used stand-alone
Motivation for Microcontrollers: time &
money
Microcontroller families
Important terms
Lecture Summary