🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

1 EMBEDDED SYSTEMS TOPIC 1 HISTORY AND OVERVIEW 2 I. History and Overview Until the late 1980s, information processing was associated with large mainframe computers and huge tape drives. Later, miniaturization allowed information...

1 EMBEDDED SYSTEMS TOPIC 1 HISTORY AND OVERVIEW 2 I. History and Overview Until the late 1980s, information processing was associated with large mainframe computers and huge tape drives. Later, miniaturization allowed information processing with personal computers (PCs). Office applications were dominating, but some computers were also controlling the physical environment, typically in the form of some feedback loop. Later, Mark Weiser created the term “ubiquitous computing”. This term reflects Weiser’s prediction to have computing (and information) anytime, anywhere. Weiser also predicted that computers are going to be integrated into products such that they will become invisible. Hence, he created the term “invisible computer.” With a similar vision, the predicted penetration of our day-to-day life with computing devices led to the terms “pervasive computing” and “ambient intelligence.” These three terms focus on only slightly different aspects of future information technology. Ubiquitous computing focuses more on the long-term goal of providing information anytime, anywhere, whereas pervasive computing focuses more on practical aspects and the exploitation of already available technology. For ambient intelligence, there is some emphasis on communication technology in future homes and smart buildings. Miniaturization also enabled the integration of information processing and the physical environment using computers. This type of information processing has been called an “embedded system”. For this unit, we will introduce to you the basic concepts of embedded system. After completing this unit, you will be able to: 1. Discuss the history of Embedded Systems. 2. Distinguish between General Computing Systems and Embedded Systems. 3. Define the different classification of Embedded Systems. 4. Discuss the application areas and examples of Embedded Systems. 5. Identify the purpose of Embedded Systems. 3 What is Embedded System? An Electronic/Electro mechanical system which is designed to perform a specific function and is a combination of both hardware and firmware (Software). E.g. Electronic Toys, Mobile Handsets, Washing Machines, Air Conditioners, Automotive Control Units, Set Top Box, DVD Player etc Embedded Systems are: ✓ Unique in character and behavior ✓ With specialized hardware and software General Computing Systems Vs Embedded Systems: General Purpose Computing System Embedded System A system which is a combination of generic A system which is a combination of special hardware and General Purpose Operating purpose hardware and embedded OS for System for executing a variety of applications executing a specific set of applications A system which is a combination of generic May or may not contain an operating system hardware and General Purpose Operating for functioning System for executing a variety of applications Applications are alterable (programmable) by The firmware of the embedded system is pre- user (It is possible for the end user to re- programmed and it is non-alterable by end- install the Operating System, and add or user remove user applications) Performance is the key deciding factor on the Application specific requirements (like selection of the system. Always „Faster is performance, power requirements, memory Better‟ usage etc) are the key deciding factors Less/not at all tailored towards reduced Highly tailored to take advantage of the operating power requirements, options for power saving modes supported by hardware different levels of power management. and Operating System Response requirements are not time critical Highly tailored to take advantage of the power saving modes supported by hardware and Operating System Need not be deterministic in execution Highly tailored to take advantage of the behavior power saving modes supported by hardware and Operating System 4 History of Embedded Systems First Recognized Modern Embedded System: Apollo Guidance Computer (AGC) developed by Charles Stark Draper at the MIT Instrumentation Laboratory. It has two modules 1. Command Module (CM) 2. Lunar Excursion Module (LEM) RAM size 256 , 1K ,2K words ROM size 4K,10K,36K words Clock frequency is 1.024MHz 5000 ,3-input RTL NOR gates are used User interface is DSKY(display/Keyboard) First Mass Produced Embedded System: Autonetics D- 17 Guidance computer for Minuteman-I missile Classification of Embedded Systems ▪ Based on Generation ▪ Based on Complexity & Performance Requirements ▪ Based on deterministic behavior ▪ Based on Triggering 1. Embedded Systems - Classification based on Generation First Generation: The early embedded systems built around 8-bit microprocessors like 8085 and Z80 and 4-bit microcontrollers EX. stepper motor control units, Digital Telephone Keypads etc. Second Generation: Embedded Systems built around 16-bit microprocessors and 8 or 16-bit microcontrollers, following the first generation embedded systems EX.SCADA, Data Acquisition Systems etc. Third Generation: Embedded Systems built around high performance 16/32 bit Microprocessors/controllers, Application Specific Instruction set processors like Digital 5 Signal Processors (DSPs), and Application Specific Integrated Circuits (ASICs).The instruction set is complex and powerful. EX. Robotics, industrial process control, networking etc. Fourth Generation: Embedded Systems built around System on Chips (SoC’s), Reconfigurable processors and multicore processors. It brings high performance, tight integration and miniaturization into the embedded device market EX Smart phone devices, MIDs etc. 2. Embedded Systems - Classification based on Complexity & Performance Small Scale: The embedded systems built around low performance and low cost 8 or 16 bit microprocessors/ microcontrollers. It is suitable for simple applications and where performance is not time critical. It may or may not contain OS. Medium Scale: Embedded Systems built around medium performance, low cost 16- or 32-bit microprocessors / microcontrollers or DSPs. These are slightly complex in hardware and firmware. It may contain GPOS/RTOS. Large Scale/Complex: Embedded Systems built around high performance 32 or 64 bit RISC processors/controllers, RSoC or multi-core processors and PLD. It requires complex hardware and software. This system may contain multiple processors/controllers and co-units/hardware accelerators for offloading the processing requirements from the main processor. It contains RTOS for scheduling, prioritization and management. 3. Embedded Systems - Classification Based on deterministic behavior It is applicable for Real Time systems. The application/task execution behavior for an embedded system can be either deterministic or non-deterministic These are classified in to two types a. Soft Real time Systems: Missing a deadline may not be critical and can be tolerated to a certain degree b. Hard Real time systems: Missing a program/task execution time deadline can have catastrophic consequences (financial, human loss of life, etc.) 4. Embedded Systems - Classification Based on Triggering These are classified into two types 6 a. Event Triggered: Activities within the system (e.g., task run-times) are dynamic and depend upon occurrence of different events. b. Time triggered: Activities within the system follow a statically computed schedule (i.e., they are allocated time slots during which they can take place) and thus by nature are predictable. Application Areas and Examples Embedded and cy-phy systems are present in quite diverse areas. The following list comprises key areas in which such systems are used: ▪ Automotive electronics: Modern cars can be sold in technologically advanced countries only if they contain a significant amount of electronics. These include air bag control systems, engine control systems, anti-braking systems (ABS), electronic stability programs (ESP) and other safety features, air-conditioning, GPS-systems, anti-theft protection, and many more. Embedded systems can help to reduce the impact on the environment. ▪ Avionics: A significant amount of the total value of airplanes is due to the information processing equipment, including flight control systems, anticollision systems, pilot information systems, and others. Embedded systems can decrease emissions (such as carbon-dioxide) from airplanes. Dependability is of utmost importance. ▪ Railways: For railways, the situation is similar to the one discussed for cars and airplanes. Again, safety features contribute significantly to the total value of trains, and dependability is extremely important. ▪ Telecommunication: Mobile phones have been one of the fastest growing markets in the recent years. For mobile phones, radio frequency (RF) design, digital signal processing and low power design are key aspects. Other forms of telecommunication are also important. ▪ Health sector: The importance of healthcare products is increasing, in particular in aging societies. There is a huge potential for improving the medical service by taking advantage of information processing within medical equipment. There are very diverse techniques that can be applied in this area. ▪ Security: The interest in various kinds of security is also increasing. Embedded systems can be used to improve security in many ways. This includes secure identification/authentication of people, for example with fin ger print sensors or face recognition systems. 7 The SMARTpen® [IMEC, 1997] is another example, providing authentication of payments The SMARTpen is a pen-like instrument analyzing physical parameters while its user is signing. Physical parameters include the tilt, force and acceleration. These values are transmitted to a host PC and compared with information available about the user. As a result, it can be checked if both the image of the signature as well as the way it has been produced coincide with the stored information. More recently, smart pens locally recording written patterns became commercially available and these devices are not necessarily used for authentications. ▪ Consumer electronics: Video and audio equipment is a very important sector of the electronics industry. The information processing integrated into such equipment is steadily growing. New services and better quality are implemented using advanced digital signal processing techniques. Many TV sets (in particular high-definition TV sets), multimedia phones, and game consoles comprise powerful high-performance processors and memory systems. They represent special cases of embedded systems. ▪ Fabrication equipment: Fabrication equipment is a very traditional area in which embedded/cyber-physical systems have been employed for decades. Safety is very important for such systems, the energy consumption is less important. As an example, (taken from Kopetz [Kopetz, 1997]) the figure shows a container with an attached drain pipe. The pipe includes a valve and a sensor. Using the readout from the sensor, a computer may have to control the amount of liquid leaving the pipe. 8 ▪ Smart buildings: Information processing can be used to increase the com fort level in buildings, can reduce the energy consumption within buildings, and can improve safety and security. Subsystems which traditionally were unrelated must be connected for this purpose. There is a trend towards integrating air-conditioning, lighting, access control, accounting and distribution of information into a single system. Tolerance levels of air conditioning subsystems can be increased for empty rooms, and the lighting can be automatically reduced. Air condition noise can be reduced to a level required for the actual operating conditions. Intelligent usage of blinds can also optimize lighting and air- conditioning. Available rooms can be displayed at appropriate places, simplifying ad-hoc meetings and cleaning. Lists of non-empty rooms can be displayed at the entrance of the building in emergency situations (provided the required power is still available). This way, energy can be saved on cooling, heating and lighting. Also safety can be improved. Initially, such systems might mostly be present in high-tech office buildings, but the trend toward energy-efficient buildings also affects the design of private homes. One of the goals is to design so called zero-energy-buildings (buildings which produce as much energy as they consume) [Northeast Sustainable Energy Association, 2010]. Such a design would be one contribution towards a reduction of the global carbon dioxide footprint and global warming. ▪ Logistics: There are several ways in which embedded/cyber-physical system technology can be applied to logistics. Radio frequency identification (RFID) technology provides easy identification of each and every object, worldwide. Mobile communication allows unprecedented interaction. The need of meeting real-time constraints and scheduling are linking embedded systems and logistics. The same is true of energy minimization issues. ▪ Robotics: Robotics is also a traditional area in which embedded/cyber physical systems have been used. Mechanical aspects are very importtant for robots. Most of the characteristics described above also apply to robotics. Recently, some new kinds of robots, modeled after animals or human beings, have been designed. Figure shows such a robot. Robot “Johnnie” (courtesy H. Ulbrich, F. Pfeiffer, Lehrstuhl fur Angewandte ¨ Mechanik, TU Munchen), ©TU M ¨ unchen ▪ Military applications: Information processing has been used in military equipment for many years. In fact, some of the very first computers analyzed military radar signal. 9 Purpose of Embedded Systems: Each Embedded Systems is designed to serve the purpose of any one or a combination of the following tasks. Data Collection/Storage/Representation Data Communication Data (Signal) Processing Monitoring Control Application Specific User Interface 1. Data Collection/Storage/Representation Performs acquisition of data from the external world. The collected data can be either analog or digital. Data collection is usually done for storage, analysis, manipulation and transmission. The collected data may be stored directly in the system or may be transmitted to some other systems, or it may be processed by the system, or it may be deleted instantly after giving a meaningful representation. 2. Data Communication ▪ Embedded Data communication systems are deployed in applications ranging from complex satellite communication systems to simple home networking systems. ▪ Embedded Data communication systems are dedicated for data communication. ▪ The data communication can happen through a wired interface (like Ethernet, RS- 232C/USB/IEEE1394 etc.) or wireless interface (like Wi-Fi, GSM,/GPRS, Bluetooth, ZigBee etc.) ▪ Network hubs, Routers, switches, Modems etc. are typical examples for dedicated data transmission embedded systems. 10 3. Data (Signal) Processing ▪ Embedded systems with Signal processing functionalities are employed in applications demanding signal processing like Speech coding, synthesis, audio video codec, transmission applications etc. ▪ Computational intensive systems ▪ Employs Digital Signal Processors (DSPs) 4. Monitoring ▪ Embedded systems coming under this category are specifically designed for monitoring purpose ▪ They are used for determining the state of some variables using input sensors ▪ They cannot impose control over variables. ▪ Electro Cardiogram (ECG) machine for monitoring the heart beat of a patient is a typical example for this. ▪ The sensors used in ECG are the different Electrodes connected to the patient’s body. ▪ Measuring instruments like Digital CRO, Digital Multi meter, Logic Analyzer etc. used in Control & Instrumentation applications are also examples of embedded systems for monitoring purpose 5. Control ▪ Embedded systems with control functionalities are used for imposing control over some variables according to the changes in input variables. ▪ Embedded system with control functionality contains both sensors and actuators. ▪ Sensors are connected to the input port for capturing the changes in environmental variable or measuring variable. 11 ▪ The actuators connected to the output port are controlled according to the changes in input variable to put an impact on the controlling variable to bring the controlled variable to the specified range Air conditioner for controlling room temperature is a typical example for embedded system with „Control‟ functionality Air conditioner contains a room temperature sensing element (sensor) which may be a thermistor and a handheld unit for setting up (feeding) the desired temperature The air compressor unit acts as the actuator. The compressor is controlled according to the current room temperature and the desired temperature set by the end user. 6. Application Specific User Interface ▪ Embedded systems which are designed for a specific application. ▪ Contains Application Specific User interface (rather than general standard UI ) like key board, Display units etc. ▪ Aimed at a specific target group of users. ▪ Mobile handsets, Control units in industrial applications etc. are examples. Summary: ✓ History of Embedded System ✓ Classification of Embedded System ✓ Applications Areas and Examples ✓ Purpose of Embedded System 1 EMBEDDED SYSTEMS TOPIC 2 RELEVANT TOOLS, STANDARDS, AND/OR ENGINEERING CONSTRAINT 2 II. Relevant Tools, Standards, and/or Engineering Constraint Design Flows This section provides an overview of the embedded system design flows aimed at two objectives. First, it will give us an introduction to the various steps in embedded system design before we delve into them in more detail. Second, it will allow us to consider the design methodology itself. A design methodology is important for three reasons. First, it allows us to keep a scorecard on a design to ensure that we have done everything we need to do, such as optimizing performance or performing functional tests. Second, it allows us to develop computer-aided design tools. Developing a single program that takes in a concept for an embedded system and emits a completed design would be a daunting task, but by first breaking the process into manageable steps, we can work on automating (or at least semi automating) the steps one at a time. Third, a design methodology makes it much easier for members of a design team to communicate. The below Figure summarizes the major steps in the embedded system design process. In this top–down view, we start with the system requirements. Requirements Top- down Bottom-up design design Specification Architecture Components System Integration Fig: Major levels of abstraction in the design process 3 Requirements: Clearly, before we design a system, we must know what we are designing. The initial stages of the design process capture this information for use in creating the architecture and components. We generally proceed in two phases: First, we gather an informal description from the customers known as requirements, and we refine the requirements into a specification that contains enough information to begin designing the system architecture. Requirements may be functional or nonfunctional. We must of course capture the basic functions of the embedded system, but functional description is often not sufficient. Typical nonfunctional requirements include: Performance: The speed of the system is often a major consideration both for the usability of the system and for its ultimate cost. As we have noted, performance may be a combination of soft performance metrics such as approximate time to perform a user- level function and hard deadlines by which a particular operation must be completed. Cost: The target cost or purchase price for the system is almost always a consideration. Cost typically has two major components: manufacturing cost includes the cost of components and assembly; nonrecurring engineering (NRE) costs include the personnel and other costs of designing the system. Physical size and weight: The physical aspects of the final system can vary greatly depending upon the application. An industrial control system for an assembly line may be designed to fit into a standard-size rack with no strict limitations on weight. A handheld device typically has tight requirements on both size and weight that can ripple through the entire system design. Power consumption: Power, of course, is important in battery-powered systems and is often important in other applications as well. Power can be specified in the requirements stage in terms of battery life—the customer is unlikely to be able to describe the allowable wattage. A sample requirements form that can be filled out at the start of the project. We can use the form as a checklist in considering the basic characteristics of the system. Let’s consider the entries in the form: Name: This is simple but helpful. Giving a name to the project not only simplifies talking about it to other people but can also crystallize the purpose of the machine. Purpose: This should be a brief one- or two-line description of what the system is supposed to do. If you can’t describe the essence of your system in one or two lines, chances are that you don’t understand it well enough. 4 Inputs and outputs: These two entries are more complex than they seem. The inputs and outputs to the system encompass a wealth of detail: ▪ Types of data: Analog electronic signals? Digital data? Mechanical inputs? ▪ Data characteristics: Periodically arriving data, such as digital audio samples? Occasional user inputs? How many bits per data element? ▪ Types of I/O devices: Buttons? Analog/digital converters? Video displays? Functions: This is a more detailed description of what the system does. A good way to approach this is to work from the inputs to the outputs: When the system receives an input, what does it do? How do user interface inputs affect these functions? How do different functions interact? Performance: Many embedded computing systems spend at least some time controlling physical devices or processing data coming from the physical world. In most of these cases, the computations must be performed within a certain time frame. It is essential that the performance requirements be identified early since they must be carefully measured during implementation to ensure that the system works properly. Manufacturing cost: This includes primarily the cost of the hardware components. Even if you don’t know exactly how much you can afford to spend on system components, you should have some idea of the eventual cost range. Cost has a substantial influence on architecture: A machine that is meant to sell at $10 most likely has a very different internal structure than a $100 system. Power: Similarly, you may have only a rough idea of how much power the system can consume, but a little information can go a long way. Typically, the most important decision is whether the machine will be battery powered or plugged into the wall. Battery- powered machines must be much more careful about how they spend energy. Physical size and weight: You should give some indication of the physical size of the system to help guide certain architectural decisions. A desktop machine has much more flexibility in the components used than, for example, a lapel mounted voice recorder. 5 GPS MODULE REQUIREMENTS FORM OF GPS MOVING MAP MODULE Name : GPS moving map Purpose: Consumer-grade moving map for driving use Inputs : Power button, two control buttons Outputs : Back-lit LCD display 400 _ 600 Functions : Uses 5-receiver GPS system; three user- selectable resolutions; always displays current latitude and longitude Performance: Updates screen within 0.25 seconds upon movement Manufacturing cost:$30 Power: 100mW Physical size and weight: No more than 2” _ 6, ” 12 ounces Specification The specification is more precise—it serves as the contract between the customer and the architects. As such, the specification must be carefully written so that it accurately reflects the customer’s requirements and does so in a way that can be clearly followed during design. The specification should be understandable enough so that someone can verify that it meets system requirements and overall expectations of the customer. A specification of the GPS system would include several components: Data received from the GPS satellite constellation. Map data. User interface. Operations that must be performed to satisfy customer requests. Background actions required to keep the system running, such as operating the GPS receiver. 6 Architecture Design The specification does not say how the system does things, only what the system does. Describing how the system implements those functions is the purpose of the architecture. The architecture is a plan for the overall structure of the system that will be used later to design the components that make up the architecture. The creation of the architecture is the first phase of what many designers think of as design. This block diagram is still quite abstract—we have not yet specified which operations will be performed by software running on a CPU, what will be done by special-purpose hardware, and so on. The diagram does, however, go a long way toward describing how to implement the functions described in the specification. We clearly see, for example, that we need to search the topographic database and to render (i.e., draw) the results for the display. We have chosen to separate those functions so that we can potentially do them in parallel—performing rendering separately from searching the database may help us update the screen more fluidly. Fig: Block Diagram for the Moving Map The hardware block diagram clearly shows that we have one central CPU surrounded by memory and I/O devices. In particular, we have chosen to use two memories: a frame buffer for the pixels to be displayed and a separate program/data memory for general use by the CPU. The software block diagram fairly closely follows the system block diagram, but we have added a timer to control when we read the buttons on the user interface and render data onto the screen. To have a truly complete architectural description, we require more detail, such as where units in the software block diagram will be executed in the hardware block diagram and when operations will be performed in time. 7 Fig: Hardware and software architectures for the moving map. The architectural description tells us what components we need. The component design effort builds those components in conformance to the architecture and specification. The components will in general include both hardware—FPGAs, boards, and so on—and software modules. Some of the components will be ready-made. The CPU, for example, will be a standard component in almost all cases, as will memory chips and many other components. In the moving map, the GPS receiver is a good example of a specialized component that will nonetheless be a predesigned, standard component. We can also make use of standard software modules. System Integration Only after the components are built do we have the satisfaction of putting them together and seeing a working system. Of course, this phase usually consists of a lot more than just plugging everything together and standing back. Bugs are typically found during system integration, and 8 good planning can help us find the bugs quickly. By building up the system in phases and running properly chosen tests, we can often find bugs more easily. If we debug only a few modules at a time, we are more likely to uncover the simple bugs and able to easily recognize them. Only by fixing the simple bugs early will we be able to uncover the more complex or obscure bugs that can be identified only by giving the system a hard workout. Embedded Design Constraints From the inside, one of the most striking characteristics of embedded systems is severity of their constraints. Unlike writing software for a general-purpose computer, an embedded system is usually shipped already integrated with all the hardware it needs. The hardware platform is not usually user-extensible, so resources such as memory, power, cooling, or computing power contribute to the per-unit cost (known as recurring cost). To maintain profitability, there is almost always tremendous pressure on the developer to minimize the use of such hardware resources. This means that embedded systems often require additional optimization efforts far beyond that required for desktop applications. Beyond the need to minimize hardware, performance concerns are often critical to the success of a system. There are many aspects to performance, and different systems value these aspects differently. In some systems, throughput is a critical criterion. Throughput is normally measured in terms of the number of transactions, samples, connections, or messages that can be processed per unit time. In other systems, handling each request as quickly as possible is more important, a quality known as responsiveness, usually captured as a worst case execution time. Other systems value predictability of performance over maximum throughput or responsive ness. Predictability is usually measured as occurring within a range or as being drawn from a probability density function. Reliability, robustness, and safety are other kinds of constraints levied on embedded systems. The reliability of a system is a (stochastic) measure of the likelihood that the system will deliver the correct functionality. Robustness refers to the ability of a system to deliver services properly when its preconditions (such as operating conditions or input data rates) are violated. Safety denotes the level of risk of a system, that is, the likelihood that using the system will result in an accident or loss. These concerns often require additional hardware and software measures to maintain the operation of the system within acceptable limits. For example, most embedded systems have a power on self-test (POST) as well as a periodic or continuous built-in test (BIT). Collectively, these constraints on the system are known as the qualities of services (QoS) provided by the system. In addition to the various QoS constraints, to reduce recurring cost, it is common to create custom hardware that requires specialized device driver software. 1 EMBEDDED SYSTEMS TOPIC 3 CHARACTERISTICS OF EMBEDDED SYSTEMS 2 III. Characteristics of Embedded Systems Embedded systems possess certain specific characteristics, and these are unique to each Embedded system. 1. Application and Domain Specific Each Embedded System has certain functions to perform, and they are developed in such a manner to do the intended functions only. They cannot be used for any other purpose. Example – The embedded control units of the microwave oven cannot be replaced with AC’S embedded control unit because the embedded control units of microwave oven and AC are specifically designed to perform certain specific tasks. 2. Reactive and Real Time Embedded System are in constant interaction with the real world through sensors and user-defined input devices which are connected to the input port of the system. Any changes in the real world are captured by the sensors or input devices in real time and the control algorithm running inside the unit reacts in a designed manner to bring the controlled output variables to the desired level. Embedded System produce changes in output in response to the changes in the input, so they are referred as reactive systems. Real Time system operation means the timing behavior of the system should be deterministic ie the system should respond to requests in a known amount of time. Example – E.S which are mission critical like flight control systems, Antilock Brake Systems (ABS) etc. are Real Time systems. 3. Operates in Harsh Environment The design of E.S should take care of the operating conditions of the area where the system is going to implement. 3 Example – If the system needs to be deployed in a high temperature zone, then all the components used in the system should be of high temperature grade. Also, proper shock absorption techniques should be provided to systems which are going to be commissioned in places subject to high shock. 4. Distributed It means that embedded systems may be a part of a larger system. Many numbers of such distributed embedded systems form a single large embedded control unit. Example – Automatic vending machine. It contains a card reader, a vending unit etc. Each of them is independent embedded units but they work together to perform the overall vending function. 5. Small Size and Weight Product aesthetics (size, weight, shape, style, etc.) is an important factor in choosing a product. It is convenient to handle a compact device than a bulky product. 6. Power Concerns Power management is another important factor that needs to be considered in designing embedded systems. Embedded System should be designed in such a way as to minimize the heat dissipation by the system. 7. Single-functioned Dedicated to perform a single function 4 8. Complex functionality We have to run sophisticated algorithms or multiple algorithms in some applications. 9. Tightly-constrained Low cost, low power, small, fast, etc. 10. Safety-critical Must not endanger human life and the environment. Quality Attributes of Embedded System Quality attributes are the non-functional requirements that need to be documented properly in any system design. Quality attributes can be classified as I. Operational quality attributes II. Non-operational quality attributes. I. Operational Quality Attributes: The operational quality attributes represent the relevant quality attributes related to the embedded system when it is in the operational mode or online mode. 1. Response It is the measure of quickness of the system. It tells how fast the system is tracking the changes in input variables Most of the Embedded System demands fast response which should be almost real time. Example – Flight control application. 5 2. Throughput It deals with the efficiency of a system. It can be defined as the rate of production or operation of a defined process over a stated period of time. The rates can be expressed in terms of products, batches produced or any other meaningful measurements. Examples – In case of card reader throughput means how many transactions the reader can perform in a minute or in an hour or in a day. Throughput is generally measured in terms of “Benchmark”. A Benchmark is a reference point by which something can be measured 3. Reliability It is a measure of how much we can rely upon the proper functioning of the system. Mean Time Between Failure (MTBF) and Mean Time To Repair (MTTR) are the terms used in determining system reliability. MTBF gives the frequency of failures in hours/weeks/months. MTTR specifies how long the system is allowed to be out of order following a failure. For embedded system with critical application need, it should be of the order of minutes. 4. Maintainability It deals with support and maintenance to the end user or client in case of technical issues and product failure or on the basis of a routine system checkup. Reliability and maintainability are complementary to each other. 6 A more reliable system means a system with less corrective maintainability requirements and vice versa. Maintainability can be broadly classified into two categories a. Scheduled or Periodic maintenance (Preventive maintenance) b. Corrective maintenance to unexpected failures 5. Security Confidentiality, Integrity and availability are the three major measures of information security. Confidentiality deals with protection of data and application from unauthorized disclosure. Integrity deals with the protection of data and application from unauthorized modification. Availability deals with protection of data and application from unauthorized users. 6. Safety Safety deals with the possible damages that can happen to the operator, public and the environment due to the breakdown of an Embedded System. The breakdown of an embedded system may occur due to a hardware failure or a firmware failure. Safety analysis is a must in product engineering to evaluate the anticipated damages and determine the best course of action to bring down the consequences of damage to an acceptable level. 7 II. Non-Operational Quality Attributes: The quality attributes that needs to be addressed for the product not on the basis of operational aspects are grouped under this category. 1. Testability and Debug-ability Testability deals with how easily one can test the design, application and by which means it can be done. For an Embedded System testability is applicable to both the embedded hardware and firmware. Embedded hardware testing ensures that the peripherals and total hardware functions in the desired manner, whereas firmware testing ensures that the firmware is functioning in the expected way. Debug-ability is a means of debugging the product from unexpected behavior in the system Debug-ability is two level process a. Hardware level: It is used for finding the issues created by hardware problems. b. Software level: It is employed for finding the errors created by the flaws in the software. 2. Evolvability It is a term which is closely related to Biology. It is referred as the non-heritable variation. For an embedded system evolvability refers to the ease with which the embedded product can be modified to take advantage of new firmware or hardware technologies. 8 3. Portability It is the measure of system independence. An embedded product is said to be portable if the product is capable of functioning in various environments, target processors and embedded operating systems. “Porting” represents the migration of embedded firmware written for one target processor to a different target processor. 4. Time-to-Prototype and Market It is the time elapsed between the conceptualization of a product and the time at which the product is ready for selling. The commercial embedded product market is highly competitive and time to market the product is critical factor in the success of commercial embedded product. There may be multiple players in embedded industry who develop products of the same category (like mobile phone). 5. Per Unit Cost and Revenue Cost is a factor which is closely monitored by both end user and product manufacturer. Cost is highly sensitive factor for commercial products. Any failure to position the cost of a commercial product at a nominal rate may lead to the failure of the product in the market. Proper market study and cost benefit analysis should be carried out before taking a decision on the per-unit cost of the embedded product. The ultimate aim of the product is to generate marginal profit so the budget and total cost should be properly balanced to provide a marginal profit. 1 EMBEDDED SYSTEMS TOPIC 6 Asynchronous and Synchronous Serial Communication 2 Communication Interface: Communication interface is essential for communicating with various subsystems of the embedded system and with the external world The communication interface can be viewed in two different perspectives; namely; 1. Device/board level communication interface (Onboard Communication Interface) 2. Product level communication interface (External Communication Interface) 1. Device/board level communication interface (Onboard Communication Interface) The communication channel which interconnects the various components within an embedded product is referred as Device/board level communication interface (Onboard Communication Interface) Examples: Serial interfaces like I2C, SPI, UART, 1-Wire etc. and Parallel bus interface 2. Product level communication interface (External Communication Interface) The “product level communication interface” (External Communication Interface) is responsible for data transfer between the embedded system and other devices or modules. The external communication interface can be either wired media or wireless media and it can be a serial or parallel interface. Examples for wireless communication interface: Infrared (IR), Bluetooth (BT), Wireless LAN (Wi-Fi), Radio Frequency waves (RF), GPRS etc. Examples for wired interfaces: RS-232C/RS-422/RS 485, USB, Ethernet (TCP-IP), IEEE 1394 port, Parallel port etc. 3 1. Device/board level communication interface (Onboard Communication Interface) Communication channel which interconnects the various components within an embedded product is referred as Device/board level communication interface (Onboard Communication Interface) These are classified into 1.1. I2C (Inter Integrated Circuit) Bus 1.2. SPI (Serial Peripheral Interface) Bus 1.3. UART (Universal Asynchronous Receiver Transmitter) 1.4. 1-Wires Interface 1.5. Parallel Interface 4 I2C (Inter Integrated Circuit) Bus Inter Integrated Circuit Bus (I2C - Pronounced “I square C”) is a synchronous bi-directional half duplex (one-directional communication at a given point of time) two wire serial interface bus. The concept of I2C bus was developed by “Philips Semiconductors” in the early 1980’s. The original intention of I2C was to provide an easy way of connection between a microprocessor/microcontroller system and the peripheral chips in Television sets. The I2C bus is comprised of two bus lines, namely; Serial Clock – SCL and Serial Data – SDA 5 SCL line is responsible for generating synchronization clock pulses and SDA is responsible for transmitting the serial data across devices.I2C bus is a shared bus system to which many numbers of I2C devices can be connected. Devices connected to the I2C bus can act as either “Master” device or “Slave” device. The “Master” device is responsible for controlling the communication by initiating/terminating data transfer, sending data and generating necessary synchronization clock pulses. Slave devices wait for the commands from the master and respond upon receiving the commands. Master and „Slave‟ devices can act as either transmitter or receiver. Regardless whether a master is acting as transmitter or receiver, the synchronization clock signal is generated by the „Master‟ device only.I2C supports multi masters on the same bus. The sequence of operation for communicating with an I2C slave device is: 1. Master device pulls the clock line (SCL) of the bus to “HIGH” 2. Master device pulls the data line (SDA) “LOW”, when the SCL line is at logic “HIGH” (This is the “Start” condition for data transfer) 3. Master sends the address (7 bit or 10 bits wide) of the “Slave” device to which it wants to communicate, over the SDA line. 4. Clock pulses are generated at the SCL line for synchronizing the bit reception by the slave device. 5 5. The MSB of the data is always transmitted first. 6. The data in the bus is valid during the “HIGH” period of the clock signal 6 7. In normal data transfer, the data line only changes state when the clock is low. 8. Master waits for the acknowledgement bit from the slave device whose address is sent on the bus along with the Read/Write operation command. 9. Slave devices connected to the bus compares the address received with the address assigned to them 10. The Slave device with the address requested by the master device responds by sending an acknowledge bit (Bit value =1) over the SDA line 11. Upon receiving the acknowledge bit, master sends the 8bit data to the slave device over SDA line, if the requested operation is “Write to device”. 12. If the requested operation is “Read from device”, the slave device sends data to the master over the SDA line. 13. Master waits for the acknowledgement bit from the device upon byte transfer complete for a write operation and sends an acknowledge bit to the slave device for a read operation 14. Master terminates the transfer by pulling the SDA line „HIGH‟ when the clock line SCL is at logic “HIGH” (Indicating the “STOP” condition). 7 SPI (Serial Peripheral Interface) Bus The Serial Peripheral Interface Bus (SPI) is a synchronous bi-directional full duplex four wire serial interface bus. The concept of SPI is introduced by Motorola. SPI is a single master multi slave system. It is possible to have a system where more than one SPI device can be master, provided the condition only one master device is active at any given point of time, is satisfied. 8 SPI is used to send data between Microcontrollers and small peripherals such as shift registers, sensors, and SD cards. SPI requires four signal lines for communication. They are: Master Out Slave In (MOSI): Signal line carrying the data from master to slave device. It is also known as Slave Input/Slave Data In (SI/SDI) Master In Slave Out (MISO): Signal line carrying the data from slave to master device. It is also known as Slave Output (SO/SDO) Serial Clock (SCLK): Signal line carrying the clock signals Slave Select (SS): Signal line for slave device select. It is an active low signal. The master device is responsible for generating the clock signal. Master device selects the required slave device by asserting the corresponding slave devices slave select signal “LOW”. The data out line (MISO) of all the slave devices when not selected floats at high impedance state The serial data transmission through SPI Bus is fully configurable. SPI devices contain certain set of registers for holding these configurations. 9 The Serial Peripheral Control Register holds the various configuration parameters like master/slave selection for the device, baud rate selection for communication, clock signal control etc. The status register holds the status of various conditions for transmission and reception. SPI works on the principle of “Shift Register‟. The master and slave devices contain a special shift register for the data to transmit or receive. The size of the shift register is device dependent. Normally it is a multiple of 8. During transmission from the master to slave, the data in the master’s shift register is shifted out to the MOSI pin and it enters the shift register of the slave device through the MOSI pin of the slave device. At the same time the shifted-o u t data bit from the slave device’s shift register enters the shift register of the master device through MISO pin 10 I2C V/S SPI: 1-Wire interface (protocol) 1- Wire is a device communications bus system designed by Dallas Semiconductor Corp. that provides low-speed data, signaling, and power over a single conductor. 1-Wire is similar in concept to I2C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments. 11 One distinctive feature of the bus is the possibility of using only two wires: data and ground. To accomplish this, 1-Wire devices include an 800 pF capacitor to store charge, and to power the device during periods when the data line is active. There is always one master in overall charge, which may be a PC or a microcontroller. The master initiates activity on the bus, simplifying the avoidance of collisions on the bus. Protocols are built into the software to detect collisions. After a collision, the master retries the required communication. Many devices can share the same bus. Each device on the bus has a unique 64-bit serial number. The least significant byte of the serial number is an 8-bit number that tells the type of the device. The most significant byte is a standard (for the 1-wire bus) 8-bit CRC. The master starts a transmission with a reset pulse, which pulls the wire to 0 volts for at least 480 µs. This resets every slave device on the bus. After that, any slave device, if present, shows that it exists with a "presence" pulse: it holds the bus low for at least 60 µs after the master releases the bus. To send a "1", the bus master sends a very brief (1– 15 µs) low pulse. To send a "0", the master sends a 60 µs low pulse. When receiving data, the master start sends a 1–15-µs 0-volt pulse to slave each bit. If the transmitting does unit wants to send a "1", it to the nothing, and the bus goes transmitting pulled-up voltage. If the "0", it pulls slave wants to send the data line to ground for 60 µs. 12 Parallel Communication: In data transmission, parallel communication is a method of conveying multiple binary digits (bits) simultaneously. It contrasts with communication. The communication channel is the number of electrical conductors used at the physical layer to convey bits. Parallel communication implies more than one such conductor. For example, an 8-bit parallel channel will convey eight bits (or a byte) simultaneously, whereas a serial channel would convey those same bits sequentially, one at a time. Parallel communication is and always has been widely used within integrated circuits, in peripheral buses, and in memory devices such as RAM. 2. Product level communication interface (External Communication Interface) The Product level communication interface‟ (External Communication Interface) is responsible for data transfer between the embedded system and other devices or modules. It is classified into two types 1. Wired communication interface 2. Wireless communication interface 13 1. Wired communication interface Wired communication interface is an interface used to transfer information over a wired network. It is classified into following types. 1. RS-232C/RS-422/RS 485 2. USB RS-232C RS-232 C (Recommended Standard number 232, revision C from the Electronic Industry Association) is a legacy, full duplex, wired, asynchronous serial communication interface RS-232 extends the UART communication signals for external data communication. UART uses the standard TTL/CMOS logic (Logic “High” corresponds to bit value 1 and Logic “LOW” corresponds to bit value 0) for bit transmission whereas RS232 use the EIA standard for bit transmission. As per EIA standard, a logic “0‟ is represented with voltage between +3 and +25V and a logic „1‟ is represented with voltage between -3 and -25V. In EIA standard, logic „0‟ is known as “Space” and logic “1” as “Mark”. 14 The RS232 interface define various handshaking and control signals for communication apart from the “Transmit‟ and “Receive” signal lines for data communication. RS-232 supports two different types of connectors, namely; DB-9: 9-Pin connector and DB-25: 25-Pin connector. Fig: DB-25:25-Pin connector. Fig: DB-9:9-Pin connector 15 RS-232 is a point-to-point communication interface and the devices involved in RS- 232 communication are called “Data Terminal Equipment (DTE)” and “Data Communication Equipment (DCE)”. If no data flow control is required, only TXD and RXD signal lines and ground line (GND) are required for data transmission and reception. The RXD pin of DCE should be connected to the TXD pin of DTE and vice versa for proper data transmission. If hardware data flow control is required for serial transmission, various control signal lines of the RS-232 connection are used appropriately. The control signals are implemented mainly for modem communication and some of them may be irrelevant for other type of devices. The Request to Send (RTS) and Clear To Send (CTS) signals co-ordinate the communication between DTE and DCE. Whenever the DTE has a data to send, it activates the RTS line and if the DCE is ready to accept the data, it activates the CTS line. The Data Terminal Ready (DTR) signal is activated by DTE when it is ready to accept data. The Data Set Ready (DSR) is activated by DCE when it is ready for establishing a communication link. DTR should be in the activated state before the activation of DSR.  The Data Carrier Detect (DCD) is used by the DCE to indicate the DTE that a good signal is being received 16 Ring Indicator (RI) is a modem specific signal line for indicating an incoming call on the telephone line. As per the EIA standard RS-232 C supports baud rates up to 20Kbps (Upper limit 19.2Kbps). The commonly used baud rates by devices are 300bps, 1200bps, 2400bps, 9600bps, 11.52Kbps and 19.2Kbps. The maximum operating distance supported in RS-232 communication is 50 feet at the highest supported baudrate. Embedded devices contain a UART for serial communication and they generate signal levels conforming to TTL/CMOS logic. A level translator IC like MAX 232 from Maxim Dallas semiconductor is used for converting the signal lines from the UART to RS-232 signal lines for communication. On the receiving side the received data is converted back to digital logic level by a converter IC. Converter chips contain converters for both transmitter and receiver. RS-232 uses single ended data transfer and supports only point-to-point communication and not suitable for multi-drop communication. USB (UNIVERSAL SERIAL BUS) External Bus Standard. Allows connection of peripheral devices. Connects Devices such as keyboards, mice, scanners, printers, joysticks, audio devices, disks. Facilitates t r a n s f e r s of data at 4 8 0 (USB 2. 0 only), 1 2 or 1.5 Mb/s (megabits/second). Developed by a Special Interest Group including Intel, Microsoft, Compact, DEC, IBM, Northern Telecom and NEC originally in 1994. 17 Low-Speed: 10 – 100 kb/s 1.5 Mb/s signaling bit rate Full-Speed: 500 kb/s – 10 Mb/s 12 Mb/s signaling bit rate High-Speed: 400 Mb/s 480 Mb/s signaling bit rate NRZI with bit stuffing used SYNC field present for every packet There exist two pre-defined connectors in any USB system - Series “A” and Series “B” Connectors. Series “A” cable: Connects USB devices to a hub port. Series “B” cable: Connects detachable devices (hot- swappable) Bus Topology Connects computer to peripheral devices. Ultimately intended to replace parallel and serial ports Tiered Star Topology All devices are linked to a common point referred to as the root hub. Specification allows for up to 127 (27 -1) different devices Four wire cable serves as interconnect of system - power, ground and two differential signaling lines. 18 USB is a polled bus-all transactions are initiated by host. USB HOST: Device that controls entire system usually a PC of some form. Processes data arriving to and from the USB port. USB HUB: Tests for new devices and maintains status information of child devices. Serve as repeaters, boosting strength of up and downstream signals. Electrically isolates devices from one another - allowing an expanded number of devices. 2. Wireless communication interface Wireless communication interface is an interface used to transmission of information over a distance without help of wires, cables or any other forms of electrical conductors. They are basically classified into following types 1. Infrared 2. Bluetooth 3. Wi-Fi 4. Zigbee 5. GPRS INFRARED Infrared is a certain region in the light spectrum Ranges from.7µ to 1000µ or.1mm Broken into near, mid, and far infrared One step up on the light spectrum from visible light Measure of heat 19 Most of the thermal radiation emitted by objects near room temperature is infrared. Infrared radiation is used in industrial, scientific, and medical applications. Night-vision devices using active near-infrared illumination allow people or animals to be observed without the observer being detected. IR transmission The transmitter of an IR LED inside its circuit, which emits infrared light for every electric pulse given to it. This pulse is generated as a button on the remote is pressed, thus completing the circuit, providing bias to the LED. The LED on being biased emits light of the wavelength of 940nm as a series of pulses, corresponding to the button pressed. However, since along with the IR LED many other sources of infrared light such as us human beings, light bulbs, sun, etc, the transmitted information can be interfered. A solution to this problem is by modulation. The transmitted signal is modulated using a carrier frequency of 38 KHz (or any other frequency between 36 to 46 KHz). The IR LED is made to oscillate 20 at this frequency for the time duration of the pulse. The information or the light signals are pulse width modulated and are contained in the 38 KHz frequency. IR supports data rates ranging from 9600bits/second to 16Mbps Serial infrared: 9600bps to 115.2 kbps Medium infrared: 0.576Mbps to 1.152 Mbps Fast infrared: 4Mbps BLUETOOTH Bluetooth is a wireless technology standard for short distances (using short-wavelength UHF band from 2.4 to 2.485 GHz)for exchanging data over radio waves in the ISM and mobile devices, and building personal area networks (PANs).Invented by telecom vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS- 232 data cables. Bluetooth uses a radio technology called frequency- hopping spread spectrum. Bluetooth divides transmitted data into packets, and transmits each packet on one of 79 designated Bluetooth channels. Each channel has a bandwidth of 1 MHz. It usually performs 800 hops per second, with Adaptive Frequency-Hopping (AFH) enabled. Originally, Gaussian frequency-shift keying (GFSK) modulation was the only modulation scheme available. Since the introduction of Bluetooth 2.0+EDR, π/4-DQPSK (Differential Quadrature Phase Shift Keying) and 8DPSK modulation may also be used between compatible devices. Bluetooth is a packet-based protocol with a master- slave structure. One master may communicate with up to seven slaves in a piconet. All devices share the master's clock. Packet exchange is based on the basic clock, defined by the master, which ticks at312.5 µs intervals. Originally, Gaussian frequency-shift keying (GFSK) modulation was the only modulation scheme available. Since the introduction of Bluetooth 2.0+EDR, π/4-DQPSK (Differential 21 Quadrature Phase Shift Keying) and 8DPSK modulation may also be used between compatible devices. Bluetooth is a packet-based protocol with a master- slave structure. One master may communicate with up to seven slaves in a piconet. All devices share the master's clock. Packet exchange is based on the basic clock, defined by the master, which ticks at312.5 µs intervals. Wi-Fi Wi-Fi is the name of a popular wireless networking technology that uses radio waves to provide wireless high-speed Internet and network connections Wi-Fi follows the IEEE 802.11 standard Wi-Fi is intended for network communication and it supports Internet Protocol (IP) based communication Wi-Fi based communications require an intermediate agent called Wi-Fi router/Wireless Access point to manage the communications. The Wi-Fi router is responsible for restricting the access to a network, assigning IP address to devices on the network, routing data packets to the intended devices on the network. 22 Wi-Fi enabled devices contain a wireless adaptor for transmitting and receiving data in the form of radio signals through an antenna. Wi-Fi operates at 2.4GHZ or 5GHZ of radio spectrum and they co-exist with other ISM band devices like Bluetooth. A Wi-Fi network is identified with a Service Set Identifier (SSID). A Wi-Fi device can connect to a network by selecting the SSID of the network and by providing the credentials if the network is security enabled Wi-Fi networks implements different security mechanisms for authentication and data transfer. Wireless Equivalency Protocol (WEP), Wireless Protected Access (WPA) etc are some of the security mechanisms supported by Wi-Fi networks in data communication. ZIGBEE Zigbee is an IEEE 802.15.4-based specification for a suite of high- level communication protocols used to create personal area networks with small, low-power digital radios, such as for home automation, medical device data collection, and other low-power low- bandwidth needs, designed for small scale projects which need wireless connection. Hence, zigbee is a low-power, low data rate, and close proximity (i.e., personal area) wireless ad hoc network. The technology defined by the zigbee specification is intended to be simpler and less expensive than other wireless personal area networks (WPANs), such as Bluetooth or Wi-Fi. Applications include wireless light switches, electrical meters with in-home-displays, traffic management systems, and other consumer and industrial equipment that require short-range low- rate wireless data transfer. Its low power consumption limits transmission distances to 10– 100 meters line-of-sight, depending on power output and environmental characteristics. Zigbee devices can transmit data over long distances by passing data through a mesh network of intermediate devices to reach more distant ones. 23 Zigbee Coordinator: The zigbee coordinator acts as the root of the zigbee network. The ZC is responsible for initiating the Zigbee network and it has the capability to store information about the network. Zigbee Router: Responsible for passing information from device to another device or to another ZR. Zigbee end device: End device containing zigbee functionality for data communication. It can talk only with a ZR or ZC and doesn’t have the capability to act as a mediator for transferring data from one device to another. Zigbee supports an operating distance of up to 100 metres at a data rate of 20 to 250 Kbps. General Packet Radio Service (GPRS) General Packet Radio Service (GPRS) is a packet oriented mobile data service on the 2G and 3G cellular communication system's global system for mobile communications (GSM).GPRS was originally standardized by European Telecommunications Standards Institute (ETSI) GPRS usage is typically charged based on volume of data transferred, contrasting with circuit switched data, which is usually billed per minute of connection time. Sometimes billing time is broken down to every third of a minute. Usage above the bundle cap is charged per megabyte, speed limited, or disallowed. 24 Services offered: GPRS extends the GSM Packet circuit switched data capabilities and makes the following services possible: SMS messaging and broadcasting "Always on" internet access Multimedia messaging service (MMS) Push-to-talk over cellular (PoC) Instant messaging and presence-wireless village Internet applications for smart devices through wireless application protocol (WAP). Point-to-point (P2P) service: inter-networking with the Internet (IP). Point-to-multipoint (P2M) service]: point-to- multipoint multicast and point-to- multipoint group calls. Reference: Shibu K.V. (2009). Introduction to Embedded Systems. India: McGraw Hill Education Basic Software Techniques for Embedded Applications What Is an Embedded System? An embedded system is a combination of computer hardware and software. It is designed to perform a dedicated function. An embedded system is a component within some larger system. What Is an Embedded System? It is important to point out that a general- purpose computer interfaces to numerous embedded systems. In some cases, it would even be possible to build a functionally equivalent device that does not contain the processor and software. Real-Time Systems A real-time system has timing constraints. The function of a real-time system is thus partly specified in terms of its ability to make certain calculations or decisions in a timely manner. These important calculations or activities have deadlines for completion. Real-Time Systems Real-Time Systems Real-time system design is not simply about speed. Deadlines for real-time systems vary; one deadline might be in a millisecond, while another is an hour away. Common System Components Processor Software Memory RAM ROM Inputs and Outputs Generic Embedded System High-level diagrams Basic embedded A more complex software diagram embedded software diagram Requirements That Affect Design Choices Each embedded system must meet a completely different set of requirements, any or all of which can affect the compromises and trade-offs made during the development of the product. Requirements That Affect Design Choices Processing power The workload that the main chip can handle. A common way to compare processing power is the millions of instructions per second (MIPS) rating. Requirements That Affect Design Choices Memory The amount of memory (ROM and RAM) required to hold the executable software and the data it manipulates. Requirements That Affect Design Choices Number of units The expected production run. Requirements That Affect Design Choices Power Consumption The amount of power used during operation. A common metric used to compare the power requirements of portable devices is mW/MIPS (milliwatts per MIPS) Requirements That Affect Design Choices Development cost The cost of the hardware and software design processes, known as nonrecurring engineering (NRE). Requirements That Affect Design Choices Lifetime How long the product is expected to stay in use. Requirements That Affect Design Choices Reliability How reliable the final product must be. Life As an Embedded Software Developer Hardware knowledge The embedded software developer must become intimately familiar with the integrated circuits, the boards and buses, and the attached devices used in order to write solid embedded software (firmware). Life as an Embedded Software Developer Efficient code Embedded systems are typically designed with the least powerful and most cost-effective processor that meets the performance requirements of the system, embedded software developers must make every line of code count. Life as an Embedded Software Developer Peripheral interfaces Embedded developers need to know how to communicate with the different devices or peripherals in order to have full control of the devices in the system. Life as an Embedded Software Developer Robust code There are expectations that embedded systems will run for years in most cases. Life as an Embedded Software Developer Minimal resources An embedded software developer must closely manage resources, from memory to processing power, so that the system operates up to specification and so failures don’t occur. Life as an Embedded Software Developer Reusable software Code portability or code reuse—writing software so that it can be moved from hardware platform to hardware platform—is very useful to aid transition to new projects. Life as an Embedded Software Developer Development tools The tools you will use throughout your career as an embedded developer will vary from company to company and often from project to project Embedded systems basics It may be asked what is an embedded system. With many processor-based systems and computers it is useful to define what an embedded system is. A convenient definition for an embedded system is: An embedded system is any computer system contained within a product that is not described as a computer. Using this embedded system definition, it is possible to understand the various basic characteristics one. Typically, they are: Embedded systems are designed for a specific task. Although they use computer techniques, they cannot be used as a general-purpose computer using a variety of different programs for different task. In this way their function can be focused onto what they need to do, and they can accordingly be made cheaper and more efficiently. The software for embedded systems is normally referred to as firmware. Rather than being stored on a disc, where many programs can be stored, the single program for an embedded system is normally stored on chip and it is referred to as firmware. Embedded systems contain two main elements: Embedded system hardware: As with any electronic system, an embedded system requires a hardware platform on which to run. The hardware will be based around a microprocessor or microcontroller. The embedded system hardware will also contain other elements including memory, input output (I/O) interfaces as well as the user interface, and the display. Embedded system software: The embedded system software is written to perform a particular function. It is typically written in a high-level format and then compiled down to provide code that can be lodged within a non-volatile memory within the hardware. Embedded systems hardware When using an embedded system there is a choice between the use of a microcontroller or a microprocessor. Microcontroller based systems: A microcontroller is essentially a CPU, central processor unit, or processor with integrated memory or peripheral devices. As fewer external components are needed, embedded system using microcontrollers tend to be more widely used Microprocessor based systems: Microprocessors contain a CPU but use external chips for memory and peripheral interfaces. As they require more devices on the board, but they allow more expansion and selection of exact peripherals, etc., this approach tends to be used for the larger embedded systems. Whatever type of processor is used in the embedded system, it may be a very general-purpose type of one of the many highly specialized processors intended for a particular application. In some cases, custom designed chips may be viable for a particular application if quantities are sufficiently high. One common example of a standard class of dedicated processor is the digital signal processor, DSP. This type of processor is used for processing audio and image files in particular. Processing is required very quickly as they may be used in applications such as mobile phones and the like. Embedded systems software One of the key elements of any embedded system is the software that is used to run the microcontroller. There is a variety of ways that this can be written: Machine code: Machine code is the most basic code that is used for the processor unit. The code is normally in hex code and provides the basic instructions for each operation of the processor. This form of code is rarely used for embedded systems these days. Programming language: Writing machine code is very laborious and time consuming. It is difficult to understand and debug. To overcome this, high level programming languages are often used. Languages including C, C++, etc. are commonly used. The code for the embedded system will typically be stored on a form of non-volatile memory held on the processor board. The code is called firmware - the idea is that it is not updated in the same way that software is, being held in the embedded system and it cannot be changed by the user. Often it is possible to update the software, but this can mean changing the memory card on which the firmware is held, or by updating it in another way. Often additional tools may be used to help with the development of the firmware. Often programs can become complicated and it is necessary to ensure the firm ware for the embedded system operates correctly. Embedded systems design tools Many embedded systems are complicated and require large levels of software for them to operate. Developing this software can be timing consuming, and it has to be very accurate for the embedded system to operate correctly. Coding in embedded systems is one of the main areas where faults occur. To help simplify the process, software development tools are normally used. These help the software developer to program more quickly, and also more accurately. Types of Embedded Software Development Tools The following is the list of the types of embedded software development tools with their description. Editor A text editor is the first tool you need to begin creating an embedded system. It is used to write source code in programming languages C and C++ and save this code as a text file. A good example of a text editor is Geany. This is a small and lightweight environment that uses the GTK+ toolkit. Geany supports C, Java, PHP, HTML, Python, Perl, Pascal and other types of files. Basic functions of Geany: Syntax highlighting Code folding Symbol name auto-completion Snippets Auto-closing of XML and HTML tags Code navigation Compiler Source code is written in a high-level programming language. A compiler is a tool for transforming the code into a low-level machine language code — the one that a machine can understand. Keil C51 is a popular compiler that creates apps for 8051 microcontrollers and translates source code written in the C language. Assembler The function of this tool is to convert a human-written code into a machine language. In comparison with a compiler, which can do so directly, an assembler initially converts source code into object code, and then to a machine language. GNU Assembler (GAS) is widely used for Linux operating systems and can be found in the Macintosh tools package. Debugger This is a critical tool for testing. It goes through the code and eliminates bugs and errors, notifying places where they occur. Precisely, debuggers pinpoint the lines where issues are found, so programmers can address them quickly. A good debugger tool is IDA Pro that works on Linux, Windows and Mac OS X operating systems. It has both free and commercial versions and is highly popular among developers. Linker Traditionally, code is written into small pieces and modules. A linker is a tool that combines all these pieces together, creating a single executable program. GNU ld is one of the linker tools. Emulator An emulator is a replication of the target system with identical functionality and components. This tool is needed to simulate software performance and to see how the code will work in the real-time environment. Using emulators, programmers can change values in order to reach the ideal performance of the code. Once the code is fully checked, it can be embedded in the device. Integrated Development Environment (IDE) Talking about the list of embedded software development tools, we cannot but mention integrated development environments. All the above-mentioned tools are needed for creating your embedded software. But it would be extremely inconvenient to use them separately, adding another layer of complexity to the project. Hence, to simplify the development process, it is highly recommended to use integrated environments. IDE is software that provides a set of necessary tools in one package. Embedded Software Development Tools List For your information and convenience, we have compiled an embedded software development tools list, gathering the most popular solutions in the market. 1. PyCharm A Czech company JetBrains created this IDE specifically for developers working with Python. Nevertheless, PyCharm is suitable for cross-platform development as it supports JavaScript, CoffeeScript, TypeScript, Cython, SQL, HTML/CSS, AngularJS, Node.js, template languages, and more, together with Windows, macOS and Linux operating systems. PyCharm provides everything you need for productive embedded software development: Intelligent code completion Error highlighting and fixing Automated code refactoring Easy project navigation Support for web development frameworks such as Django, Flask, Google App Engine, Pyramid, and web2py Integrated testing Remote development on virtual machines PyCharm offers the community, professional and educational editions, proving to be a perfect tool for various programming purposes. 2. WebStorm Another IDE from JetBrains is WebStorm, used for creating JavaScript, CSS and HTML solutions. WebStorm performs autocompletion, on-the-fly code analysis, code navigation, refactoring, debugging and integration with version control systems. It also supports multiple nesting e.g. when a JS script is embedded in an HTML document, in which another HTML code is embedded, inside which JavaScript is embedded. The organization of information in these layers provides correct refactoring. 3. Qt Creator Qt integrated development environment has a comprehensive set of libraries, APIs and tools to create software for embedded devices in C++, JavaScript and QML. Features: Cross-compiling Autocompletion Syntax highlighting Virtual keyboard On-device debugging Functional safety 3D/2D user interfaces The leading embedded systems manufacturers across more than 70 industries, including automotive, automation, medical, TV and STB, Internet of Things, mobile apps and more, choose Qt Creator to build their products. 4. MPLAB X MPLAB X is the latest version of an integrated development environment MPLAB created by Microchip Technology company. The software is based on the open-source NetBeans platform and is designed to create applications for various types of PIC microcontrollers and digital signal controllers. The software runs on a personal computer and includes cross-platform support for Windows, Mac OS and Linux. MPLAB X allows project managing, code writing, editing and debugging. A host of previously requested features have been added to this version of the IDE, including C/C++ compilers, macros, third-party tools, complex breakpoints and added support for PIC, dsPIC, AVR, CEC and SAM microcontrollers. The main advantages that may sway you in the direction of choosing this IDE are: Ease of use — you can easily customize the front panel and put frequently used tools there Auto-completion — this feature is used to complete known header files automatically, without having to type them in Mark occurrences — if you highlight any variable with the cursor, all the instances of this variable in the file are shown, which is extremely helpful in debugging Live syntax checker — this feature is able to detect common errors, reducing the total number of errors at the end of the compilation Dashboard window — contains useful information on the project properties 5. Visual Studio A popular integrated development environment by Microsoft — Visual Studio — is used to build not only computer programs and mobile apps, but embedded software as well. The extension Visual C++ for IoT development enables programmers to debug native C/C++ code either locally on Windows, or on microcontrollers, or on remote Linux machines. Using Visual Studio for IoT, you can build, edit and debug devices running on Linux. VisualGDB provides an interface between Visual Studio and the GNU toolchain to build and debug embedded firmware. Thus, you can configure your project by implementing third-party compilers and tools. 6. Eclipse Initially, the Eclipse integrated development environment was created for Java applications, and now it is the most widely used solution by Java programmers. Nevertheless, Eclipse can work with other programming languages (Ada, ABAP, C, C++, C#, Python, PHP, etc.) via plug-ins. A separate package — Eclipse IDE for Automotive Software Developers — contains tools and frameworks for quick and easy creation of embedded automotive software. 7. NetBeans A free and open-source IDE for Java 8 development, NetBeans is supported by a large community of developers and users. It also encompasses PHP and C/C++ tools and allows for creating apps with CSS, JavaScript and HTML. Basic NetBeans features: Fast and smart code editing Easy and efficient project management Rapid UI development Debugging Support for multiple languages Cross-platform support Rich set of plugins 8. MATLAB MATLAB is a package of tools and a programming language designed for numerical computing. Developers in different areas use MATLAB to create user interfaces, implement algorithms, work with data plots, functions, matrices, graphs, etc. This environment enables interfacing with programs written in C, C++, C#, Java, Python and other languages. Additional software Simulink that comes with MATLAB is used to create simulations. The combination of MATLAB and Simulink is useful for embedded software developers, as it allows them to design and code an embedded system from prototyping to production. The advantages are: Robust and easy-to-use debugging tools Rich and efficient library of mathematical and statistical functions A solid user community Well-developed literature on all tools 9. Arduino The open-source IDE Arduino helps create programs for Arduino microcontrollers. It provides a range of features and libraries that make the life of embedded programmers easier. The main advantages are: Ready-to-use boards with all needed components Libraries with examples of codes Open-source and extensible hardware and software Cross-platform support for Windows, Mac OS and Linux Access to a large community Easy to learn and use 10. ARM Keil ARM Keil development tools provide a complete environment for creating embedded applications for the widest range of ARM-based devices. The software package includes leading C/C++ compilers, simulation models, debuggers, linkers, assemblers, middleware libraries. In addition, ARM Keil offers evaluation boards for the most popular devices based on Cortex and ARM processors. Advantages: Easy to learn and use Intuitive interface Integration with third-party tools Code templates Example projects Technical support by ARM experts Suitable both for professionals and beginners There is no way to say which tool you should choose for creating embedded software, since their number is enormous. We may say that it all depends on the programmer’s skills and preferences, as well as on the project needs. In any case, all the above- mentioned tools help accelerate the development of embedded software. CPPC 22 Embedded Systems Topic 5: Parallel Input and Output Topic 5 – Parallel Input and Output I/O Devices 1. I/O Devices - Light Emitting Diode (LED) Light Emitting Diode (LED) is an output device for visual indication in any embedded system. LED can be used as an indicator for the status of various signals or situations. Typical examples are indicating the presence of power conditions GND like “Device ON”, “Battery low” or “Charging of battery” for a battery operated handheld embedded devices LED is a p-n junction diode and it contains an anode and a cathode. For proper functioning of the LED, the anode of it should be connected to +ve terminal of the supply voltage and cathode to the –ve terminal of supply voltage The current flowing through the LED must limited to a value below the maximum current that it can conduct. A resistor is used in series between the power supply and the resistor to limit the current through the LED 2. I/O Devices – 7-Segment LED Display The 7 – segment LED display is an output device for displaying alpha numeric characters It contains 8 light-emitting diode (LED) segments arranged in a special form. Out of the 8 LED segments, 7 are used for displaying alpha numeric characters The LED segments are named A to G and the decimal point LED segment is named as DP CPPC 22 Embedded Systems Topic 5: Parallel Input and Output The LED Segments A to G and DP should be lit accordingly to display numbers and characters The 7 – segment LED displays are available in two different configurations, namely; Common anode and Common cathode In the Common anode configuration, the anodes of the 8 segments are connected commonly whereas in the Common cathode configuration, the 8 LED segments share a common cathode line Based on the configuration of the 7 – segment LED unit, the LED segment anode or cathode is connected to the Port of the processor/controller in the order „A‟ segment to the Least significant port Pin and DP segment to the most significant Port Pin. The current flow through each of the LED segments should be limited to the maximum value supported by the LED display unit The typical value for the current falls within the range of 20mA The current through each segment can be limited by connecting a current limiting resistor to the anode or cathode of each segment CPPC 22 Embedded Systems Topic 5: Parallel Input and Output 3. I/O Devices – Optocoupler Optocoupler is a solid-state device to isolate two parts of a circuit. Optocoupler combines an LED and a photo-transistor in a single housing (package) In electronic circuits, optocoupler is used for suppressing interference in data communication, circuit isolation, High voltage separation, simultaneous separation and intensification signal etc Optocoupler in input and output circuit Optocouplers can be used in either input circuits or in output circuits 4. I/O Devices – Stepper Motor Stepper motor is an electro mechanical device which generates discrete displacement (motion) in response to dc electrical signals It differs from the normal dc motor in its operation. The dc motor produces continuous rotation on applying dc voltage whereas a stepper motor produces discrete rotation in response to the dc voltage applied to it Stepper motors are widely used in industrial embedded applications, consumer electronic products and robotics control systems The paper feed mechanism of a printer/fax makes use of stepper motors for its functioning. CPPC 22 Embedded Systems Topic 5: Parallel Input and Output Based on the coil winding arrangements, a two-phase stepper motor is classified into ✓ Unipolar ✓ Bipolar ❖ Unipolar: A unipolar stepper motor contains two windings per phase. The direction of rotation (clockwise or anticlockwise) of a stepper motor is controlled by changing the direction of current flow. Current in one direction flows through one coil and in the opposite direction flows through the other coil. It is easy to shift the direction of rotation by just switching the terminals to which the coils are connected ❖ Bipolar: A bipolar stepper motor contains single winding per phase. For reversing the motor rotation, the current flow through the windings is reversed dynamically. It requires complex circuitry for current flow reversal 5. The I/O Subsystem – I/O Devices – Relay An electro mechanical device which acts as dynamic path selectors for signals and power. The “Relay” unit contains a relay coil made up of insulated wire on a metal core and a metal armature with one or more contacts. “Relay” works on electromagnetic principle. When a voltage is applied to the relay coil, current flows through the coil, which in turn generates a magnetic field. The magnetic field attracts the armature core and moves the contact point. The movement of the contact point changes the power/signal flow path. CPPC 22 Embedded Systems Topic 5: Parallel Input and Output The Relay is normally controlled using a relay driver circuit connected to the port pin of the processor/controller A transistor can be used as the relay driver. The transistor can be selected depending on the relay driving curren

Use Quizgecko on...
Browser
Browser