KEMBAR78
Embedded system | PPT
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 Microcontrollers Microcontroller Architecture The 8051 Microcontroller Programming Techniques Downfalls of embedded systems References Embedded System
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. Embedded System
EMBEDDED SYSTEMS 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 Embedded System
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
Hardware Restraints 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 .  Embedded System
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 Embedded System
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
General Computing Control Systems Signal Processing Communication & Networking Embedded System
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 Brake system  Engine control unit Diagnostics and Security systems Accessories (doors, windows etc) continued Embedded System
Embedded System PRINTERS AND COPIERS FACTORY CORDINATION PERSONAL GADGETRY HOME APPLIANCES TOY INDUSTRY  AUTOMOTIVE AIRCRAFTS ROBOTICS
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 ) SOCKETED 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 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
Systems-on-chip 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 Examples Intel Strong ARM SA-1110 Motorola PowerPC MPC823e Embedded System
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 Embedded System
Embedded System
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 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.
Microcontrollers  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 Timer(WDT) Interrupt Serial Port Parallel Port ADC(optional) Bootloader(optional)
Microprocessor vs. Microcontroller Microprocessor   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
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 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. Example-Motorola 68HC11 Microcontroller
8051 Microcontroller
Pin Description of the 8051 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051 (8031)
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
Programming Techniques Assembly Language High Level Language
ASSEMBLY  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 [3]  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 Large Instruction Set Architecture Reliability
References http://www.embedded.com http://www.wikipedia.org/wiki/Embedded_system www.googlebooks.com Microcontrollers-Ajay V Deshmukh

Embedded system

  • 1.
    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
  • 9.
    General Computing ControlSystems Signal Processing Communication & Networking Embedded System
  • 10.
    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
  • 13.
    EPROMS IN SOCKETS2K bytes RAM DISCRETE LOGIC FOR “GLUE” FUNCTIONS 8-BIT MICROPROCESSOR ( Z80 ) SOCKETED 40 PINS @ 0.100” SPACING DUAL IN-LINE PACKAGE ( DIP) 4 MHz CLOCK SPEED CRYSTAL OSCILLATOR Embedded System
  • 14.
    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
  • 17.
  • 18.
    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
  • 27.
  • 28.
    Pin Description ofthe 8051 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0) P0.1(AD1) P0.2(AD2) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14) P2.5(A13) P2.4(A12) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051 (8031)
  • 29.
    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
  • 32.
  • 33.
    Programming Techniques AssemblyLanguage High Level Language
  • 34.
    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
  • 39.