embedded systems design n.
Skip this Video
Loading SlideShow in 5 Seconds..
Embedded Systems Design PowerPoint Presentation
Download Presentation
Embedded Systems Design

Embedded Systems Design

417 Views Download Presentation
Download Presentation

Embedded Systems Design

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Embedded Systems Design 52.360

  2. What is an embedded system ? • 80%+ of all processors currently sold are used in embedded systems • digital enabling technology is hidden inside the product such as TV remote control or automotive control module • even PC’s have embedded microprocessors - the keyboard will include an embedded processor for scanning the keys and sending the data to the motherboard • highly integrated digital technology provides advantages: processing power, cost, size, time-to-market

  3. What is an embedded system ? • A large car may have 50 microprocessors • engine management systems • anti-lock brakes • transmission with electronic traction control • electronic gearboxes • airbag systems and other safety aids • air-conditioning … etc • A washing machine may have a microprocessor based control unit • motor power control for pump, wash and spin • wash program control + timing

  4. What is an embedded system ? • Mobile phones contain more computing power than a desktop computer had a few years ago • Many toys and domestic appliances use microprocessor control • the cheapest microprocessor will cost maybe 30 pence • the word “control” is at the heart of many embedded applications • for many systems the goal is to control a physical system (temperature, motion, audio…..) using a variety of user/sensory inputs

  5. What is an embedded system ? • Dedicated to controlling a specific device or function - sometimes with real-time constraints • Self-starting (no human intervention required). The user does not know whether there is a microprocessor or dedicated electronic hardware inside • not designed to be programmed by a user in the same way a PC is • Self-contained, with the program( and any OS) stored in some non-volatile memory

  6. History …... • Microprocessor invented as a programmable replacement for calculator chips in the late 70’s • up till then, control systems using digital technology utilised individual integrated circuit devices • many chips required to form an adder function.. • then an adder became available on one chip - providing higher integration levels - smaller circuit boards • then a complete calculator functionality on one chip - even higher integration

  7. History …... • So calculator was now low cost…..but every change to the functionality required a new chip to be designed and created • what was needed was a more flexible device with some re-programmability inside it • a chip which took data in, processed it and sent it out again….. • so instead of silicon engineers having to revise gate-level circuits and create new chips, the user of the chip could create a new wider range of products by changing the program code…….

  8. A Birth in the family…. • The microprocessor was born, providing flexibility and low-cost • The goal is always less cost and more functionality • the same embedded control board can be used for a range of products ( some functions or interfaces may not even be used) • the software can be changed or upgraded and can have different versions for different applications • the cost of production per unit can be lowered by using a large production run of the same hardware

  9. More benefits…. • Even if hardware is not re-usable the time-to-market advantage is clear and important • consider the rapid evolution of domestic electronics • VCR’s, televisions and microwave cookers need control panels/timers. These can be designed and taken to production quicker using the highly-integrated functionality of microcontrollers to form the heart of the system • Other systems (machine tools, telephone switchgear...) can have software upgrades but utilise existing embedded hardware

  10. The benefits just keep coming... • Many systems which would have required expensive hardware upgrades in the past now need only software changes • this can sometimes be done remotely, using communication links • mechanical systems can be more effectively controlled by microprocessor • sensor derived data can lead to more effective control, thus reducing mechanical wear • diagnostics are available

  11. Embedded Systems : some areas of exploitation Medical Telecomms Avionics Consumer Electronics Embedded Systems Space Exploration Industrial Control Automotive Multimedia

  12. Embedded Systems : a few examples Engine Management Lift Controllers Microwave Ovens Answering Machines Embedded Systems Robot Controllers Navigation Systems

  13. An engine management system... • Embedded microprocessor controls fuel mix and ignition • control software considers accelerator position, temperature and other factors • engine is controlled efficiently • different configurations can be supplied with emphasis on power, torque or fuel-efficiency • can even compensate for component wear (if sensory data is available) • can provide driver with information

  14. Don’t try this at home…. • Hackers get everywhere ! • There is an expanding market for “chipped” engine management units • third-party companies modify the software that is used by the control unit ( using inside information) to provide more power or torque. • Can lead to dramatic changes in the performance of the car • this may invalidate your guarantee :( • this may be very unsafe :( :( • may infringe the original manufacturer’s intellectual property rights(IPR)

  15. Embedded Systems..smaller and cheaper • Tamagochi (electronic pets)

  16. Scenes from a small life….

  17. It’ll happen to us all…...

  18. Cost advantage... • These devices start at a cost of only £3 • think about all the parts required : • casing • buttons • LCD display • embedded microprocessor with program • circuit board • battery • packaging • the manufacturer will wish to produce the units for a third of the retail price

  19. About IPR • Programs are expensive to create. Hardware and software design knowledge is what gives a company it’s competitive edge. • A hardware design may be created with only off-the-shelf parts so it can be difficult to protect the IPR. Competitors can get a board, trace the printed-circuit and if they know what the components are, can reproduce the board • some companies remove the markings from chips to make them anonymous

  20. Embedded software can resist detection... • Some embedded software is placed in a PROM(programmable read only memory) external to the microprocessor • this could be copied if the PROM is unsoldered from the board and read in another circuit or PROM programmer :( • Software can be programmed into PROM internal to the microprocessor. It is invisible and usually impossible to access. The IPR is protected :)

  21. Embedded Engineering Systems • Certain logical and temporal demands are placed on many of these systems • they react to sensory information • if temperature > 40oC then ….. • they may have strict deadlines • sampling must be undertaken 200 times/second • from the occurrence of a comm’s message a reply must be sent within 1mS • the stepping motor must be advanced 500 steps/second maximum with acceleration and deceleration ramps

  22. Embedded Engineering Systems • may be complex systems, heavily event driven • events generated by timers, sensors, user-controls and peripheral devices ( comm’s ports, vision systems) • Systems will be engineered with cost, size, weight, robustness and reliability constraints • may required specialised operating systems and programming languages • (pSOS, VxWorks, OS/9 are examples of real-time operating systems)

  23. Embedded Engineering Systems • (Ada is an example of a multitasking language. C is inherently single-threaded but can be extended to multitasking capability using a library of calls to a multitasking operating system) • may require the developer to have a knowledge of the hardware/software boundary • needs knowledge of internal peripheral chip organisation, taken from data-sheets - addressing, control/data register configuration, timing issues • may require specialist development equipment such as emulators and logic analysers • emulators can trace and store processor/program activity • logic analysers can capture hardware signal activity

  24. Embedded Systems : environment • Industrial embedded systems have special problems to cope with: • electrical noise in the environment • ( factory automation and automotive systems have to cope with high levels of electrical noise emissions ) • wide temperature fluctuations • high levels of mechanical vibration • fluctuating humidity levels • liquids and gases in the environment • require specially ruggedised equipment • standard Personal Computers not suitable

  25. Sensor conditioning Pipe Pressure Reading Valve Motor Pressure Sensor Processing Controllable Valve Output Valve Angle Computer Motor control Real-Time example : Process Control A/D D/A Controlled Gas Flow Gas Flow Control

  26. Process Control Computer Process Control A valve is an example of an Actuator. It moves in response to electrical stimuli A Transducer generates an electrical signal proportional to the physical quantity being measured Temperature Transducer (sensor) Valve Stirrer Chemicals and materials

  27. Production Control Computer Manufacturing Systems Manipulators Parts Movement Machine Tools Embedded Computer(s)

  28. Embedded Systems are often Real-Time • Real-time systems can be categorised • hard real-time systems have absolute response times. If they are not met the system has failed • flight control systems, power-station control • soft real-time systems do not have such stringent deadlines and the occasional missed deadline is not critical • some systems will have both types of deadlines • a soft deadline 0f 100ms (for optimal response) and a hard deadline of 800mS (system failure if there is no response by this time)

  29. An overview…. Control Algorithms I/O System Engineering System Data Logging and processing Sensors Actuators User Controls Displays Data Retrieval and display Storage devices Communications Remote Devices User Interfacing

  30. Embedded Systems : components Storage Peripherals Real Time Clock Frequency Generators Pulse-width Modulators Processor(s) Serial Peripheral Interfaces Memories Embedded Systems Comm’s Interfaces Counter/timers Display Interfaces Analogue I/O Parallel I/O

  31. Embedded Systems: Two examples in one Algorithms for digital control Embedded Processor board Engineering System IR Communications Data Retrieval and display User Interface User Interfaces

  32. Real Time Embedded Systems Characteristics • Can be large and complex • require extensive maintenance • systems must be extensible because of change and evolution in the application environment • Can be small and compact • zero maintenance would be ideal • we don’t want a software update for our washing-machine or video recorder firmware (non-changeable software in ROM/PROM)

  33. Real Time Characteristics • Can involve complex control algorithms • mathematical modelling • feedback and feed-forward systems Control Output error Demand  Controller Plant Feedback (position, velocity, acceleration, temperature…)

  34. Real Time Characteristics Control Output D/A Plant Amplification Parallel I/O Controller Actuators/ sensors Feedback Demand A/D Conditioning Parallel I/O Computerised Control

  35. Real Time Characteristics • Reliability and Safety issues important • system designs must reflect the nature of their application environment • autoteller machines, medical equipment, chemical control systems, aeronautic systems • fail-safe systems and multiple redundant systems may be implemented • human error should be minimised • If possible the computer system should always double-check decisions made by humans

  36. Real Time Characteristics • Many different real-world elements exist at the same time • motors, conveyance-systems, sensors, displays, user-controls, databases… • will require sufficient computing power to allow all deadlines to be met • can be widely geographically distributed • may require distributed computer systems or multiprocessor systems

  37. Real Time Characteristics : Software • Require a software structure which clearly represents the concurrency and parallelism present in the real world • Ideally we should use a software methodologies and languages which can express concurrency rather than use programmer-invented schemes • Why ? • We wish to move the programmer’s awareness and effort away from low-level structures which are not directly related to the application level activities • Less obscure solutions, easier to validate correctness, easier analysis/design, easier testing, easier maintenance

  38. Real Time Characteristics : Software • Requirement for a software structure which clearly represents the time-related aspects of system behaviour • programs must be logically and temporally correct under ALL conditions. This may mean basing processor loading on “worst-case behaviour” so that it still meets deadlines predictably under all conditions • need to meet deadlines : • times at which actions are to be performed • when they have to be completed • respond to situations when all the timing requirements cannot be met or the timing changes dynamically due to system re-configuration

  39. Real Time Characteristics : Software • Example real-time requirements : • sample (at certain times) at a given sampling rate • sample data from sensor between 8.00 - 23.00 at 200 Hz • react to certain data-patterns within a certain time-scale (deadline) • Therefore we must have a predictable behavioural response from the computer system to the sampled data if we wish to meet the deadline • example : In a gas control system, if pressure is suddenly lost then there is a requirement to isolate part of the supply network within a finite time

  40. Characteristics: Interaction with hardware • The nature of embedded systems is such that computer will need to interact with the outside world using peripheral devices • software interaction with the peripherals requires the program to be able to address the peripheral hardware interface devices • peripheral interface chips will have addressable locations for reading/writing control/status/data • interface chips may generate interrupts for the processor indicating that certain operations have taken place or an error condition has arisen

  41. Program with I/O read/write calls read read read write write write get_status get_status get_status I/O driver routines I/O driver routines others…... others…... others…... I/O driver routines Characteristics: Interaction with hardware Display Sensors keypad

  42. Characteristics: Efficient Implementation • efficiency of execution means that the programmer cannot always use the highest-level of representation • the highest level abstraction may take extra execution time which may be excessive for a particular application • the programmer must be aware of the cost of particular software operations • if a response to an event is required within 20 microseconds then it is no good using a high-level software feature which takes 40 microseconds

  43. Embedded systems software • We will return later to the subject of software for embedded systems • multitasking + scheduling • real-time kernels • languages • communication • synchronisation • mutual exclusion • I/O drivers and hardware interaction • prioritisation

  44. Back to hardware….. • First we have an introduction to the hardware contained in embedded systems… • we will start by a brief examination of digital signal processing and see how analogue electronic systems can be replaced by digital systems……….

  45. t Digital can replace analogue • Increasing levels of processor power allow high performance applications to be performed digitally - digital signal processing • take an example of an analogue filter required to remove noise and other high frequency components from a sensor signal V V - output input + t

  46. Analogue components • Analogue components work on a continuous basis, with infinite values within the range they work in • can implement sophisticated mathematical functions • they are cheap and can form many different circuits • are extremely fast ( can easily process GHz rate signals) • but suffer (to a small extent) from • component ageing • drift (with temperature for instance) • noise pickup • also • fairly fixed functionality once the circuit is implemented

  47. Digital signal processing (DSP) • The digital equivalent of the filter is a fast processor which can sample the input signal, process it and output the signal sufficiently often to maintain similar accuracy, resolution and frequency response • it must provide the same function as the original analogue implementation • but there is a major difference • since the digital version must sample the input then this is not a continuous system - rather, it is a discrete system.

  48. Digital signal processing • The implementation of the filter function requires an equation of the form : • where C comes from a coefficient table and the X values are sampled analogue input values • this means there must be a set of multiply and accumulate operations executed for every sample • we must continuously sample, execute the instructions for the equation, then output the new value

  49. Time analysis for a digital filter…. • The higher the input bandwidth, the higher the sampling rate needs to be to collect sufficient samples • the higher the sampling rate, the faster the processor has to be to execute the n instructions between samples Sample/hold D/A Processor A/D output Samplen+1 Samplen Process n instructions t

  50. Sampling power required…. • For DSP applications the sampling speed is usually twice the frequency of the highest frequency signal signal being processed • Nyquist's theorem: A theorem, developed by H. Nyquist, which states that an analogue signal waveform may be uniquely reconstructed, without error, from samples taken at equal time intervals. The sampling rate must be equal to, or greater than, twice the highest frequency component in the analogue signal.