Vous êtes sur la page 1sur 35

Embedded Computer systems

Engineering
COE 4161
Lecture 2
Emmanuel Ndashimye
Agenda
 Input/output standards
 CPU families used in microcontrollers: 4-
bit, 8-bit, 16-32-bit
 Microprocessor evolution
 Timers/Counters, GPIO,
 Interrupt-driven I/O
 Interrupt structures
Input/Output Ports
 USB (universal serial bus)
 intelligent high-speed connection to devices
 up to 480 Mbit/s (USB 2.0 Hi-Speed)
 USB hub connects multiple devices
 enumeration: computer queries devices
 supports hot swapping, hot plugging
 Parallel
 short cable, Enhanced PP up to 2 Mbit/s
 common for printers, simpler devices
 bidirectional, parallel data transfer (IEEE 1284)
 Intel 8255 controller chip

3
Input/Output Ports (2)
 Serial
 one bit at a time
 RS-232 (recommended standard 232) serial port
 used with long cables (not longer than ~15 m OK)
 low speeds (up to 115 kbit/s)
 still widely used to interface instruments
 additional standards available:
 E.g. RS-422/485 differential signals for better
noise immunity, can support speeds in access of
10 Mbit/s (becomes cable-length dependent)

4
Input/Output Ports (3)
 IEEE-488 (GPIB)
 Has been around for 30 years, many
instruments are equipped with it
 Allows daisy-chaining up to 15 devices
 Updated versions have speeds up to 10Mbit/s

5
CPU families : 4-bit, 8-bit, 16-32-bit

 Some of the first microprocessors


had a 4-bit word length and were
developed around 1970.
CPU families used in microcontrollers: 4-bit,
8-bit, 16-32-bit

 A 8 bit CPU means, it will have 8 parallel


conducting wires running from its registers
(which can store 8 bit of data at any point
of time) to the main memory (RAM, which
is a block or stack of 8 bit locations).
 This set of parallel wires is called the
ADDRESS BUS, a similar DATA BUS also
exists.
CPU families used in microcontrollers: 4-bit,
8-bit, 16-32-bit

An example of 8-bit micro-controller


CPU families used in microcontrollers:
4-bit, 8-bit, 16-32-bit

 What does it mean to have registers


which can store 8 bit of information?
 It means that the CPU can read,
write and execute this 8 bit
information in one clock cycle and is
capable of transferring the data or
result through these wires at the
same time.
Microprocessor Evolution
 Generally characterized by the “word” size
(registers and data bus)
 8-bit, 16-bit, 32-bit, 64-bit
 addressable memory related to the word
size
 Intel 8080 (1974)
 8-bit, first truly usable m-processor (40
DIP)
 seven 8-bit registers (six of which can be
combined as three 16-bit registers)
 6K transistors, 2MHz clock

10
Early Intel Processors

 Intel 8080 later variants


 64K addressable RAM (16-bit bus
address)
 8-bit registers
 CP/M (control program for m-computers)
OS
 5,6,8,10 MHz
 29K transistors

11
….

 Intel 8086/8088 (1978)


– 16-bit processor, IBM-PC used 8088
 1 MB addressable RAM (20-bit
addresses)
 16-bit registers
 16-bit data bus (8-bit for 8088)
 separate floating-point unit (8087)
 used in low-cost microcontrollers now
Other 16-bit processors
 Western Design Center (WDC 65816)
 used in Apple II and Super Nintendo
 fully CMOS, low power consumption (300
mA at 1MHz, operating voltage as low as
1.8V)
 Wait-for-Interrupt and Stop-the-Clock
instructions further reduce power
consumption
 Still sold today (original 1984), used as a
controller
 24-bit address bus (16MB of memory
space)

13
IBM-AT
 Intel 80286 (1982)
 Still largely a 16-bit processor
 16 MB addressable RAM
 Protected memory
 several times faster than 8086
 introduced IDE bus architecture
 80287 floating point unit
 Up to 20MHz
 134K transistors

14
32-bit processors
 Motorola 680x0 series
 32-bit registers
 68010 (1982) adds virtual memory support
 Other successors 68020/68030/68040/68060
 Popular with UNIX operating systems in late
1980’s/early 1990’s
 Faded from computer desktop market, but
had a strong standing in embedded /
controller equipment (still used)

15
IA-32
 Intel386 (1985)
 4 GB addressable RAM
 32-bit registers
 paging (virtual memory)
 Up to 33MHz
 Intel486 (1989)
 instruction pipelining
 Integrated FPU
 8K cache

16
….

 Pentium (1993)
 Superscalar (two parallel pipelines)
 Intel declines to license Pentium to
others, AMD and Cyrix start their own
designs
Intel Pentium Family
 Pentium Pro (1995)
 advanced optimization techniques in m-code
 More pipeline stages
 On-board L2 cache
 Pentium II (1997)
 MMX (multimedia) instruction set
 Up to 450MHz
 Pentium III (1999)
 SIMD (streaming extensions) instructions
(SSE)
 Up to 1+GHz

18

 Pentium 4 (2000)
 NetBurst micro-architecture, tuned for
multimedia
 3.8+GHz
 Pentium D (Dual core)
 …
Timer and Counters
What Do You Use Timers For?

 Timing of events (internal or external)


 Scheduling Events
 Measuring the width of a pulse
 Speed control of motors (PWM)
 Generation of complex waveforms
 Frequency generation (sounds)
Review of counters

 What you should remember from your digital


electronics class:
 A ripple counter
Applications
 Timers
 Hardware time delays (MCU are very fast,
timers introduces delays)
 Timing how long between events
• Counters
- Electronic turnstiles (Counting how
many people passing through)
- Assembly line – counting parts
What is a Timer?
 Timer is nothing but a simple binary counter that can
