物联网与嵌入式系统概论-week2-Embedded Systems-Lesson1: Features and Constraints

来源:互联网 发布:手机淘宝怎么删掉差评 编辑:程序博客网 时间:2024/06/05 18:33

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.

1. Lesson1 Features and Constraints of Embedded Systems

1.1 What Are Embedded Systems

IoT devices are typically embedded systems also, so we'll just define that and give youan idea of what embedded systems are.

1.1.1 What Are Embedded Systems

(1) Embedded systems are computer based systems that don't appear to be computers-complexity is hidden from the user.

A general purpose computer

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 system

An 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.

(2) The embedded systems are much more common than desktops or laptops.

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.

Things are moving from embedded to IoT, because ofthe trends we talked about in the last module, the fact that internet connectivity is so ubiquitous and it's pretty cheap to obtain. So a lot of these devices that used to be just embedded, are now becoming networked and so you'd call them IoT.

(3) They interact with users via simple interface

  • Digital camera, TV, cellphone
  • Disk drive, memory stick,anti-lock braking system

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.

1.1.2 EfficiencyRules

  • Most of these devices are used in cost-critical markets. Or in life critical

1.1.3 TightConstrains

  • Manufacturing cost
  • Design cost
  • Performance
  • Power
  • Time-to-market

Very different from traditional software engineering

  • Moore’s law will save you eventually

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.

1.2 More on Embedded Systems

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.

1.2.1 Embedded systems tend to be application-specific.

(1) Perform one task or set of related tasks

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 inefficient

General 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.

(2) Higher design efficiency is possible

Exampleof playing video game: the design is very efficient for a embedded system

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.

So I can change the way I do design to just includethe software and the hardware that I need for the task that it's made for. And so that makes it cheaper. Now it makes it more limited. It can only do what it's made to do, but what it does, it does cheaply and efficiently.

1.2.2 Hardware/Software Codesign

(1) Hardware and software are often designed together

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.

(2) More work for the designers

You must understand both hardware and software.

As opposed to a general purpose system where you have to have hardware for everything and software for everything, just for the one occasion where you actually need it. So you're designing the hardware and software together, andthat makes design a lot harder. Because you have to not only be a hardware designer but you also have to be a software designer. So when you're writingthe software, you have to think about what the hardware can do. See, normally when you take an application like Word, that thing runs on many different hardware platforms. You generally as a programmer do not have to be aware of this hardware platform that it's running on.

1.3 Generic Embedded Systems Structure

This lecture we'll talk about the structureof an embedded system. The hardware structure specifically, look at the different components.

1.3.1 Sensors

So if you look at an embedded system, it's got to take data from the outside world and then it's got to output data to the outside world. So it has,first for the receiving data from the outside world, ithas a set of sensors. So these sensors they receive information from the outside in many different ways because there are lots of different types of sensors. The most basic type of sensor would be a button, push button,something like that. And that's receiving data that somebody types in.


1.3.2 Actuator

So that input comes in to a set of sensors and it's going to  go into the core of the system and in the end, once the system has decided, process that information, decide what to do with that information, it needs to cause some results. An effect to happen in the outside world. So that's done through the actuators atthe other side, the actuators, they cause events to happen in the world.So those might be something like an LED, a light, like there's a light flashingin front of me. That LED is an output actuator. And it goes off and on to indicate probably that it's recording.


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.

1.3.3 Intellectual Property (IP) Core

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.

(1)   An integrated circuit that performs one function

IP stands for intellectual property, or IP Core people call them, and intellectual property core is basically a predesigned component, typically a premanufactured component so an integrated circuit, a chip that performs one function. When I say one function, maybe a set of functions, but all related to one particular task. So it's a chip that is not general purpose programmable. It's a core that just performs some small set of functions that are all related.

(2)  Cheap and high volume

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.

(3)  Very useful for common tasks

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.

(4)  Must interact with the microcontroller

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.

1.3.4 Field Programmable Gate Array (FPGA)

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 reconfiguredessentially rewired to perform different tasks.

So, let's say you need something to do audio filtering. So, you might configure the FPGA to perform filtering. So it's a hardware device that will perform filtering because it's been wired to do that. But then you can rewire itreconfigure the device, to rewire it so that it performs mpeg coding instead or something like that. Now it's not programmable in the sense of a general purpose processor, you don't write code for it. And as a result it's actually a lot faster than a general purpose processor.
0 0