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

CPE412-ES-Module 3 - Basic Software Techniques for Embedded Applications.pdf

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

Transcript

CPE412 Embedded Systems Module No. 3 Topic Basic Software Techniques for Embedded Applications Period Week no. __4__ : Date __September 2-7, 2024__ BASIC SOFTWARE TECHNIQUES FOR EMBEDDED APPL...

CPE412 Embedded Systems Module No. 3 Topic Basic Software Techniques for Embedded Applications Period Week no. __4__ : Date __September 2-7, 2024__ BASIC SOFTWARE TECHNIQUES FOR EMBEDDED APPLICATIONS What is Embedded Software? Role of Embedded Software Embedded Software Development Process Common Programming Languages in Embedded Systems Objective/Intended Learning Outcomes Define embedded software and its role in controlling and managing hardware in embedded systems. Explain the phases of the embedded software development process. Discuss programming languages commonly used in embedded systems development. Discussion/Content 3. BASIC SOFTWARE TECHNIQUES FOR EMBEDDED APPLICATIONS INTRODUCTION Each processor is associated with embedded software. Embedded programming plays a major role in performing specific functions by the processor. In our day-to-day life, we frequently use many electronic devices such as washing machines, mobile phones, digital camera and so on which work based on microcontrollers that are programmed by an embedded programming language. However, existence of the processor and software in an embedded system may be unnoticed by a user of the device. In some cases, it would even be possible to build a functionally equivalent device that does not contain the processor and software. This could be done by replacing the processor-software combination with a custom integrated circuit (IC) that performs the same functions in hardware. But then again, the processor and software combination typically offer more flexibility than a hardwired design. It is generally much easier, cheaper, and less power intensive to use a processor and software in an embedded system. In this lesson, we will be tackling about embedded software and its role in controlling and managing hardware in embedded systems. This will also discuss about embedded software development process, and the various programming languages commonly used in embedded systems development. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 1 WHAT IS EMBEDDED SOFTWARE? Embedded software is a piece of software that is embedded in hardware or non-PC devices. It is written to perform a particular function and 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. It is also written specifically for the particular hardware that it runs on and usually has processing and memory constraints because of the device’s limited computing capabilities. Examples of embedded software include those found in dedicated GPS devices, factory robots, some calculators, and even modern smartwatches. Embedded software is similar to firmware, as they usually serve the same function. The latter, however, is a special type of embedded software that is written in non-volatile memory (such as ROM or EPROM), which cannot easily be modified — hence the name "firm" — and is used primarily for running or booting up the device. In contrast, embedded software is used for the overall operation of the device. Embedded software can be very simple, such as that used for controlling lighting in homes, and can run on an 8-bit microcontroller with just a few kilobytes of memory, or it can be quite complex such as the software running all of the electronic components of a modern smart car, complete with climate controls, automatic cruising and collision sensing, as well as control navigations. Complex embedded software can also be found in aircraft avionics systems, in very complex fly-by-wire systems used in fighter planes and even in missile guidance systems. The main difference between embedded software and application software is that the former is usually tied to a specific device, serving as the OS itself, with restrictions tied to that device’s specifications, so updates and additions are strictly controlled, whereas application software provides the functionality in a computer and runs on top of an actual full OS, so it has fewer restrictions in terms of resources. 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 software applications are specialized programming within non-PC devices – either as part of a microchip or as part of another application that sits on top of the chip – to control specific functions of the device. Unlike PC applications, which can be installed on a variety of computer systems and modified to provide different levels of functionality, embedded software has fixed hardware requirements and capabilities. It is created exclusively for the particular device that it runs on, with processing and memory restrictions tied directly to that device’s specifications. In the context of this discussion, embedded software includes applications, firmware, middleware, and operating systems that execute on a single microprocessor or cluster of microprocessors “embedded” within additional logic. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 2 Different types of embedded software and their purposes Operating System – An operating system (OS), in its most general sense, is software that allows a user to run other applications on a computing device. The operating system manages a processor’s hardware resources including input devices such as a keyboard and mouse, output devices such as displays or printers, network connections, and storage devices such as hard drives and memory. The OS also provides services to facilitate the efficient execution and management of, and memory allocations for software application programs. Firmware – Firmware is a type of software that is written directly for a piece of hardware. It operates without going through APIs, the operating system, or device drivers—providing the needed instructions and guidance for the device to communicate with other devices or perform a set of basic tasks and functions as intended. Middleware – Middleware is a software layer situated between applications and operating systems. Middleware is often used in distributed systems where it simplifies software development by providing the following: o Hiding the intricacies of distributed applications o Masking the heterogeneity of hardware, operating systems and protocols o Providing uniform and high-level interfaces used to make interoperable, reusable and portable applications. o Delivering a set of common services that minimizes duplication of efforts and enhances collaboration between applications Application – The end-user develops the final software application that runs on the operating system, uses or interacts with the middleware and firmware, and is the primary focus of the embedded systems’ target function. Each end application is unique while operating systems and firmware can be identical from device to device. Examples of embedded software-based functions Almost every device made with circuit boards and computer chips has these components arranged into a system that runs embedded software. As a result, embedded software systems are ubiquitous in everyday life and are found throughout consumer, industrial, automotive, aerospace, medical, commercial, telecom, and military technology. Common examples of embedded software-based features include: Image processing systems found in medical imaging equipment Fly-by-wire control systems found in aircraft Motion detection systems in security cameras Traffic control systems found in traffic lights Timing and automation systems found in smart home devices Embedded Software vs Embedded Systems The hardware components within a device that are running embedded software are referred to as an "embedded system." Some examples of hardware components used in embedded systems are power supply circuits, central processing units, flash memory devices, timers, and serial communication ports. During a device's early design phases, the hardware that will make up the embedded system – and its configuration within the device – is decided. Then, embedded software is developed from scratch to run exclusively on that hardware in that precise configuration. This makes embedded software design a very specialized field that requires deep knowledge of hardware capabilities and computer programming. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 3 ROLE OF EMBEDDED SOFTWARE Embedded software plays a crucial role in controlling and managing hardware in embedded systems. Embedded systems are specialized computing systems designed to perform specific tasks or functions within a larger system, and they often consist of a combination of hardware and software components. Here are the key roles of embedded software in controlling and managing hardware in embedded systems: 1. Hardware Abstraction – Embedded software provides a layer of abstraction between the hardware and higher-level software applications. It hides the low-level hardware details, allowing developers to write software that is independent of the specific hardware components. This abstraction simplifies software development and makes it more portable across different hardware platforms. 2. Device Drivers – Embedded software includes device drivers that facilitate communication between the higher-level software and hardware peripherals such as sensors, actuators, displays, and communication interfaces (e.g., UART, SPI, I2C). These drivers provide a standardized interface for controlling and accessing hardware, making it easier to interact with the hardware components. 3. Real-time Control – Many embedded systems require real-time responsiveness to external events or inputs. Embedded software is responsible for implementing real-time control algorithms that monitor inputs, make decisions, and control hardware in a timely manner. This is essential in applications like automotive systems, industrial automation, and robotics. 4. System Initialization – Embedded software initializes the hardware components during system startup. This includes configuring registers, setting up clock sources, and initializing memory spaces. Proper initialization is crucial for the stable and reliable operation of embedded systems. 5. Power Management – Embedded systems often run on limited power sources, such as batteries. Embedded software can control power modes and optimize power consumption by turning off or reducing the power to certain hardware components when they are not in use. This is important for extending the battery life of portable devices. 6. Fault Handling and Recovery – Embedded software is responsible for detecting and handling hardware faults and errors. It can implement mechanisms for error recovery, such as resetting a component, switching to redundant hardware, or triggering alarms and diagnostics. 7. Communication Protocols – Embedded systems often need to communicate with other devices or systems. Embedded software manages communication protocols and data exchange between the embedded system and external entities, including other embedded systems, computers, or the internet. 8. Sensor Fusion and Data Processing – In applications involving multiple sensors (e.g., in autonomous vehicles or IoT devices), embedded software processes data from various sensors, performs sensor fusion, and extracts meaningful information. This involves complex algorithms to filter, combine, and interpret sensor data. 9. Security and Encryption – Embedded systems are susceptible to security threats. Embedded software can implement security measures such as encryption, authentication, and access control to protect sensitive data and prevent unauthorized access to the hardware. 10. User Interface – For embedded systems with user interfaces (e.g., touchscreens or LEDs), embedded software controls the display and interacts with user inputs, providing a means for users to interact with and control the device. Embedded software plays a vital role in controlling and managing hardware in embedded systems by providing abstraction, interfacing, control logic, and functionality needed to make the hardware perform specific tasks efficiently and reliably. It is a fundamental component that bridges the gap between the hardware and the intended functionality of the embedded system. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 4 EMBEDDED SOFTWARE DEVELOPMENT PROCESS Embedded software plays a pivotal role in driving digital transformation across different industries. It enables the development of intelligent and interconnected devices that profoundly impact our daily lives. Embedded software systems are the main components of modern devices, as they are ideally customized to control and manage specific functions. Unlike other software solutions, embedded software is integrated with the hardware, ensuring reliability and optimal performance. By leveraging the power of embedded software, devices, and systems can operate seamlessly. Embedded systems operate through software-hardware interaction. The software instructs the hardware components on processing data, performing calculations, and communicating with other devices. This is achieved through specialized printed-circuit boards, which program the hardware to carry out specific tasks. As a result, embedded systems can perform their functions in real-time and provide users with the required output. Embedded software systems are designed to work within the device hardware, enabling autonomous task performance. Embedded software engineering is the one responsible for all features of developments that surround us. Integration software engineering with non-computer devices leads to the creation of an embedded system. These systems are mostly used in such areas as medicine, electronics, manufacture, aviation, banking, office, security, etc. An embedded system needs a wide range of programming tools and operating systems. There are several most popular areas where embedded systems are used: Audio, including DSP Graphics and video Motor control Wireless connectivity (Bluetooth, Wi-fi, Zigbee) Wired connectivity (USB, Ethernet, CAN, LIN) Mass storage Embedded Software Development Tools The embedded systems are constructed and improvised with the help of certain tools. Embedded software or program which is loaded in the microcontroller takes care of all the executing operations. The typical microcontrollers firmware cycle involves— Writing the code with the help of an editor. Translating the code. Debugging the code with the help of debugging tools. Programming a Flash or OTP version of the microcontroller to build up a functional prototype of the system. Figure 1. Services can be performed by various tools. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 5 For developing this software, a number of tools are operated. Embedded software as any development needs development tools for future production. Here is a shortlist of several types of embedded software development tools: Editor The first and key tool for embedded system development you need is a text editor. It is the place for writing the code for embedded systems. An important point to note is that the code cannot be processed or executed in this area. The code which is written in the editor can also be referred to as the source code. The code can be written in any of the programming languages. Most commonly used languages are C and C++ and then save it as a text file. A bright example of a programming text editor is Geany. It supports C, JS. PHP, HTML. Python and many other types. The main features of this text editor is it highlights the syntax, automatically completes a symbol name and closes XML and HTML tags and has got code folding and navigation. Compiler Compiler is the second main feature. As the source code is written in a certain complicated programming language, this tool transforms the code into a simpler machine language code to make the machine understand it accurately. It is a tool that converts the source code or program from high- level programming language to a low-level programming language. The function of a compiler is to convert source code into object code. The object code is in low-level language and so it can be easily read by the computer. A compiler performs operations such as parsing, code generation, and optimization, and semantic analysis. The compiler is of many kinds. It includes a cross-compiler, decompiler, and language converter. Figure 2. Compiling process Cross-compiler If a compiler can be able to run a code in a computer or operating system, that has been generated in a different operating system is known as a cross-compiler. A cross-compiler is necessary to compile the code for multiple platforms from one development host. The source-to-source compilers differ from cross compilers. The source-to-source translates the text code from one programming language to another. But the cross-compilers are meant for cross-platform software development in the machine code. Example: IOS to Android. Uses: o The fundamental use of cross-compilers is to separate the build-in environment from the target environment. o To perform a compiling operation for multiple machines. An organization may wish to support different versions of an operating system and by using a cross-compiler, a single build- in environment can be created to compile all these targets. o It can also be used to perform the compiling operation on a server farm. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 6 Decompiler The term decompiler is commonly applied to a program that translates the executable program into source code in a high-level language which, when compiled shows the same behavior as the original executable program. Therefore, it is the opposite of the compiler. Decompilers remain an important tool in the reverse engineering of the computer software. Examples: JAD decompiler is for JAVA programming language. Uses: o De-compilers are very much useful in error correction, computer security, and interoperability. o It can also be used in the process of recovering the lost source data. o They are employed to re-create source code from binary executables. o It helps the beginners to understand the code and the concept behind it in a much easier way. Language converter A language converter is a compiler that converts the code between different high-level languages. It can also be called in different names such as source to source translator, transcompiler, a transpiler. These kinds of compilers convert between programming languages that operate at the same level of abstraction. Examples of certain assembly language translators include Intel CONV86, SCP TRANS86, Digital Research XLT86. Uses: o It can perform a translation of code from Python to Javascript. o These compilers also help in the translating of legacy code to use the next version of the respective programming language. o It can also perform automatic code refactoring. It is nothing but, we can refactor the programs that are outside the control of the original implementer. Assembler Assembler is a crucial tool that transforms human-written code into a language clear for machines. It is a more complex process that a compiler does. It converts the code into object code and then into machine language. This tool is actively used for Linux and Mac operating systems. An assembler is a unit that takes the basic computer instructions as input and converts them into a pattern of bits that can be used by the computer's processor to perform certain functions. It functions based on its own assembly language that uses a mnemonic to represent an opcode. It can create object code by resolving symbolic names to memory locations. There are two types of assemblers based on the number of passes through the source code are required. o One-pass assemblers: It goes through the source code once. Any symbol defined before will require errata at the end of the object code. o Multi-pass assemblers: In the first pass, it can create a table with all symbols and their values. In the later passes, the table can be used to generate code. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 7 Debugger When talking about software development, this process cannot be done with the quality assurance of the product. A debugger is a testing tool that finds and deletes bugs and errors inside the code. Also, it shows the places where errors were found for a quick rewriting by developers and eliminating future mistakes. As for example, IDA Pro is a testing tool that is widely used for popular operating systems like Windows, Linux, and Mac. Debugging is a process of finding and eliminating the number of errors in a computer program or in electronic hardware for its better performance. If a system is tightly packed, the process of debugging becomes difficult as the bug may get inherited to adjacent subsystems. The debugging tools used in the embedded systems greatly differ in terms of their development time and debugging features. Simulators The simulator represents a microcontroller by simulating the source code on a host computer. In each step of execution, it denotes the status of RAM and simulated ports of the target system. They also help in synchronizing delays and internal peripherals. A simulator can perform the following operations: o It helps in synchronizing the delays and internal peripherals. o Simulators monitor every part of the information in the source code with symbolic arguments and labels. o In each step of execution, they provide the status of RAM and also the simulated ports of the target system. o It helps us to explore more about the processors and also various versions of the target system, o Simulators can also support conditional and unconditional breakpoints. o They can trace the output of the contents of the program counter. Linker The linking tool creates the whole picture of the code. As the code is written and parted into smaller pieces and modules, all of those pieces have to be gathered and combined in the final result. That’s how the program is creating. All of the object files resulting from step one must be combined in a special way before the program can be executed. The object files themselves are individually incomplete, most notably in that some of the internal variable and function references have not yet been resolved. The job of the linker is to combine these object files and, in the process, to resolve all of the unresolved symbols. The output of the linker is a new object file that contains all of the code and data from the input object files and is in the same object file format. It does this by merging the text, data, and bss (block starting symbol) sections of the input files. So, when the linker is finished executing, all of the machine language code from all of the input object files will be in the text section of the new file, and all of the initialized and uninitialized variables will reside in the Figure 3. Linking process new data and bss sections, respectively. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 8 Locator The tool that performs the conversion from relocatable program to executable binary image is called a locator. It takes responsibility for the easiest step of the three. In fact, you will have to do most of the work in this step yourself, by providing information about the memory on the target board as input to the locator. The locator will use this information to assign physical memory addresses to each of the code and data sections within the relocatable program. It will then produce an output file that contains a binary memory image that can be loaded into the target ROM. In many cases, the locator is a separate development tool. However, in the case of the GNU tools, this functionality is built right into the linker. Emulator This tool gives the ability to see how the software will function in real-time. Emulator helps to define the wrong activities and change them to reach the perfect work of the code. After this process, the code can be embedded in the device. An emulator resembles the function of one computer (guest) on another computer (host). It differs from a simulator, as the emulated output is identical to the real system. This tool can either be software or hardware or both. This tool helps us to work in any kind of application, as it resembles the original work environment of the respective hardware or software. Emulators have the ability to maintain closer contact with the authenticity of digital objects. The emulation process mainly concentrates on re-creating the original environment. The benefits of emulators, when compared to other debugging tools are as follows, o Emulators possess more features when compared to other hardware. o The cost of manufacturing can be minimized over a period of time. o They also have improved graphics quality than others. o Emulators allow wide-scale collaboration as they have been developed and released under the General Public License through an open-source environment. o They also permit software exclusive to one system to be used on another. Example: A PlayStation 2 exclusive video game can also be played on PC with the help of emulators. Real-World Embedded Software Examples Most of the electronic devices and appliances we use in our daily lives contain embedded software. ▪ Consumer Electronics – From smartphones and smart TVs to digital cameras and household appliances, all are equipped with advanced capabilities controlled by embedded software. This software ensures seamless functionality across various smart devices, enhancing user experience. ▪ Automotive Systems – Embedded software manages the engine, the anti-lock brake systems (ABS), the infotainment systems, and the driver assistance features of modern cars. ▪ Industrial Automation – To control processes and monitor operations, embedded software is utilized in programmable logic controllers (PLCs), industrial robots, and manufacturing equipment. ▪ Medical Devices – For accurate control and monitoring, devices like pacemakers, MRI scanners, and infusion pumps rely on embedded software. Is impacting the healthcare industry. ▪ IoT (Internet of Things) – IoT (Internet of Things) devices use embedded software to enable communication and data processing. Examples of IoT devices include smart thermostats, wearables, and home security systems. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 9 COMMON PROGRAMMING LANGUAGES IN EMBEDDED SYSTEMS In embedded systems development, engineers are concerned with both software and hardware aspects of the system. Once the design specifications of a system are clearly defined and converted into appropriate design elements, the system implementation process can take place by translating those designs into software and hardware components. People working on the development of embedded systems are often concerned with the software implementation of the system in which the system specifications are converted into an executable system. For example, some engineers interpreted the implementation of a system as the way in which the software program is arranged to meet the system specifications. Having decided on the software architecture of the embedded design, the first key decision to be made in the implementation stage is the choice of programming language to implement the embedded software (including the scheduler code, for example). The choice of programming language is an important design consideration as it plays a significant role in reducing the total development time (as well as the complexity and thus maintainability and expandability of the software). In a simple embedded system, the main hardware module is the processor. The processor is the heart of the embedded system, and it can be anything like a microprocessor, microcontroller, DSP, CPLD (Complex Programmable Logic Device) or an FPGA (Field Programmable Gated Array). All these devices have one thing in common: they are programmable to define how the device actually works. Embedded software or program allow hardware to monitor external events (inputs/sensors) and control external devices (outputs) accordingly. During this process, the program for an embedded system may have to directly manipulate the internal architecture of the embedded hardware (usually the processor) such as timers, serial communications interface, interrupt handling, and I/O ports etc. From the above statement, it is clear that the software part of an embedded system is equally important as the hardware part. There is no point in having advanced hardware components with poorly written programs (software). There are many programming languages that are used for Embedded Systems like Assembly (low-level Programming Language), C, C++, JAVA (high-level programming languages), Visual Basic, JAVA Script (Application-level Programming Languages), Ada, etc. In the process of making a better embedded system, the programming of the system plays a vital role and hence, the selection of the programming language is very important. Factors for Selecting the Programming Language The following are few factors that are to be considered while selecting the programming language for the development of embedded systems. Size: The memory that the program occupies is very important as embedded processors like Microcontrollers have a very limited amount of ROM (Program Memory). Programming embedded systems requires a low-level access to the hardware. For example, there might be a need to read from / write to particular memory locations. Such actions require appropriate accessing mechanisms, e.g. pointers Speed: The programs must be very fast i.e., they must run as fast as possible. The hardware should not be slowed down due to a slow running software. Embedded processors normally have limited speed and memory, therefore the language used must be efficient to meet the system resource constraints. Portability: The same program can be compiled for different processors. The language must support the creation of flexible libraries, making it easy to re-use code components in various projects. It is also important that the developed software should be easily ported and adapted to work on different processors with minimal changes. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 10 Ease of Implementation, Ease of Maintenance Readability The language must be widely used in order to ensure that the developer can continue to recruit experienced professional programmers, and to guarantee that the existing programmers can have access to information sources (such as books, manuals, websites) for examples of good design and programming practices. Of course, there is no perfect choice of programming language. However, the chosen language is required to be well-defined, efficient, supports low-level access to hardware, and available for the platform on which it is intended to be used. Against all of these factors, “C” language scores well, hence it turns out to be the most appropriate language to implement software for low-cost resource-constrained embedded system. There are other high-level programming languages that offered the above-mentioned features, but none were close to C programming language. Earlier embedded systems were developed mainly using assembly language. Even though assembly language is closest to the actual machine code instructions and produces small size hex files, the lack of portability and high amount of resources (time and manpower) spent on developing the code, made the assembly language difficult to work with. Some of the benefits of using Embedded C as the main programming language: Significantly easy to write code in C Consumes less time when compared to Assembly Maintenance of code (modifications and updates) is very simple Make use of library functions to reduce the complexity of the main code You can easily port the code to other architecture with very little modifications Its compilers are available for almost every processor in use today. There are so many experienced “C” programmers around the world. It is a hardware-independent programming language, a feature which allows the programmer to concentrate only on the algorithm rather than on the architecture of the processor on which the program will be running. Embedded C Programming Language The C programming language, developed by Dennis Ritchie in the late 60’s and early 70’s, is the most popular and widely used programming language. This language provided low level memory access using an uncomplicated compiler (a software that converts programs to machine code) and achieved efficient mapping to machine instructions. The C programming language became so popular that it is used in a wide range of applications ranging from Embedded Systems to Super Computers. Embedded C programming language, which is widely used in the development of embedded systems, is an extension of C program language. The Embedded C programming language uses the same syntax and semantics of the C programming language like main function, declaration of datatypes, defining variables, loops, functions, statements, etc. The extension in Embedded C from standard C Programming Language include I/o hardware addressing, fixed point arithmetic operations, accessing address spaces, etc. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 11 Difference between C and Embedded C Language C Language C used for desktop-based applications C code generate the compatible.exe files It has limitless resources like memory C language uses the desktop OS memory C don’t have registers to store data temporarily Embedded C It is used for microcontroller-based applications Embedded programs generate the.hex files It has limited resources like memory (RAM, ROM) Embedded programming uses the micro controller inbuilt memory It has registers Why does “C” outperform other languages? The key features of the “C” language can be summarized as follows. It is a mid-level language with both high-level features (such as support for functions and modules) and low-level features (such as access to hardware via pointers). Very efficient, popular and well understood by desktop developers (programmed on C++ or Java). Has well-proven compilers available for every embedded processor (e.g. 8-,16-, 32-bit or more). Books, training courses, code examples and websites that discuss the use of the language are all widely available. When comparing “C” to other alternative languages such as C++ or Ada, the following observations have been made. C++ is a good alternative to “C” as it provides better data abstraction and offers a better O- O programming style, but some of its features may cause degradation in program efficiency. Also, such a new generation O-O (object-oriented) language is not readily available for the small embedded systems, primarily because of the overheads inherent in the O-O approach, e.g. CPU-time overhead. Despite that Ada was a leading language that provided full support for concurrent and real-time programming, it has not gained much popularity and has rarely been used outside the areas related to defense and aerospace applications. Unlike C, not many programmers nowadays are experienced in Ada, therefore only a small number of embedded systems are currently developed using this language. In addition, despite their approved efficiency, Ada compilers are not widely available for small, embedded microcontrollers and usually need hard work to accept the program; especially by new programmers. Indeed, both Ada and C++ have too large demand on low-cost embedded systems resources (e.g. memory requirements) and therefore cannot be suitable languages for such applications. Selecting a suitable programming language is a key aspect in the success of the software development process. It has been shown that there is no specific method for selecting an appropriate programming language for the development of a specific project. However, the accumulation of experience along with subjective judgment enables software developers to make intelligent choices of programming languages for different application types. Embedded software developers utilize different programming languages such as: Assembly, Ada, C, and C++. We have demonstrated that C is the most dominant programming language for embedded systems development. Although other languages may be winning ground when it comes to usage, C remains the de facto language for developing resource-constrained embedded systems which comprise a large portion of today’s embedded applications. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 12 References Modern Embedded Computing by Peter Barry and Patrick Crowley Embedded System Design 4th Edition by Peter Marwedel Embedded Systems - Theory and Design Methodology by Kiyofumi Tanaka Introduction to Embedded Systems 2nd Edition by Lee and Seshia High Performance Embedded Computing by Pinho et. al. Introduction to Embedded Systems by Shibu KV Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 13

Tags

embedded software embedded systems programming languages
Use Quizgecko on...
Browser
Browser