be configured to count clock
pulses(Internal/External).
 Once it reaches the Max value, it will roll back to
zero setting up an Over Flow flag and generates the
interrupt if enabled.
 All Timers can act as a timer or counter or PWM
Generation
Timer vs. Counters

 Timers increment on CPU clock pulses


(Keep everything in sync)

 Counters increment on external pulses

 Other than that, both Time and Counter


operate identically
What can the Computer Actually Do? - Instructions and Instruction Sets

A computer “executes” instructions in its


Arithmetic Logic Unit (ALU), running through a
series of instructions called a program. An ALU
can only do a few things, but it can do them very
fast. A typical 8-bit ALU can do the list shown
below. A is the “Accumulator”, a digital register
where the computations actually occur, and M is a
location in memory. The ALU in turn forms part
of the Central Processing Unit (CPU).
Increment A A = A plus 1
Decrement A A=A-1
Add A to M A = A plus M
Subtract M from A A=A-M
AND A with M A = A.M
OR A with M A=A+M
Exclusive OR A with M A = A+ M
Shift A left A = 2A
Shift A right A = A/2
Rotate A left
Rotate A right
Complement A A = NOT A
Clear A A=0
How Instruction Sets are Made: the “CISC” Machine

Any CPU has a set of instructions that it recognises and responds to; all programs are built up in one
way or another from this instruction set. We want computers to execute code as fast as possible, but
how to achieve this aim is not always an obvious matter.

One approach is to build sophisticated CPUs with exotic instruction sets, with an instruction ready
for every foreseeable operation. This leads to the CISC, the Complex Instruction Set Computer. A
CISC has many instructions, and considerable sophistication. Yet the complexity of the design
needed to achieve this tends to lead to slow operation. One characteristic of the CISC approach is
that instructions have different levels of complexity. Simple ones can be expressed in a short
instruction code, say one byte of data, and execute quickly. Complex ones may need several bytes of
code to define them, and take a long time to execute.

A CISC machine is generally recognised by:


• Many instructions (say over one hundred), some with considerable sophistication;
• Instruction words are of different length;
• Instructions take different lengths of time to execute.
How Instruction Sets are Made: the “RISC” Machine

Another approach is to keep the CPU very simple, and have a limited instruction set. This leads to
the RISC approach – the Reduced Instruction Set Computer. The instruction set, and hence overall
design, is kept simple. This leads to fast operation. One characteristic of the RISC approach is that
each instruction is contained within a single binary word. That word must hold all information
necessary, including the instruction code itself, as well as any address or data information also
needed. A further characteristic, an outcome of the simplicity of the approach, is that every
instruction normally takes the same amount of time to execute.

A RISC machine is generally recognised by:


• Few instructions (say well below one hundred),
• Each performs a very simple action;
• All instructions are single word;
• All, or almost all instructions take the same length of time to execute.
The Microcontroller

• A microcontroller is an
integrated chip that is often
part of an embedded system.

• Microcontroller includes a
CPU, RAM, ROM, I/O ports,
and timers like a standard
computer

• They are much smaller and


simplified so that they can
include all the functions
Source:
required on a single chip.
http://students.iitk.ac.in/eclub/assets/lectures/embedded/Embedded-Old-
1.pdf
A Gathering of Microprocessors and Microcontrollers

Motorola PIC 16F877


PIC 16C72 68HC05B16
PIC 16F84A

Motorola 68000

PIC 12F508
The Microchip PIC Families

The “PIC” was originally a design of the company General Instruments. It was intended for
simple control applications, hence the name – Peripheral Interface Controller. In the late
1970s General Instruments produced the PIC1650 and PIC 1655 processors. Although the
design was comparatively crude and unorthodox, the PIC was completely stand-alone, and
contained some important and forward-looking features. The simple CPU was a RISC
structure, with a single accumulator (called the “Working Register”, and just 30 instructions.
The output pins could source or sink much more current than most other microprocessors of
the time. Already the trademarks of the PIC were emerging – simplicity, stand-alone, high
speed, and low cost.

General Instruments sold off its semiconductor division to a group of venture capitalists, who
must have realised the immense potential of these odd little devices. Throughout the nineties
the range of available PIC microcontrollers grew, and as they did so they gradually overtook
many of their better-established competitors. In many cases PIC microcontrollers could run
faster, needed a simpler chip-set, and were quicker to prototype with, than their competitors.
Unlike many competitors, Microchip made their development tools simple, and low-cost or
free. Moreover Microchip stayed firmly entrenched in the 8-bit world.

Despite the huge advances that have been made, we can still see features of the old General
Instruments PIC, even in the most recent designs.
Comparison of 8-bit PIC families

Family Example Instructi Stack Number Interru


Devices on word size of pt
size (word instructio vectors
s) ns
Baseline 10F200, 12-bit 2 33 None
12F508,
16F57
Mid- 12F609, 14-bit 8 35 1
range 16F84A,
16F631,
16F873A
High 18F242, 16-bit 32 75, 2
Perform 18F2420 including (prioritis
ance hardware ed)
multiply
PIC 12F508/509
Take home slide

• An embedded system is a product that has one or more computers embedded


within it, which exercise primarily a control function.
• The embedded computer is usually a microcontroller: a microprocessor adapted
for embedded control applications.
• Microcontrollers are designed according to accepted electronic and computer
principles, and are fundamentally made up of microprocessor core, memory and
peripherals; it is important to be able to recognise their principal features.
• Microchip offers a wide range of microcontrollers, divided into a number of
different families. Each family has identical (or very similar) central architecture
and instruction set. However, common features also appear across all their
microcontrollers, and knowledge of one family can lead with ease to knowledge of
another.

End of Lecture

Vous aimerez peut-être aussi