0% found this document useful (0 votes)
94 views24 pages

Chapter 2

The document discusses embedded systems and microcontrollers. It explains that embedded systems are digital technologies embedded in our environment that control many devices from automobiles to medical equipment. More than 98% of processors today are used in embedded systems. Microcontrollers were developed from microprocessors and integrate a CPU with memory, I/O, and other features onto a single chip to control machines. The document contrasts microprocessors, which perform calculations, with microcontrollers, which control their environment based on fixed programs stored in memory. It also describes different types of memory used in microcontrollers, including registers, volatile memory like RAM, and non-volatile memory like ROM.

Uploaded by

wondimu bantihun
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)
94 views24 pages

Chapter 2

The document discusses embedded systems and microcontrollers. It explains that embedded systems are digital technologies embedded in our environment that control many devices from automobiles to medical equipment. More than 98% of processors today are used in embedded systems. Microcontrollers were developed from microprocessors and integrate a CPU with memory, I/O, and other features onto a single chip to control machines. The document contrasts microprocessors, which perform calculations, with microcontrollers, which control their environment based on fixed programs stored in memory. It also describes different types of memory used in microcontrollers, including registers, volatile memory like RAM, and non-volatile memory like ROM.

Uploaded by

wondimu bantihun
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/ 24

Why Study Embedded System

Each day, our lives become more dependent on 'embedded systems', digital
information technology that is embedded in our environment. This includes not
only safety-critical applications such as automotive devices and controls, railways,
aircraft, aerospace and medical devices, but also communications, 'mobile worlds'
and 'e-worlds', the 'smart' home, clothes, factories etc. All of these have wide-
ranging impacts on society, including security, privacy and modes of working and
living. More than 98% of processors applied today are in embedded systems, and
are no longer visible to the customer as 'computers' in the ordinary sense. New
processors and methods of processing, sensors, actuators, communications and
infrastructures are 'enablers' for this very pervasive computing. They are in a sense
ubiquitous, that is, almost invisible to the user and almost omnipresent. As such,
they form the basis for a significant economic push.
These applications are 'vision driven', as in the following examples:
Automotive: Accident free driving
Aerospace: A free, safe sky for all
Medical Devices: Robotic surgeon
Communications: Seamless connectivity
e-Life: ubiquitous/pervasive computing.

1/3/2015
MICROCONTROLLER
2

Introduction
Born of parallel developments in computer architecture
and integrated circuit fabrication, the 4-bit 4004
microprocessor, or "computer on a chip," first became a
commercial reality by intel corporation.
Other, more well-established, semiconductor firms soon
followed Intels pioneering technology so that by the late
1970s one could choose from a half dozen microprocessor
types.

1/3/2015
3

A by-product of microprocessor development was the


microcontroller.
The same fabrication techniques and programming
concepts that make possible the general-purpose
microprocessor also yielded the microcontroller.

1/3/2015
Microprocessors vs. Microcontrollers
4

Microprocessors and microcontrollers stem from the


same basic idea,
are made by the same people. and are sold to the same
types of system designers and programmers.
What is the difference between the two?

1/3/2015
continued
5
MICROCONTROLLERS MICROPROCESSORS
a typical microcontroller, which is a true
A microprocessor, as the term has
computer on a chip come to be known, is a general-
The design incorporates all of the features
purpose digital computer central
found in a microprocessor CPU: ALU, PC, processing unit (CPU).
SP, and registers microprocessor CPU, which
It also has added the other features needed to contains an arithmetic and logic unit
make a complete computer: ROM. RAM, (ALU), a program counter (PC), a
parallel I/O, serial I/O, counters, and a clock stack pointer (SP), some working
circuit. registers, a clock timing circuit, and
interrupt circuits.

1/3/2015
continued
6

The prime use of a microcontroller is


The prime use of a
to control the operation of a machine microprocessor is to fetch
using a fixed program that is stored in data, perform extensive
ROM and that does not change over calculations on that data, and
the lifetime of the system. store those calculations in a
one which is meant to fetch data. mass storage device or
Perform limited calculations on that
display the results for human
use
data, and control its environment
The programs used by the
based on those calculations microprocessor are stored in
the mass storage device and
loaded into RAM as the user
directs
A few microprocessor programs are
stored in ROM

1/3/2015
TYPES OF MICROCONTROLLERS
7

MICROCONTROLLER

4-BIT MICROCONTROLLER differ in the amount of internal ROM,


