Sunday, May 7, 2023
Thursday, March 2, 2023
How to Absorb Books
- [1] Flip through each page
- [2] End of chapter-looking for question
- [3] Read the bold prints
- [4] First and last sentence of each paragraph
- [5] Then start reading
Tuesday, January 3, 2023
Saturday, September 24, 2022
Microprocessor, Microcontroller & Embedded Systems
A microcontroller is a small computer on a single integrated circuit chip. A microcontroller typically contains one or more processor cores, along with additional peripherals (memory, serial interface, timer, programmable I/O peripherals, etc.) on the same chip.
A microprocessor is a computer processor that incorporates the functions of a central processing unit (CPU) onto just a few (and often only one) integrated circuits.
Microprocessor and Microcontroller Architecture Explained
Microprocessors and microcontrollers perform relatively similar functions, but if we look specifically at the architecture of each type of chip, we'll see just how different they are.
The defining characteristic of a microcontroller is that it incorporates all of the necessary computing components onto a single chip. The CPU, memory, interrupt controls, timer, serial ports, bus controls, I/O peripheral ports, and any other necessary components are all present on the same chip and no external circuits are required.
In contrast, a microprocessor consists of a CPU and several supporting chips that supply the memory, serial interface, inputs and outputs, timers, and other necessary components. Many sources indicate that the terms "microprocessor" and "CPU" are essentially synonymous, but you may also come across microprocessor architectural diagrams that depict the CPU as a component of the microprocessor. You can think of a microprocessor as a single integrated circuit chip that contains a CPU. That chip can connect to other external peripherals such as a control bus or data bus that provide binary data inputs and receive outputs from the microprocessor (also in binary).
The key difference here is that microcontrollers are self-contained. All of the necessary computing peripherals are internal to the chip, where microprocessors deal with external peripherals. As we'll soon see, each of these architectures has its own unique advantages and disadvantages.
Microprocessor and Microcontroller Applications Explained
Microprocessors and microcontrollers are both ways of implementing CPUs in computing. So far we've learned that microcontrollers integrate the CPU onto the chip with several other peripherals, while a microprocessor consists of a CPU with wired connections to other supporting chips. While there may be some overlap, microprocessors and microcontrollers have relatively separate and distinct applications.
Microprocessors depend on interfacing a number of additional chips to form a microcomputer system. They are often used in personal computers where users require powerful, high-speed processors with versatile capabilities that support a range of computing applications. The use of external peripherals with microprocessors means that components can be upgraded easily - for example, a user might replace their RAM chip to benefit from additional memory.
Programmable microcontrollers contain all of the components of a microcomputer system on a single chip that runs at low power and performs a dedicated operation. Microcontrollers are most commonly used in embedded systems applications where devices are expected to execute basic functions reliably and without human interference for extended periods of time.
Three Key Differences Between Microcontrollers and Microprocessors
Cost
Generally speaking, microcontrollers tend to cost less than microprocessors. Microprocessors are typically manufactured for use with more expensive devices that will leverage external peripherals to drive performance. They are also significantly more complex, as they are meant to perform a variety of computational tasks while microcontrollers usually perform a dedicated function. This is another reason why microprocessors require a robust external memory source - to support more complex computational tasks.
With a microcontroller, engineers write and compile the code intended for the specific application and upload it into the microcontroller, which internally houses all of the necessary computing features and components to execute the code. Due to their narrow individual applications, microcontrollers frequently require less memory, less computing power, and less overall complexity than microprocessors, hence the lower cost.
Speed
When it comes to overall clock speed, there is a significant difference between industry-leading microprocessor chips and high-quality microcontrollers. This relates back to the idea that microcontrollers are meant to handle a specific task or application, while a microprocessor is meant for more complex, robust, and unpredictable computing tasks.
One of the key design advantages associated with microcontrollers is that they can be optimized to run the code for a specific task. That means using just the right amount of speed and power to get the job done - no more and no less. As a result, many microprocessors are clocking speeds of up to 4 GHz while microcontrollers can operate with much lower speeds of 200 MHz or less.
At the same time, the close proximity of on-chip components can help microcontrollers perform functions quickly despite their slower clock speed. Microprocessors can sometimes operate more slowly because of their dependence on communicating with external peripherals.
Power Consumption
One of the key advantages associated with microcontrollers is their low power consumption. A computer processor that performs a dedicated task requires less speed, and therefore less power, than a processor with robust computational capacity. Power consumption plays an important role in implementation design: a processor that consumes a lot of power may need to be plugged in or supported by an external power supply, whereas a processor that consumes limited power could be powered for a long time by just a small battery.
For tasks that require low computational power, it can be much more cost effective to implement a microcontroller versus a microprocessor that consumes much more power for the same output.
Embedded Systems and Microcontrollers
Microcontrollers include many features that make them suitable for application in embedded systems:
- They are self-contained, including all of the necessary peripherals on a single integrated circuit chip
- They are designed to run a single dedicated application
- They can be optimized (software and hardware) for a single dedicated application
- They exhibit low power consumption and may include power-saving features, making them ideal for applications that require the processor to function for long periods of time without human interference
- They are relatively inexpensive when compared to CPUs, mainly because the entire system exists on a single chip
While microprocessors may be more powerful, that additional power comes at a cost that makes microprocessors less desirable for embedded systems applications: larger size, more power consumption, and greater cost.
How Do Embedded Systems Work?
An embedded system is a hardware-and-software system that performs a dedicated function within a larger mechanical or electrical system. Embedded systems are typically designed to deal with real-time computing constraints, and are controlled by a real-time operating system (RTOS) that can process data as soon as it is received without buffer delays. Most embedded systems today are based on programmable microcontrollers, small computers with integrated memory housed on a single integrated circuit. We can think of embedded systems as having three main components: the hardware component, the software component, and the real-time operating system.
Embedded Systems Hardware
Embedded systems are small embedded computers that live inside other mechanical or electrical systems. Embedded systems can be programmed to fulfill a variety of functions, but each one must include the basic components of a computer:
- Processor - Embedded systems are built around a microprocessor or microcontroller. Microcontrollers include one or more processors (CPUs), along with integrated memory and programmable input/output peripherals. Most automatically controlled products or devices use microcontrollers , including office machines, power tools, and automobile engine control systems.
- Power Supply - Embedded systems have significantly lower power requirements than a standard computer due to their small size and comparatively low processing power. Embedded engineers should choose a power supply that offers a stable and smooth output of power to the microcontroller with adequate output current to drive the load and stable performance in a variety of environments.
- Memory - If an embedded system is powered by a microcontroller, the system's memory is already available on the chip. If using a microprocessor, a memory chip should be added to the system. Embedded systems use read-only memory (ROM) to store the software program used to operate the microcontroller and random access memory (RAM) to temporarily store data that is received or in-use by the system.
- Communication Ports - Embedded systems use wired communications to transmit data between the microcontroller, peripheral devices, and other embedded systems. Engineers must select a communication protocol to facilitate this data exchange, ensuring that devices in the system are all "speaking the same language" when they communicate or transmit data. Common communication protocols for embedded systems include the I2C protocol, SPI protocol, and the USB protocol, but there are many other wired and wireless protocols available for engineers to choose from.
Embedded Systems Software and RTOS
Programming for embedded systems is most frequently done using C, C++, the Embedded C language or assembly language. The software programming for embedded systems, including the RTOS, resides in the memory chip and can be accessed whenever the power supply for the system is activated. Unlike standard computers, embedded systems are designed to carry out a specific task or function rather than for "general use". As such, embedded systems software is highly specific to each application of embedded systems.
Embedded Systems Applications Today
Embedded systems impact everyday life in so many ways, we may not always realize the number of devices in our immediate surroundings that are controlled by embedded systems. Let's take a brief inventory of some of the most important embedded systems applications and areas of innovation today.
Embedded Systems in Communications
Cellular phones are some of the most accessible examples of embedded systems that we interact with on a daily basis. Mobile phones contain all of the characteristic components of an embedded system: a power supply, some memory or storage, a processor, and ports for communicating with other devices. Mobile phones also contain additional hardware that supports utilities like audio, cameras, internet connectivity, touch screen and calling.
Like other embedded systems, your mobile phone uses a defined communication protocol to facilitate data transactions between the microcontroller or processor and peripheral devices that collect data.
Embedded Systems in Consumer Electronics
Embedded systems are finding their way into many categories of consumer electronics, including home security systems, home appliances, printers, watches, and more. Home appliances like refrigerators, microwave ovens and washing machines use simple embedded systems to provide features, collect input from users, and control the appliance according to user specifications. They may even use some sensors to collect information about how the appliance is functioning and modify settings accordingly.
Home security systems use embedded systems with peripheral sensors to collect information about activity in and around the home and either initiate a response (alarm) or communicate that data to the homeowner.
Embedded Systems in Automotive Applications
All cars manufactured today contain at least one computer that works to measure and minimize engine emissions throughout the operational life of the vehicle. This embedded computer collects data from a variety of peripheral sensor devices, including oxygen sensors, air pressure sensors, air temperature sensors, and the engine temperature sensor. The computer can use data from these sensors to measure the cleanliness of engine emissions and control the fuel injectors, spark plugs and other variables to optimize for engine performance while minimizing environmental impact.
Most vehicles have additional embedded systems that control things like automatic transmission, anti-lock braking systems, air bags, key-less entry or security systems, audio devices and safety applications like lane drift detection.
Embedded Systems in Healthcare
Embedded systems are used in medical scanning machines, imaging systems, and diagnostic equipment. Some of the most commonly used medical imaging devices, such as CT scanners, MRI machines, and Sonography equipment used to conduct ultrasound imaging are built around and controlled by embedded systems. Digital flow sensors used to monitor respiration, heart monitoring machines, and simple diagnostic machines that test for blood pressure or glucose content also use embedded systems.
The expansion of the Internet of Things (IoT) is leading to new trends in embedded systems for healthcare. In the future, patients will use wearable devices to track their vital signs with data regularly transmitted to their hospital or physician in real time. There will be no shortage of product development opportunities for embedded systems engineers that can use their skills to lower healthcare costs or improve access for patients.
The Future of Embedded Systems
Embedded systems are a major area of innovation that is expected to grow substantially on a per-year basis. Across industries, embedded systems engineers are deploying new products and technologies to increase safety and reduce costs.
In the automotive sector, we're seeing major technological growth in embedded systems as major manufacturers partner with leading technology companies to develop self-driving vehicles. The market for wearable medical devices is expanding rapidly, with an estimated growth rate of 18.5% through 2023. There is also a growing demand for "smart" home appliances and devices that can reduce energy consumption while offering convenience and features for homeowners.
Summary
The growing demand for "smart" devices across industries is creating a major area of opportunity for embedded systems engineers to develop their capabilities and launch new products. Embedded systems consist of a microcontroller with on-board memory, a power supply, and communication ports for transmitting data to other devices. Embedded software programs tell the microcontroller how to respond in real time to data collected from the environment through peripheral sensors and devices. Embedded systems are used to enhance safety, reduce costs, and offer convenience and cost-savings to customers in industries that include automotive, home/consumer electronics, communications, and healthcare.
Differences Between Arduino and Raspberry Pi
No. | Arduino | Raspberry Pi |
---|---|---|
1. | Control unit of Arduino is from Atmega family. | While control unit of Raspberry Pi is from ARM family. |
2. | Arduino is based on a microcontroller. | While Raspberry Pi is based on a microprocessor. |
3. | It is designed to control the electrical components connected to the circuit board in a system. | While Raspberry Pi computes data and produces valuable outputs, and controls components in a system based on the outcome of its computation. |
4. | Arduino boards have a simple hardware and software structure. | While Raspberry Pi boards have a complex architecture of hardware and software. |
5. | CPU architecture: 8 bit. | CPU architecture: 64 bit. |
6. | It uses very less RAM, 2 kB. | While Raspberry Pi requires more RAM, 1 GB. |
7. | It clocks a processing speed of 16 MHz. | While Raspberry Pi clocks a processing speed of 1.4 GHz. |
8. | It is cheaper in cost. | While Raspberry Pi is expensive. |
9. | It has a higher I/O current drive strength. | While Raspberry Pi has a lower I/O current drive strength. |
10. | It consumes about 200 MW of power. | While it consumes about 700 MW of power. |
11. | Its logic level is 5V. | Its logic level is 3V. |
12. | It does not have internet support. | It has inbuilt Ethernet port and WiFi support. |
13. | It has higher current drive strength. | It has lower current drive strength. |
14. | Some of the applications of Arduino are traffic light countdown timer , Weighing machines , etc. | Some of the application of Raspberry Pi are Stop motion cameras , Robot Controllers , Game Servers. |