This series of articles are the study notes of "AnIntroduction to Programming the Internet of Things", by Prof. Harris, Department of Computer Science, University of California, Irvine. This article is week 2, Lessen 1: Features and Constraints of Embedded Systems.
IoT devices are typically embedded systems also, so we'll just define that and give youan idea of what embedded systems are.
If I play a video game on a computer. I put the video game in there and install it, and it has some conflict with the video card. I need a new video card, right, to play this new video game. So, then Ineed to get new drivers for my video card, so there's this whole interaction.The functions are not separated. This is different than an IOT device. An IOT device basically has one function. It hasone function it's trying to do, like the car. It does the car things. A camera does camera things, but a general purpose computer can do a lot of things, and so there can be conflicts. If I install software to play a video game, that might interfere with the software to do something else. So these relationships add to complexity. So it makes it harder to use a standard computer than to use, say an IOT device.
An embedded systemAn embedded system, the user just knows how to use it, so it has a very simple interface. And this is where the term embedded comes from. The complexity is embedded inside the device; the user doesn't have to deal with the complexity.So that's what an embedded system is, how the term came about.
IoT devices are almost always connected to the internet, thus the term Internet of Things.Embedded systemsmay or may not be. Embedded systems may have computational complexity in there, but no network connection at all.
Now sometimes embedded systems don't interact directly with the user, but they interact with the user through another device.So what do I mean by this? Let's take this, take this memory, this thumb drive right. Now a thumb drives, you've seen this type of thumb drive, it stores data.This type of thing does not interact directly with the user.
One big property of embedded systems and a difference in embedded system design is that efficiency is really important. So what that generally means is, that it's not enough to get the design to work, to do its task. It has to do its task in an elegant. Either it has to do it fast, or it has to do it with low power, or it has to do it at low price.
Very different from traditional software engineering
Which by the way, Moore's law is slowing down but still, this happens. Machines improve. So, software engineering often you'll just either say, look, just get it to work and if it's slow it's okay, because process or performance is improving every year. And so in the future it won't matter. So that was the background assumption to a lot of software engineering. But a embedded systems, you can't think like that. You have to think look not only does it work. It's going to be working fast. It's going to be working low power and all this.
This lecture will talk about embedded systems a little bit more. We'll talk in more detail about how they're designed, since that is the point of this course.
Embedded devices are generally application specific
Embedded devices aregenerally application specific. Unlike desktop, laptop computers which can run any type of program or pretty good doing any type ofprogram.Embedded systems are made to do one thingor one related set of things.
General purpose systems are very inefficientGeneral purpose systems like a laptop, desktop, so those things essentially end up being over powered for whatever you have to do because they have to be ready to handle any type of computational task. There is no reason why you need four processors to run Word or PowerPoint, or whatever application you're running. You don't need 4 GHz to runthese applications. So 99.9% of the time, these laptops and desktops are well under utilized. Only 1% of the CPU, some tiny fractions of the CPU is actually being used. But every once in a while, it's running an application that really uses it. So in some sense, general-purpose processors, most of the time, they are wasted.
So in some sense, general purpose machines are very inefficient in that way, and because of that they cost more than they need to, to do any individual task.
Say you want to play video games, and you want to play the newest, best video games. You can buy a computer, a good computer with a great graphics card and all this, and that might cost you $1,500, right? To get the newest, most up-to-date video card, in the best computer, to run the best games, and run them fast. Or you could say, look, let me just buy an XBox One, or Play Station 4, which is a lot cheaper, say $500. But it runs that game better, probably better than the best, than that more expensive computer. Now, all it does is games, but it does games great. It does games the best.
General-purpose systems use hardware and software developed by different companies.
Another big difference in the way you design embedded systems as compared to sort of a regular desktop laptop, is that hardware and software are usually designed together. So again, this is for efficiency reasons.
Now, more and more, these companies are coming together. And sort of Apple is the epitome of this, right?They make their devices' hardware and software together. They make the phone and the software or whatever the device is in the software, as one which means that they work together better. And in fact, the Apple machines traditionally are very reliable because of that. But it also makes them more efficient.
You must understand both hardware and software.
This lecture we'll talk about the structureof an embedded system. The hardware structure specifically, look at the different components.
There are a lot of actuators such as LEDs, motors,speaker, lights, screen, etc. So the interface components of the sensors and the actuators. Now in the middle of the system, the center of the whole thing is that microcontroller in the center.
There are other components that are commonly inside the core of an embedded system as well, and you see two of the mright there. IP and FPGA, we'll talk about those in a little bit right now.
These things (IP core) can be very useful. They're cheap in high volume. High volume means manufacturing volume.
Take cell phone for example, let's say, it's very common to perform some type of audio filtering task. So all of our cell phones have to do this audio filtering. So you might make one of these IP cores. So you might make one of these IP cores, which performs filtering, and then it would be high volume, because there are many millions of cell phones that are for sale, and so you manufacture many of them. So there's a lot of work to designing one of them and it costs a lot if you want to just fabricate one. But when you're fabricating a high volume, it's very cheap.
So these IP cores can be very valuable whenyou have high volume production. So they're useful for common tasks. In order to make sure you get high volume. You basically want to use them for very common tasks. Because there is a lot of need, tasks would happen over and over.
For instance, network controllers, that's in a lot of systems. Basically every Internet linked device has some sort of network controller in it. So that type of thing you might implement asan IP core. Then you're making an IOT System, you definitely might want to buy one of these.
The microcontroller is the center of all the action. So, it's connected to theIP cores and it tells them when to do what they need to do. So if an IP core is for encoding video, the microcontroller will say encode this data now. And whenI say it will say that, I mean through the signals, so the wires it will send the appropriate sequence of input signals to trigger it to record. And then theresults may be the core sets a signal high when it's completed. And that goes back to the microcontroller. The microcontroller knows okay the coding is done,let me move on. So there's this conversation between the microcontroller and the IP core that goes on.
Now another component that you often find in IOT devices, embedded devices in general is Field Programmable Gate Arrays (FPGA). Now, we will not be using Field Programmable Gate Arrays in this class because their complexity is basically outside of the scope of the class, but what they are, they're an interesting thing and you should know what they are.
They're hardware. They're integrated circuits, they're chips. Not programmable chips, they're regular chips. Not programmable in the conventional sense.These things can be reconfigured, essentially rewired to perform different tasks.