RAM and other cost sensitive features.
Often the memory can be expanded lo
8 BIT MICROCONTROLLER include off-chip ROM and RAM; in some
cases, the microcontroller has no on-board
ROM at all, or the ROM is an Electrically
16-BIT MICROCONTROLLER Reprogrammable Read Only Memory
(EPROM).

32-BIT MICROCONTROLLER

1/3/2015
8

All controllers of a family contain the same processor


core and hence are code-compatible,
but they differ in the additional components like the
number of timers or the amount of memory.
There are numerous microcontrollers on the market today
many different controller families like 8051, PIC, HC,
ARM to name just a few, and that even within a single
controller family you may again have a choice of many
different controllers.

1/3/2015
9

1/3/2015
Memory
10
The register file is, of course, just a small memory embedded in the CPU
Obvious distinction of memory types can be made according to their
function from a programmers perspective, that makes sense

REGISTER FILE
Small & CPU short term memory, a set of general purpose registers or
dedicated registers (accumulators) or index register for addressing
mode
Embedded in CPU

DATA MEMORY
For longer term storage
on-chip data memory

INSTRUCTION MEMORY
Like data memory, a relatively large external memory
is usually integrated right into the MCU
1/3/2015
11

Different members in a MCU family usually provide different amounts of


memory, so you can choose a particular MCU which offers the appropriate
memory space.
However, hardware or chip designers usually view memory rather differently:
They prefer to distinguish according to the physical properties of the electronic
parts the memory is made of.
There, the most basic distinction would be volatile versus non-volatile
memory.
volatile means that the contents of the memory are lost as soon as the systems
power is switched off.
Further distinction based on the physical properties can go into more detail
See the next page

1/3/2015
12
. continued

why should you use volatile memory at all, when non-volatile


memory is readily available?
The problem here is that non-volatile memory is usually a lot slower, and
much more expensive. While the volatile memory in your PC has access times
in the nanosecond range, some types of non-volatile memory will be
unavailable for milliseconds after writing one lousy byte to them.

1/3/2015
Volatile memory
13

volatile memory retains its contents only so long as


the system is powered on
Static RAM
Dynamic RAM
STATIC RAM: was the first type of volatile memory
to be widely used.
An SRAM chip consists of an array of cells, each
capable of storing one bit of information
. To store a bit of information, a so-called flip-flop is
used, which basically consists of six transistors

1/3/2015
14

Dynamic RAM:
The number of transistors needed per bit of
information was brought down to one.
DRAM has much larger storage capacity compared to
an SRAM
Instead of using a lot of transistors to build flip-flops,
one bit of information is stored in a capacitor

1/3/2015
Non-volatile Memory
15

memories retain their content even when power is


cut.

ROM
first types of non-volatile semiconductor memory
Did we just say write access is more involved with non-volatile than with volatile memory?

As an alternative For prototypes


matrices of memory cells, each containing a silicon fuse
PROM each fuse is intact and each cell reads as a logical 1
the cells fuse can be destroyed, thereby programming a logical 0 into the selected cell
Any drawback?

programming is non-destructive
EPROM Memory is stored in so-called field effect transistors (FETs)(one of its pins called gate)
completely insulated from the rest of the circuit. instead of burning fuses, electrons are
injected into the floating gate, thus closing the transistor switch
1/3/2015
continued
16

all the advantages of an EPROM without the hassle


An elevated voltage is still needed, but it is provided on-chip via so-called charge pumps, which
EEPROM can generate higher voltages than are supplied to the chip externally
They endure a limited number of write/erasecycles only (usually in the order of 100.000 cycles)

EEPROM is rather expensive and Flash is a variant of EEPROM where erasing is not
possible for each address
Flash-EEPROM Flash EEPROM is commonly used for program, not data memory and Flash-EEPROMs often
have a lower guaranteed write/erase cycle endurance compared to EEPROM

combines the advantages of volatile and non-volatile memories: Non-


Volatile RAM (NVRAM)
NVRAM One is to just add a small internal battery to an SRAM device
One is to just add a small internal battery to an SRAM device

1/3/2015
Interrupts
17

Microcontrollers tend to be
deployed in systems that have to
react to events
Interrupts are a mechanism
which enables MC to respond to
some events, regardless of what
MC is doing at that time.
Each interrupt changes the
program flow, Interrupts it and
after executing an interrupt
routine, it continues from that
same point on

1/3/2015
continued
18

