Getting To Know Embedded Systems Hardware
Getting To Know Embedded Systems Hardware
Lecture 2
-
1
2012-09-03
Bus controller
Central (Ethernet) GPIO
Processing Unit
(e.g., ARM, AVR, Bus controller Audio/Video
PIC, x86, (USB)
PowerPC… UART
Custom devices
(e.g., ASIC, Bus controller
FPGA,…) (CAN) Counter/timer
2
2012-09-03
Data to be printed is
1. accepted from the Ethernet
controller,
2. held in RAM until the printer is
ready for more data, and
3. delivered to the printer via the
parallel port.
3
2012-09-03
Busses
Memory
System bus
CPU
Basic I/O
Bridge
Peripheral busses
Peripheral Peripheral
device device
4
2012-09-03
System bus
Also referred as “main bus", "processor bus" or "local bus”
• Connects the CPU with the memory and some basic I/O
• Usually the fastest bus in the system
• System buses transfer data in parallel. In a 32-bit bus, data are sent
over 32 wires simultaneously. A 64-bit bus uses 64 wires.
• Split into three sub-busses
Device 1 Device 2
Memory
Peripheral busses
Also referred as “I/O bus“, expansion bus", "external bus",
"host bus"
• Connecting various peripheral devices to the CPU
• Connected to the system bus via a "bridge“, a device that connects
two similar or dissimilar buses together
Examples:
• PCI bus for communicating with things like hard disks and sound cards
• USB bus for connecting things like cameras, scanners and printers
• Firewire bus, mostly for video cameras and external hard drives
• CAN, TTP, FlexRay busses, provide real-time guarantees, mostly
used in automotive
5
2012-09-03
Processors
Processors
Microprocessor
• a chip containing a powerful central processing
unit (CPU) that has not been designed with any
particular computation in mind
• The foundation of PCs and high-end
workstations, but can be used in embedded
systems as well
• Examples: Intel Pentium, Freescale PowerPC,
AMD, …
6
2012-09-03
Processors
Microcontroller (MCU)
• a specialized form of microprocessor, designed for
use in embedded systems
• Typically include a CPU, memory, and other
peripherals in the same integrated circuit
• Examples: Intel 8051, Motorola 6811, AVR32UC3
(used in labs of this course)
Processors
7
2012-09-03
Processors
Embedded systems
• most often use 4-, 8-, 16- and simpler 32-bit CPUs
• High-bit CPUs usually more expensive, faster, more complex and
more energy consuming than low-bit CPUs
Memories
8
2012-09-03
Memories
00..0016
Memories
9
2012-09-03
Main memory
Hybrid
• Offers ROM-like permanence, but under some
conditions it is possible to overwrite their data
• Stored data is kept even though no power is
supplied
10
2012-09-03
Types of RAM
Types of ROM
Masked ROM
• ROM contents must be specified before chip production
• Main advantage: Low production cost
• No longer commonly used
11
2012-09-03
Hybrid memories
Hybrid memories
12
2012-09-03
Hybrid memories
Flash memory
• Increasingly popular
• Combines all the best features of the
previously described memory devices
• Similar to EEPROM in functionality, but a
Flash devices can be erased only one
sector 8-64 KB at a time, not byte by byte
Memory characteristics
13
2012-09-03
Cache memory
14
2012-09-03
Scratchpad memories
15
2012-09-03
Registers
Bus request
DMA
Bus grant Controller Device 2
CPU
Control bus (R/W)
Address bus
Data bus
Memory
16
2012-09-03
If no DMA is present:
• The processor must read the data from one device and write it to
the other, one byte or word at a time
• For each byte or word transferred, the processor must fetch and
execute a sequence of instructions
• If large amount of data should be transferred other applications
might never get a chance to run
If DMA is present:
• The DMA controller can perform the entire transfer, with little or
no assistance from the processor
Peripherals
(Timers,
interfacing,..)
17
2012-09-03
Hardware timer
Used to measure elapsed time
• Typically by counting down processor cycles or clocks
• The timer normally counts the cycles of the processor's main clock
signal
• Could also use a separate clock whose clock signal is fed
into the timer peripheral from an external processor pin
Watchdog timer
18
2012-09-03
19
2012-09-03
Basic thinking
• “Since they use different protocols, I need one set of GPIO for
device A, and another set for device B”
Advanced thinking
• “I will use the same GPIO pins for both devices, and re-configure
them in software based on whether the microcontroller is
communicating with device A or device B
ES hardware
used in this
course
20
2012-09-03
EVK1100
• Ethernet port
• Sensors: Light, Temperature,
Potentiometer
• 4x20 Blue LCD
• Connectors for JTAG, Nexus, USART,
USB 2.0, TWI, SPI
• SD and MMC Card Reader
The Dragon
• On-chip debug interface
• Allows easy debugging of applications
(single stepping and breakpointing)
Lab hardware
EVK1100
board
USB External
port power
Ethernet Serial Serial port
The Dragon – JTAG port port 0 1
(USART)
debugger Power
switch
8 Mb Data
Flash 4x20
JTAG
connector Char
LCD
Expansion
connectors
6 LED diodes
21
2012-09-03
Lab hardware
EVK1100
board
Micro-
controller
AT32UC3A
Processor
AT32UC3A
microcontroller – memory
Schematic view
System
bus
Bridges
GPIO pins
Interface to
the external
components
Peripheral controllers/interfaces
Timers
Peripheral bus
22
2012-09-03
GPIO on AVR32UC3A
There are four GPIO ports on AVR32UC3A microcontroller:
• PA – Port A
• PB – Port B
• PC – Port C
• PX – Port X
23
2012-09-03
GPIOs on
AVR32UC3A
PB
PA
PX
PC
GPIO multiplexing
24
2012-09-03
The selection of
peripherals
is performed by
accessing Peripheral
Mux Register 0 and 1
LED
Micro
controller
25
2012-09-03
(Note! The first LED is labeled as LED1 on the physical board, but it is
called LED0 in the schematics and in the AVR32 Studio!)
LED0 is
wired to
pin PB27
on the
micro-
controller
26
2012-09-03
GPIO addressing
The hardware register addresses of the PA, PB, PC and PX ports is calculated
from the numbering of the GPIO pins added to a base address of the
GPIO controller.
To find the corresponding pin from a GPIO number (i.e. the pin number of the
MCU as they are defined in the header files used by AVR32 Studio) the
following formula can be used:
Example:
27
2012-09-03
Next lecture
28