Microcontrollers & Embedded Processors Anshul Parmar Nazim Ali Rohit Gambhir Acharya Narendra Dev College University of Delhi
What is an Embedded System?
Characteristics of Embedded Systems
General Types Of Embedded Systems
Where are Embedded Systems used?
Typical Embedded Systems Hardware
New trends in ES hardware
The 8051 Microcontroller
Downfalls of embedded systems
An embedded system can be defined as one that has computer hardware with software embedded in it as one of its most important components.
An embedded system is a combination of computer hardware and software, either fixed in capability or programmable, that is specifically designed for a particular kind of application device.
Embedded systems that are programmable are provided with a programming interface.
Executes a single program with few parameters
Task –specific : Can be optimized for a specific application
Interacts with environment in many ways
Direct sensing and control of signal wires
Communication protocols to environment and other devices
Real-time interactions and constraints
Power –saving modes of operation to conserve battery
• Reactive: computations must occur in response to external events.
Correctness is partially a function of time
Small Size, Low Weight
• Hand-held electronics and Transportation applications
Battery power for 8+ hours
Heat, vibration,shock , p ower fluctuations, RF interference,
lightni ng, corrosion
Extremely cost sensitive
The term embedded system does not refer to devices that are isolated but rather, they are a part of the device they control or perform some other task in.
The software that is used in embedded systems is usually termed as firmware .
A simple embedded system usually consists of components such as buttons and LED to input the data and to show the output respectively.
Complex embedded systems have touch screens, large amount of buttons etc. for the purposes of input, output etc.
An embedded system has software designed to keep in view three constraints :-
Available system memory
Available processing speed
Need to limit power dissipation
Microprocessors usually perform a single or very limited set of tasks. In many cases, a single microprocessor may not be of any use at all. Microcontrollers on the other hand can perform a number of operations and thus, can execute a complete task. They can be considered as extended versions of a microprocessor.
Communication & Networking
Real-time video, DVD players, Medical equipment.
Network routers, switches, firewalls, mass transit systems, Elevator
Mobile phones, pagers, home appliances, toys, smartcards, MP3 players, PDAs, digital cameras, sensors, pc keyboard & mouse
Engine control unit
Diagnostics and Security systems
Accessories (doors, windows etc)
continued Embedded System
PRINTERS AND COPIERS
Examples Office systems and mobile equipment Building systems Manufacturing and Process Control Answering machines Copiers Faxes Laptops and notebooks Mobile Telephones PDAs, Personal organisers Still and video cameras Telephone systems Time recording systems Printer Microwave Air conditioning Backup lighting and generators Building management systems CTV systems Fire Control systems Heating and ventilating systems Lifts, elevators, escalators Lighting systems Security systems Security cameras Sprinkler systems Automated factories Bottling plants Energy control systems Manufacturing plants Nuclear power stations Oil refineries and related storage facilities Power grid systems Power stations Robots Switching systems Water and sewage systems
EPROMS IN SOCKETS 2K bytes RAM DISCRETE LOGIC FOR “GLUE” FUNCTIONS
8-BIT MICROPROCESSOR ( Z80 )
40 PINS @ 0.100” SPACING
DUAL IN-LINE PACKAGE ( DIP)
4 MHz CLOCK SPEED
CRYSTAL OSCILLATOR Embedded System
Commercial off-the-shelf components (COTS)
e.g. wireless radios, sensors, I/O devices
Application-Specific ICs (ASICs)
ICs tailored to meet application needs
Good performance for their intended task(s)
Original ESs were ASICs only
DSPs(Digital signal processor)
General Purpose Processors
Usual (or desired) specifications:
32-bit RISC controller
Built-in interfaces to RAM and ROM
Built-in DMA, interrupt and timing controllers
Built-in interfaces to disk or flash memory
Built-in Ethernet/802.11 interfaces
Built-in LCD/CRT interfaces
Intel Strong ARM SA-1110
Motorola PowerPC MPC823e
An embedded operating system is the software program that manages all the other programs in an embedded device after initial load of programs by a boot loader.
Embedded Linux is inherited from Linux that has been modified and upgraded by developers in Linux community to be fit as an embedded operating system. It is normally said that embedded Linux has advantages of ‘portability’, ‘flexibility’, ‘lower cost’ and ‘development environments’. That is why embedded Linux is nowadays widely using in embedded devices
What is a Microcontroller?
A Microcontroller is essentially a small and self-sufficient computer on a chip, used to control devices.
It has all the memory and I/O it needs on board.
Is not expandable –no external bus interface.
Characteristics of a Microcontroller.
Low speed, on the order of 10Khz-20 Mhz
Small architecture, usually an 8-bit architecture
Small memory size, but usually enough for the type of application it is intended for .
Limited I/O, but again, enough for the type of application it is intended for.
Other features not usually found in general-purpose CPUs
Expanded interrupt handling capabilities
Automatic saving of context before handling interrupt
Interrupt vectoring to quickly jump to handlers
More instructions for bit manipulations
Support operations on bits (signal wires) rather than just words
Integrated memory and support functions for cheaper system cost
Built –in EEPROM, Flash, and/or RAM
DRAM controller to handle refresh
Page-mode support for faster block transfers
Mitsubishi Semiconductors is now “Renesas” M16C/26 family of microcontrollers – M30626 – 32K RAM, 384K Flash SKP = starter kit MDS = Microcontroller Data Embedded System
Three Criteria for Choosing Microcontroller
Meeting the computing needs of the task efficiently and cost effectively
speed, the amount of ROM and RAM, the number of I/O ports and timers, size, packaging, power consumption
easy to upgrade
cost per unit
Availability of software development tools
assemblers, debuggers, C compilers, emulator, simulator, technical support
Wide availability and reliable sources of the microcontrollers.
The necessary tools for a microprocessor /controller
CPU: Central Processing Unit
I/O: Input /Output
Bus: Address bus & Data bus
Memory: RAM & ROM
Microprocessor vs. Microcontroller
CPU is stand-alone, RAM, ROM, I/O, timer are separate
designer can decide on the amount of ROM, RAM and I/O ports.
CPU, RAM, ROM, I/O and timer are all on a single chip
fix amount of on-chip ROM, RAM, I/O ports
for applications in which cost, power and space are critical single-purpose
Microcontroller Architectures CPU Program + Data Address Bus Data Bus Memory Von Neumann Architecture CPU Program Address Bus Data Bus Harvard Architecture Memory Data Address Bus Fetch Bus 0 0 0 2 n
Harvard Architecture refers to a memory structure where the processor is connected to two different memory banks via two sets of buses.
This is to provide the processor with two distinct data paths, one for instruction and one for data.
Through this scheme, the CPU can read both an instruction and data from the respective memory banks at the same time.
This inherent independence increases the throughput of the machine by enabling it to always prefetch the next instruction.
The cost of such a system is complexity in hardware.
Example- MCS-51 Family of Microcontroller, DSP’s
A Von-Neumann Machine, in contrast to the Harvard Architecture provides one data path (bus) for both instruction and data.
As a result, the CPU can either be fetching an instruction from memory, or read/writing data to it.
Other than less complexity of hardware, it allows for using a single, sequential memory.
Modern processors employ a Harvard Architecture to read from two instruction and data caches, when at the same time using a Von-Neumann Architecture to access external memory.
Pin Description Pin No. Name Function Pins 1-8 Port 1 Input/Output Pin 9 RS Reset Pin 10-17 Port 3 Universal Input/Output Pin 10 RXD Serial asynchronous communication input or Serial synchronous communication output.
Pin 11 TXD Serial asynchronous/synchronous communication Pin 12 INT 0 Interrupt 0 input Pin 13 INT 1 Interrupt 1 input Pin 14 T 0 Counter 0 clock input Pin 15 T 1 Counter 1 clock input Pin 16 WR Write Pin 17 RD Read Pin 18,19 X 2, X 1 Internal oscillator I/O Pin 20 GND Ground
Pin 21-28 Port 2 If external memory is not in use then these pins are configured as universal I/O Pin 29 PSEN It is the read strobe to external memory Pin 30 ALE Will set the lower address byte (A0-A7) on Port 0 . Pin 31 EA When high executes instruction from internal program memory Pin 32-39 Port 0 Universal I/O pins
Microcontroller 8051 Internal Architecture
High Level Language
All microcontroller run on simple binary codes
An assembly language is a low level language for programming microcontrollers . It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture
A utility program called an assembler is used to translate assembly language statements into the target computer's machine code.
The file produced by the assembler for PICs is given the .hex file suffix. The .hex file is what the PIC programmer tool uses to burn the program into the PICs program memory.
EDITOR ASSEMBLER LINKER INPUT THROUGH KEY BOARD .ASM FILE .OBJ FILE AND 1 ST FILE .HEX FILE .ASM FILE .OBJ
HIGH LEVEL LANGUAGE
These languages are either designed specially for the purpose, or versions of general purpose languages such as the C programming language.
A compiler , analogous to an assembler, is used to translate high-level language statements into machine code; or an interpreter executes statements directly.
Interprete r firmware is also available for some microcontrollers. For example, BASIC on the early microcontrollers Intel 8052  and Zilog Z8 as well as some modern devices. Typically these interpreters support interactive programming.
Simulators are available for some microcontrollers.
A simulator will show the internal processor state and also that of the outputs, as well as allowing input signals to be generated
can be the quickest way to debug and analyse problems.
Recent microcontrollers are often integrated with on-chip debug circuitry that when accessed by an In-circuit emulator via JTAG, allow debugging of the firmware with a debugger
Downfalls of Embedded Systems
Problems with embedded systems are difficult to fix