As soon as the event occurs, the microcontroller calls


an interrupt service routine (ISR) which handles the
event

1/3/2015
Interrupt Control
19

Two bits form the main interface to the interrupt logic of


the microcontroller:
The interrupt enable (IE) bit is set by the application
programmer to indicate that the controller should call an
ISR in reaction to the event.
The interrupt flag (IF) bit is set by the microcontroller
whenever the event occurs, and it is cleared either
automatically upon entering the ISR or manually
the IF bit shows that the interrupt condition has
occurred, whereas the IE bit allows the interrupt itself to
occur.

1/3/2015
20

1/3/2015
Basic I/O devices and technologies
21

The ability to directly monitor and control hardware, is


the main characteristic of microcontrollers
It uses both analog and digital I/O technologies as the
environments of the system are both analog and
digital.
Digital I/O
Analog I/O
In general, you can find 8-32 pins on most controllers,
and some even have a lot more than that (like
Motorolas HCS12 with over 90 I/O pins).

1/3/2015
Digital I/O
22

I/O pins are generally grouped into ports of 8 pins,


which can be accessed with a single byte access.
Pins can either be input only, output only, or most
commonly, bi-directional
most pins have one or more alternate functions
As far as digital I/O is concerned, three registers
control the behavior of the pins
Data Direction Register (DDR)
Port Register (PORT)
Port Input Register (PIN)

1/3/2015
23

Data Direction Register (DDR): Each bidirectional port has its own DDR,
which contains one bit for each pin of the port
Port Register (PORT): This register is used to control the voltage level of output
pins.
Assuming a pin has been configured to output, then if its bit in the PORT register is
set, the pin will be high; if the bit is cleared, the pin will be low.
Port Input Register (PIN): The PIN register is generally read-only and contains
the current state (high or low) of all pins, whether they are configured as output or
as input.
It is used to read the state of input pins, but it can also be used to read the state of
output pins to verify that the output was taken over correctly.

1/3/2015
Analog I/O
24

the microcontroller must deal with the analog value.


On the other hand, the microcontroller is inherently
digital, so we need appropriate ways of converting
analog signals into the digital world and back again.
This problem is addressed by the analog module of
the microcontroller.

1/3/2015

Common questions

Powered by AI

A designer must evaluate several key factors when selecting a microcontroller for an embedded system, such as processing power, memory requirements, I/O capabilities, and specific environmental and operational targets . The application demands will dictate the necessary bit size, with higher bit microcontrollers (e.g., 16-bit or 32-bit) suited for more complex tasks and 8-bit or lower for simpler operations . Memory considerations include the sizes of RAM and ROM, which affect the capability for program and data storage, ensuring the microcontroller can handle expected workloads without resource bottlenecks . I/O requirements determine how well the microcontroller interfaces with sensors and actuators, necessitating appropriate pin configurations and protocols . Additional considerations, such as power consumption, cost constraints, and the existing design ecosystem (including familiarity with platform-specific development tools), also significantly impact the selection process . Thus, designers must align these technical criteria with project objectives and constraints to achieve optimal system performance .

Volatile memory, such as Static RAM (SRAM) and Dynamic RAM (DRAM), retains its contents only while powered, offering faster access times and less expensive storage compared to non-volatile memory . SRAM uses flip-flops requiring more transistors per bit but provides faster access, whereas DRAM uses capacitors, allowing for higher density and larger capacity . Non-volatile memory, including ROM and variants like EEPROM and Flash, retains data without power, which is crucial for storing programs in embedded systems . However, it usually has slower access times and higher costs . The writing process can be complex, which adds to its limitation in frequent update scenarios . Flash memory, although a non-volatile option typically used for program storage, experiences wear from write/erase cycles, limiting its long-term reliability .

Microcontrollers and microprocessors both stem from similar foundational technology, including integrated circuit fabrication . However, microcontrollers are designed as true computers on a chip and include features such as ROM, RAM, parallel I/O, serial I/O, counters, and a clock circuit, which allow them to independently control devices . Their prime use is in controlling the operation of a machine through a fixed program stored in ROM . In contrast, microprocessors are general-purpose CPUs that perform extensive data calculations and are primarily used in applications requiring access and storage of large data volumes beyond simple control . Microprocessors tend to use external ROM, as their programs can change over time and are stored in modifiable storage, whereas microcontroller programs are typically non-modifiable .

