embedded systems 101 final

41
Embedded systems-101 BY Khaled el madawi [email protected]

Upload: khalid-elmeadawy

Post on 18-Aug-2015

169 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Embedded systems 101 final

Embedded systems-101BY

Khaled el madawi

[email protected]

Page 2: Embedded systems 101 final

What is Embedded systems

Page 3: Embedded systems 101 final

1.0 Embedded Systems

• All systems that contain one or more processor to do specific functionalities and give responses upon receiving inputs.

• This processor is not for general purposes like general purpose Processor in PC’s and notebooks.

Page 4: Embedded systems 101 final

1.0 Embedded Systems(cont’d)

Another definition:

• Computing systems with tightly coupled hardware and software integration, that are designed to perform a dedicated function(s).

• The word embedded reflects the fact that these systems are usually an integral part of a larger system, known as the Embedding System. Multiple embedded systems can coexist in an embedding system.

Page 5: Embedded systems 101 final

1.1 Embedded Systems Applications

• Quadcopters

Page 6: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Rovers

Page 7: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Engine control

Page 8: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Embedded communication

Page 9: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Fixed wing UAVs

Page 10: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Rockets

Page 11: Embedded systems 101 final

1.1 Embedded Systems Applications(cont’d)

• Satellites

Page 12: Embedded systems 101 final

1.2 How Could these systems act like that?

we have two paths

Feed back systems:• Getting a feed back that

gives for me a reading of a state that the robot is in it right NOW.

• Pros:The most used, cause it’s reliability is very high.• Cons:Need observation to solve the uncertainty problem.

Mathematical model:• Make a mathematical

model for the Robot/system and predict the output from the input equation.

(Y=A*X where Y is the output, A is the mathematical model of the system, and X is the input.)• Pros:It is the most way used when we can’t take a feedback from the system.• Cons:Mathematical model of the System changes with time, temp, and environment. In words hysterias property occurs.

Page 13: Embedded systems 101 final

1.3 Essential Considerations in Embedded design

• Response Time ‐‐ Real Time Systems

• Area

• Cost

• Portability

• Low Power (Battery Life)

Page 14: Embedded systems 101 final

2.1 General Purpose Processors

• 16/32‐bit data path.

• Contains ALU(arithmetic logic unit)

• Contains Registers that is used in

arithmetic and logic operations.

• It contains PC(program counter).

• Designed for a wide range of applications .

• Examples: ARM, PowerPC, MIPS, 68K, x86.

Page 15: Embedded systems 101 final

2.2 Microcontrollers

• The workhorse of industrial electronics.

• Designed for standalone operation.

• Include a processing unit of 8‐bit, 16‐bit, 32‐bit.

• Included memories (RAM, ROM), I/O, buses and peripherals, depending on the application designed for (LIN , CAN , Ethernet , I2C , SPI,…etc ).

Page 16: Embedded systems 101 final

2.2 Microcontrollers(cont’d)

Page 17: Embedded systems 101 final

2.3 Embedded Software Characteristics

• Highly configurable.

• Shorter development cycle.

• Easier in versions updates.

• Cheaper.

• Constrained to processor speed which may or may not satisfy real time applications.

Page 18: Embedded systems 101 final

2.4 Difference between Microcontroller and Microprocessor

Microprocessor: Microcontrollers:

Is a typical Personal Computer where devices are attached to the CPU, using hard‐wired connections, which makes the system more flexible. That means you can add more memory, change capacity of hard drives, add or remove CD‐ROMs, sound cards, etc.

Is a single chip, self‐contained computer which incorporates all the basic components of a personal computer on a much smaller scale.

Most of these components are built exactly within the same package.

Some of these components are: CPU, RAM, ROM, Timers, I/O, etc.

Page 19: Embedded systems 101 final

2.5 Microcontroller in a System

• Microcontrollers don’t work alone in the circuit it must interfaces with other on chip devices.

• Microcontroller can accept inputs from some components and provide outputs to other components within any given system.

• Differences in requirements, make the manufacturers produce different microcontrollers with different memory sizes, number of I/O lines and number of integrated peripheral devices.

Otherwise they are all similar to use.

Page 20: Embedded systems 101 final

2.5 System On Board Generic Embedded System Structure

Page 21: Embedded systems 101 final

3.0 Microcontroller main components

• Central processing unit (CPU).

• Buses.

• Memory units.

• Input and Output (GPIO or DIO).

Page 22: Embedded systems 101 final

3.1Central Processing Unit(CPU)

• The unit which monitors and controls all processes inside the microcontroller. It consists of several smaller units.

The most important units are:

Page 23: Embedded systems 101 final

3.1Central Processing Unit(cont’d)

• Arithmetical logical unit (ALU):

performs all mathematical and logical operations upon received data.

• Instruction Decoder

Is a part of electronics that recognizes program instructions and runs other circuits as a result. The “instruction set” which differs from microcontroller family to another expresses the abilities of this circuit.

Page 24: Embedded systems 101 final

3.1Central Processing Unit(cont’d)

• BUS

– Physically, the bus consists of 8, 16 or more wire.

– There are two types of buses: address and data bus. The first one consists of as many lines as necessary for memory addressing. The other one is as wide as data width, it may be 8, 16, or 32 bits or wires wide.

