The document provides an overview of microcontrollers and embedded systems. It defines an embedded system and describes their characteristics such as real-time operation, small size, low power usage, and operation in harsh environments. It discusses the hardware components of typical embedded systems including microcontrollers. It then focuses on the 8051 microcontroller, describing its architecture and pin layout.
Microcontrollers & EmbeddedProcessors Anshul Parmar Nazim Ali Rohit Gambhir Acharya Narendra Dev College University of Delhi
2.
What is anEmbedded System? Characteristics of Embedded Systems General Types Of Embedded Systems Where are Embedded Systems used? Typical Embedded Systems Hardware New trends in ES hardware Microcontrollers Microcontroller Architecture The 8051 Microcontroller Programming Techniques Downfalls of embedded systems References Embedded System
3.
An embedded systemcan 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. Embedded System
4.
EMBEDDED SYSTEMS Executesa 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 Embedded System
5.
Real-Time Operation • 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 Low Power Battery power for 8+ hours Harsh environment Heat, vibration,shock , p ower fluctuations, RF interference, lightni ng, corrosion Extremely cost sensitive Embedded System
6.
Hardware Restraints Theterm 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 . Embedded System
7.
A simple embeddedsystem 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 Embedded System
8.
Microprocessors Microcontrollers.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. Embedded System
Real-time video, DVDplayers, 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 Brake system Engine control unit Diagnostics and Security systems Accessories (doors, windows etc) continued Embedded System
11.
Embedded System PRINTERSAND COPIERS FACTORY CORDINATION PERSONAL GADGETRY HOME APPLIANCES TOY INDUSTRY AUTOMOTIVE AIRCRAFTS ROBOTICS
12.
Examples Office systemsand 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
Commercial off-the-shelf components(COTS) e.g. wireless radios, sensors, I/O devices Cheap Application-Specific ICs (ASICs) ICs tailored to meet application needs Good performance for their intended task(s) Original ESs were ASICs only Domain-specific processors DSPs(Digital signal processor) Microcontrollers Microprocessors General Purpose Processors Embedded System
15.
Systems-on-chip Usual (ordesired) 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 Examples Intel Strong ARM SA-1110 Motorola PowerPC MPC823e Embedded System
16.
An embedded operatingsystem 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 Embedded System
What is aMicrocontroller? 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 cost 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.
19.
Microcontrollers Otherfeatures 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
20.
Mitsubishi Semiconductors isnow “Renesas” M16C/26 family of microcontrollers – M30626 – 32K RAM, 384K Flash SKP = starter kit MDS = Microcontroller Data Embedded System
21.
Three Criteria forChoosing 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.
22.
The necessary toolsfor a microprocessor /controller CPU: Central Processing Unit I/O: Input /Output Bus: Address bus & Data bus Memory: RAM & ROM Timer(WDT) Interrupt Serial Port Parallel Port ADC(optional) Bootloader(optional)
23.
Microprocessor vs. MicrocontrollerMicroprocessor CPU is stand-alone, RAM, ROM, I/O, timer are separate designer can decide on the amount of ROM, RAM and I/O ports. expensive versatility general-purpose Microcontroller 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
24.
Microcontroller Architectures CPUProgram + 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
25.
Harvard Architecture HarvardArchitecture 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
26.
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. Example-Motorola 68HC11 Microcontroller
Pin Description PinNo. 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.
30.
Pin 11 TXDSerial 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
31.
Pin 21-28 Port2 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
ASSEMBLY LANGUAGEAll 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.
35.
EDITOR ASSEMBLER LINKERINPUT THROUGH KEY BOARD .ASM FILE .OBJ FILE AND 1 ST FILE .HEX FILE .ASM FILE .OBJ
36.
HIGH LEVEL LANGUAGEThese 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 [3] and Zilog Z8 as well as some modern devices. Typically these interpreters support interactive programming.
37.
Simulators areavailable 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
38.
Downfalls of EmbeddedSystems Problems with embedded systems are difficult to fix Large Instruction Set Architecture Reliability