The choice between volatile and non-volatile memory in embedded systems impacts both system design and operational performance. Volatile memory, such as Static RAM (SRAM) and Dynamic RAM (DRAM), offers faster access speeds and is cost-effective, making it suitable for quick data buffering and temporary storage . However, its contents are lost upon power down, necessitating non-volatile storage for persistent data . Non-volatile memory, including ROM, EEPROM, and Flash, retains information without power, essential for storing firmware and critical configuration settings . These memory types are generally slower and more expensive but are crucial for applications where data integrity is vital across power cycles. Hence, system designers often utilize a combination of both, with volatile memory for real-time operations and non-volatile for data preservation and system boot processes . The trade-offs between speed, cost, and durability are decisive factors in the memory architecture design of embedded systems .

Microcontrollers are foundational to pervasive computing, as their integration capabilities enable various 'smart' applications and devices to operate autonomously and efficiently . They comprise all necessary components, like I/O interfaces and built-in memory, to control and manage operations in devices ranging from smart homes to wearable technology . By embedding microcontrollers into everyday objects, these devices can gather, process, and exchange data seamlessly, forming the backbone of environments that adapt to and anticipate human needs . This integration supports the vision-driven development of technologies, such as seamless connectivity in communications, accident-free driving systems, and autonomous medical devices, thereby advancing the concept of ubiquitous computing .

Flash memory in microcontrollers offers several advantages for program storage. It combines the benefits of non-volatile memory, retaining data without power, and the flexibility of reprogramming, crucial for firmware updates and debugging . Its architecture allows for the integration of charge pumps that facilitate higher voltage operations necessary for writing, enhancing usability without requiring external power sources . However, Flash memory also has limitations, including slower write speeds compared to volatile memory and a finite number of write/erase cycles, which can limit its durability over time . This makes it less suitable for data that require frequent updates. It is thus used mainly for storing programs, where rewrite frequency is lower, ensuring both persistency and adaptability in embedded applications .

I/O pins on microcontrollers serve as the primary interface between the microcontroller and the external world, enabling it to monitor and control peripheral devices . These pins can be configured as input or output, allowing the microcontroller to either read data from sensors or control actuators and other components . I/O pins are typically grouped into ports, with control registers such as the Data Direction Register (DDR), Port Register, and Port Input Register (PIN) managing their operation. DDR sets a pin's direction, the Port Register controls output voltage levels, and the PIN register is used to read input states . This capability is crucial for real-time system regulation and feedback, as it allows for precise environmental interactions, making microcontrollers integral to applications like monitoring, automation, and user interfaces in embedded systems .

Embedded systems deeply influence societal aspects because they are integral to various sectors including transportation, health, and communications . They improve safety and efficiency in automotive systems through advances like accident-free driving features and ensure safe navigation in aerospace . In healthcare, the use of embedded systems has led to the development of robotic surgeons, thus facilitating precision in medical procedures . Furthermore, these systems enable seamless connectivity in communications, thereby supporting the concept of 'e-life,' which includes smart homes and smart wearable technologies that enhance convenience and lifestyle . The reliance on and pervasiveness of these systems also raise concerns about privacy and security, as they become nearly ubiquitous and operate largely without user awareness .

Interrupt mechanisms allow microcontrollers to efficiently manage tasks and respond to external events regardless of their current operations . When an event that requires immediate attention occurs, the interrupt system halts the current process and jumps to an interrupt service routine (ISR) to handle it . This capability makes microcontrollers highly responsive, as they do not need to constantly poll for changes, saving resources and enhancing performance in real-time applications . The interrupt enable (IE) and interrupt flag (IF) bits are critical, as they manage the activation and detection of interrupts, facilitating tailored response strategies . This mechanism is crucial in time-sensitive applications where prompt reaction to external changes can drastically improve the system's efficiency and effectiveness .

Microcontrollers are categorized by their bit size: 4-bit, 8-bit, 16-bit, and 32-bit, each serving different applications based on their processing capabilities and memory . 4-bit microcontrollers are typically used in simple applications such as basic control functions in appliances due to their limited computational power . 8-bit microcontrollers, which offer a balance of complexity and efficiency, are widely used in consumer electronics and automotive applications . 16-bit controllers provide more computational power and enhanced processing capabilities, suitable for digital signal processing tasks found in industrial control systems . 32-bit controllers, with their superior processing speed and extensive memory support, are ideal for complex tasks requiring precise control and high throughput, such as multimedia processing, network communications, and advanced robotics .

You might also like