Page 25: Embedded systems 101 final

3.2CPU Main Registers

• The numbers and names of registers vary drastically

• among microcontrollers. However there are certain

• registers which are common to most of microcontrollers,

• although the names may vary.

Page 26: Embedded systems 101 final

CPU Main RegistersIndex register Program counter Register

Special Function Registers (SFR registers)

Stack pointer

– The index register is used to specify an address when a certain addressing mode is used.– It is also known as the pointer register.

– Perhaps the most important CPU register is the program counter(PC).– The PC holds the address of the next instruction in program memory space, which the CPU will process.As each instruction is fetched and processed by the ALU, the CPU increments the PC and thereby steps through the program stored in the program memory space.

Their bits are connected (literally) to internal circuits such as timers, A/D converter, oscillators and others, which means that they are directly under command of the operation of the microcontroller.

– Contains the address of the next location in the stack.– Decremented when data is pushed into the stack and incremented when data is popped out from the stack (and may be vice versa for some processors).

Page 27: Embedded systems 101 final

3.3 CPU Architecture

• There are two basic types of architecture: Harvard and Von Neumann.

• Microcontrollers most often use a Harvard or a modified Harvard‐based architecture.

Page 28: Embedded systems 101 final

3.3 CPU Architecture(cont’d)

• Von‐Neumann architecture

– Von Neumann architecture has a single, common memory space where both program instructions and data are stored.

– There is a single data bus which fetches both instructions and data.

Page 29: Embedded systems 101 final

3.3CPU Architecture(cont’d)

• Von‐Neumann architecture

– Each time CPU fetches a program instruction it may have to perform one or more read/write operation from/to data memory space. It must wait until these subsequent operations are complete before it can fetch and decode the next program instruction.

Page 30: Embedded systems 101 final

3.3 CPU Architecture(cont’d)

• Harvard Architecture

– Harvard architecture computers have separate memory areas for program instructions and data.

– One bus is a 8‐bit wide and connects CPU to RAM memory. The other bus consists of several lines (12, 14 or 16) and connects CPU to ROM memory.

Page 31: Embedded systems 101 final

3.3 CPU Architecture(cont’d)

• Harvard Architecture

– The CPU can read an instruction and perform a data memory access at the same time.

– This speeds up execution time but increases the cost of more hardware complexity

Page 32: Embedded systems 101 final

3.4 Memory Unit

• Memory is a part of the microcontroller used for data storage.

• There are different types of memory

within the microcontroller:

– ROM memory (Read Only Memory)

– RAM memory (Random Access Memory).

Page 33: Embedded systems 101 final

3.4 RAM VS ROMComparison chart RAM ROM

Definition Random Access Memory or RAM is a form of data storage that can be

accessed randomly at any time, in any order and from

any physical location., allowing quick access and

manipulation.

Read-only memory or ROM is also a form of data

storage that can not be easily altered or

reprogrammed. Stores instructions that are not

necessary for re-booting up to make the computer

operate when it is switched off. They are hardwired.

Stands for Random Access Memory Read-only memory

Use RAM allows the microprocessor/controller to

read data quickly to run applications. It allows reading and writing.

ROM stores the program required to initially boot the

computer. It only allows reading.

Volatility RAM is volatile i.e. its contents are lost when the

device is powered off.

It is non-volatile i.e. its contents are retained even when the device is powered

off.

Types The two main types of RAM are static RAM and dynamic RAM.

The types of ROM include PROM, EPROM and EEPROM.

Page 34: Embedded systems 101 final

3.5 HOW all of this work together?

• The crustal is the heart of the

Microcontroller which is the brain

of the system.

• It gives the microcontroller the

operating frequency(speed of

microcontroller), and the clock

reference where it can shift from instruction to another.

Page 35: Embedded systems 101 final

3.6 Input and Output(GPIO or DIO)

Page 36: Embedded systems 101 final

3.6 Input and Output (cont’d)

• The microcontroller has to be connected to additional electronics, peripherals.

• For that reason, each microcontroller has one or more registers (called “port” in this case) to which it’s connected.

• Suppose you want your device to turn on and off three signal LEDs and simultaneously monitor logic state of five sensors or push buttons to the microcontroller pins.

Page 37: Embedded systems 101 final

3.6 Input and Output (cont’d)

• low‐current consumption (10‐20 mA).

• Each I/O port is under control of another SFR, which means that each bit of that register determines state of the corresponding microcontroller pin.

Page 38: Embedded systems 101 final

3.7 Other peripherals

• ADC(Analog to Digital Converting).

• Timers.

• Serial protocols(SPI,UART,I2C…etc).

• Comparators.

Page 39: Embedded systems 101 final

4.0 Summary • Microcontroller is the brain of the embedded system.

• The oscillator is the heart that the makes the microcontroller executes instructions.

• The Code is written/burned in the ROM.

• Microcontroller writes and reads the Data through processing in the RAM.

• The Data is transferred between the CPU, memory, and other peripherals through BUS.

• There are a lot of microcontroller peripherals that makes microcontrollers different from each other.

Page 40: Embedded systems 101 final
Page 41: Embedded systems 101 final

Any Questions?