Intro to Embedded Systems
Published: 2024-06-10 02:59:34

### Introduction
No matter where you are right now, chances are is that an embedded system is within arms reach. These systems are so common people never take the time to acknowledge the tech that may be incorporated in their day-to-day lives. Embedded systems are present within products like television remotes, microwaves, automobiles, watches, and a lot more. Embedded systems help for products like these and others that may vary to behave how they are supposed to by dividing the tasks of a product into microcomputers designed to handle their own respective task.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjyt7zfx6xqc4b4radp6.png)


### What are Embedded Systems?

An embedded system is typically referred to as a combination of computer hardware, software, and occasionally firmware in order to fulfill a specific function or task. These systems are labeled as embedded because they are only a single component of a much larger computational operation. These embedded systems are capable of being reprogrammed if necessary, but they are typically designed with fixed functionality in order to maintain the overall functionality of an entire system. The main reasons for the separation of entire systems into smaller, embedded systems are to cut back on costs which improves the efficiency of mass production, and to isolate certain functions similar to the separation of components when developing an application. 


### Embedded Systems: Key Concepts

#### Efficiency

- Resource management
  * Low-power consumption
  * Specified usage of computational components
- Real-time performance
  * Precise timing for time-sensitive data responses

#### Reliability & Stability
- Robust
  - Error handling
  - Fault tolerance
- Definitive design
  - Modifications to code not needed consistently

#### Scalability
- Custom layout and complexity
  - Ability to design hardware & software compatibility to meet 
  varying application requirements
- Different processors
  - Microprocessor
  - Microcontroller
  - Multiprocessors/system-on-chip (SoC)


### Components of Embedded Systems

#### Hardware

The hardware, the physical components inside of an electrical device, of an embedded system are comprised of a processor, power supply, a memory unit, and some type of communication interface. As mentioned previously, there are a few options when it comes to processors in an embedded system: microcontrollers, microprocessors, and system-on-chip’s. Microprocessors are categorized as such because of their reliance on other peripherals within the system such as memory and are known to require more support. Microcontrollers on the other hand have access to their own interface peripherals. SoC’s utilize multiple processors and interfaces on a single chip to handle more complex algorithms. The communication interface is responsible for transmitting data from the processor to other system components in order to continue the chain of action prerequisites for proper functionality.

![Image description](https://images.ctfassets.net/xwxknivhjv1b/1YE6oOCOD1MsRWYI4SOCie/5a0d19b9e97b164782ddaeb1d81138d1/what_is_hardware.svg)

#### Software 

The software, the programs utilized by a device, of an embedded system commonly include firmware and an operating system (OS). Firmware is a type of low-level software that allows for hardware and additional software interact with each other properly. It is part of the reason as to why the processor can access data that may be stored within memory. Operating systems are another key component when it comes to software. It is mostly necessary when real time operating system (RTOS) come into play. The more common OS used in embedded systems when real-time operation is needed is a “stripped-down version of Linux” (Ben Lutkevich, 'What is an Embedded System?)". 

![Image description](https://i.ytimg.com/vi/BTB86HeZVwk/sddefault.jpg)

### Classifications

There are three main classifications of embedded systems (excluding the other few that may be more controversial) that can be used to determine and identify the type of embedded system along with the function they may serve in the overarching flow of the system.

- Subsystems

Subsystems are simply classified as a smaller component that is used in conjunction with other parts. They usually do not perform the entire task that will eventually be completed upon all system successes but instead are in charge of managing and reporting the data of certain input or responses. 

- Standalone 

Standalone embedded systems are exactly as they sound, systems designed to be used independently of other products or systems. They still do not possess the ability to perform a multitude of actions but can still perform a limited set of behaviors that it has been made to do. 

- Networked Systems

Networked systems are systems that have some involvement with network connectivity. Usually mentioned in conversations with Internet of Things (IoT), this type of embedded system has become increasingly  popular in today's modern society. 

![Image description](https://d2ms8rpfqc4h24.cloudfront.net/uploads/2021/02/Types-of-Embedded-System.jpg)


### JavaScript & Embedded Systems

Although, JavaScript is not a language that is used in high frequencies when it come embedded systems, there seems to be an increase in the usage for development. In GitHub user cesanta's repo, [Elk](https://github.com/cesanta/elk?tab=readme-ov-file), JavaScript was given more functionality during the development stage by using the Elk engine which was designed to use C-language firmware in place of JavaScript and vice-versa. Below is an example of how it may be used to make a LED light flash on an Arduino board using the Elk engine to have JS compatibility. 

```js
js_eval(js,
          "let pin = 13;"       // LED pin. Usually 13, but double-check
          "gpio.mode(pin, 1);"  // Set OUTPUT mode on a LED pin
          "for (;;) {"
          "  delay(300);"
          "  gpio.write(pin, 1);"
          "  delay(300);"
          "  gpio.write(pin, 0);"
          "}",
          ~0U);
```
### Conclusion

In conclusion, embedded systems are crucial for almost all technological and tangible devices due to their wide variety of usages and cheap production cost. With a large population of internet  citizens in today's current age, the use of networked systems has grown larger as time goes on. With an estimate market of around $116 billion dollars in 2025 and top tech giants backing and manufacturing chipsets for use in embedded systems (Texas Instruments, IBM, Google...), it is apparent that embedded systems have and will continue to innovate the world. 

#### Sources

- https://github.com/cesanta/elk/blob/master/examples/BlinkyJS/BlinkyJS.ino

- https://d2ms8rpfqc4h24.cloudfront.net/uploads/2021/02/Types-of-Embedded-System.jpg

- https://images.ctfassets.net/xwxknivhjv1b/1YE6oOCOD1MsRWYI4SOCie/5a0d19b9e97b164782ddaeb1d81138d1/what_is_hardware.svg

- https://i.ytimg.com/vi/BTB86HeZVwk/sddefault.jpg

- https://www.techtarget.com/iotagenda/definition/embedded-system

- https://www.spiceworks.com/tech/tech-general/articles/what-are-embedded-systems/

- https://www.youtube.com/watch?v=oPn_adlC1Q0