52
Embedded Embedded Systems Systems Design Design

Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Embed Size (px)

Citation preview

Page 1: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Embedded Embedded SystemsSystems

DesignDesign

Page 2: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

General Purpose Processors: General Purpose Processors: SoftwareSoftware

BASIC ARCHITECTUREBASIC ARCHITECTURE - Datapath - Datapath

2

Page 3: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

3

Page 4: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ControllerController

4

Page 5: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

MemoryMemory

5

Page 6: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Operation: PipeliningOperation: Pipelining

6

Page 7: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Instruction Set: Addressing ModeInstruction Set: Addressing Mode

7

Page 8: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Instruction SetInstruction Set

8

Page 9: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Program Memory SpaceProgram Memory Space

The programmer must be aware of the size The programmer must be aware of the size of the available memoryof the available memory

9

Page 10: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

RegistersRegisters

The programmer must know the general The programmer must know the general purpose registers and special function purpose registers and special function registers.registers.

Example: registers for storing Wireless Example: registers for storing Wireless configurationconfiguration

10

Page 11: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

I/OI/O

The programmer must be aware of the The programmer must be aware of the processor’s input and output settings.processor’s input and output settings.

What registers are assigned for bit I/O What registers are assigned for bit I/O settingsetting

11

Page 12: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

InterruptsInterrupts

An interrupt causes the processor to An interrupt causes the processor to suspend execution of the main program, and suspend execution of the main program, and jump to an Interrupt Service Routine.jump to an Interrupt Service Routine.

The programmer must know the name of The programmer must know the name of the ISR.the ISR.

Example: Timer, Port Interrupt, ADC Example: Timer, Port Interrupt, ADC Interrupt and Data Ready interruptInterrupt and Data Ready interrupt

12

Page 13: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Operating SystemOperating System

An operating system is a layer of software An operating system is a layer of software that provides low level services to the that provides low level services to the application layerapplication layer

13

Page 14: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Development EnvironmentDevelopment Environment AssemblerAssembler CompilerCompiler DebuggerDebugger Device ProgrammerDevice Programmer EmulatorEmulator Development boardDevelopment board Breakout boardBreakout board

14

Page 15: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Selecting MicrocontrollersSelecting Microcontrollers

15

Page 16: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Standard Processors - PeripheralsStandard Processors - Peripherals

TimerTimer Question:Question:

16

Page 17: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

TimerTimer

17

Page 18: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

TimerTimer

18

Page 19: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Peripheral - PWMPeripheral - PWM

QuestionQuestion

19

Page 20: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Stepper MotorStepper Motor

20

Page 21: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Stepper MotorStepper Motor

21

Page 22: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ADCADC An analog-to-digital converter (ADC, A/D or

A2D) converts an analog signal to adigital signal, and a digital-to-analog converter (DAC, D/A or D2A) does the opposite.Such conversions are necessary because, while embedded systems deal with digitalvalues, an embedded system’s surroundings typically involve many analog signals.

22

Page 23: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ADCADC

23

Page 24: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ADCADC

24

Page 25: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

SolutionSolution

25

Page 26: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ADC: Successive ApproximationADC: Successive Approximation

26

Page 27: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

SolutionSolution

27

Page 28: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

UARTUART A UART (Universal Asynchronous Receiver/Transmitter)

receives serial data and stores it as parallel data (usually one byte), and takes parallel data and transmits it as serial data

Require creating a routine to send data serially over an I/O port, making use of a timer to control the rate. It would also require using an interrupt service routine to capture serial data coming from another I/O port whenever such data begins arriving.

28

Page 29: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

What is wrong with serial port?What is wrong with serial port? Because serial ports are Because serial ports are asynchronousasynchronous (no clock data (no clock data

is transmitted), devices using them must agree ahead is transmitted), devices using them must agree ahead of time on a data rate.of time on a data rate.

Asynchronous serial ports require hardware Asynchronous serial ports require hardware overhead–the UART at either end is relatively.overhead–the UART at either end is relatively.

Another core fault in asynchronous serial ports is that Another core fault in asynchronous serial ports is that they are inherently suited to communications between they are inherently suited to communications between two, and only two, devicestwo, and only two, devices

29

Page 30: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

SPISPI The Serial Peripheral Interface (SPI) bus is a synchronous The Serial Peripheral Interface (SPI) bus is a synchronous

serial communication interface specification used for serial communication interface specification used for short distance communication, primarily in embedded short distance communication, primarily in embedded systems. The interface was developed by systems. The interface was developed by MotorolaMotorola and and has become a de facto standard.has become a de facto standard.

30

Page 31: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

How SPI works?How SPI works?

31

Page 32: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

SPI Logic AnalyzerSPI Logic Analyzer

32

Page 33: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

What is wrong with SPI?What is wrong with SPI? The most obvious drawback of SPI is the The most obvious drawback of SPI is the

number of pins required. Connecting a number of pins required. Connecting a single master to a single slave with an SPI single master to a single slave with an SPI bus requires four linesbus requires four lines

33

Page 34: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

I2CI2C I²C (Inter-Integrated Circuit), pronounced I-I²C (Inter-Integrated Circuit), pronounced I-

squared-C, is a multi-master, multi-slave, squared-C, is a multi-master, multi-slave, single-ended, serial computer bus invented single-ended, serial computer bus invented by Philips Semiconductor (known today as by Philips Semiconductor (known today as NXP Semiconductors)NXP Semiconductors)

34

Page 35: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

How I2C works?How I2C works?

35

Page 36: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

I2C Logic AnalyzerI2C Logic Analyzer

36

Page 37: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

I2CI2C most Imost I22C devices can communicate at C devices can communicate at

100kHz or 400kHz.100kHz or 400kHz. There is some overhead with IThere is some overhead with I22C; for every C; for every

8 bits of data to be sent, one extra bit of 8 bits of data to be sent, one extra bit of meta data (the “ACK/NACK” bit) must be meta data (the “ACK/NACK” bit) must be transmitted.transmitted.

37

Page 38: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Real Time Clock (RTC)Real Time Clock (RTC) Much like a digital wristwatch, a real-time

clock (RTC) keeps the time and date inan embedded system. Read-time clocks are typically composed of a crystal-controlledoscillator, numerous cascaded counters, and a battery backup.

38

Page 39: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

LCDLCD

39

Page 40: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Others PeripheralsOthers Peripherals

40

Page 41: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Watchdog TimerWatchdog Timer A watchdog timer (WDT; sometimes

called a computer operating properly or COP timer, or simply a watchdog) is an electronic timer that is used to detect and recover from computer malfunctions.

41

Page 42: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

AESAES AES (advanced encryption standard)AES (advanced encryption standard) Secure Microcontrollers Keep Data SafeSecure Microcontrollers Keep Data Safe Secure MCU offerings range from 8-bit to Secure MCU offerings range from 8-bit to

32-bit CPUs with dedicated encryption 32-bit CPUs with dedicated encryption engines, random number generators, and engines, random number generators, and additional features to secure communication additional features to secure communication channels and protected datachannels and protected data

42

Page 43: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

CRCCRC

A Cyclic Redundancy Check (CRC) is a A Cyclic Redundancy Check (CRC) is a verification method used to ensure that data verification method used to ensure that data being sent is not corrupted during transfer. being sent is not corrupted during transfer.

The use of CRCs is common in The use of CRCs is common in communication mediums that transmit communication mediums that transmit digital data, such as WiFi and Ethernet.digital data, such as WiFi and Ethernet.

43

Page 44: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Analog ComparatorAnalog Comparator An analog comparator is a device that An analog comparator is a device that

compares two (2) analog values and compares two (2) analog values and indicate which is greater. In electronics it is indicate which is greater. In electronics it is basically an amplifier without feedback and basically an amplifier without feedback and thus very high gain, as shown below. When thus very high gain, as shown below. When the positive input (+) is greater the output the positive input (+) is greater the output voltage is saturated to its positive supply voltage is saturated to its positive supply (logic 1), otherwise the output is saturated (logic 1), otherwise the output is saturated to is negative supply ( logic 0). to is negative supply ( logic 0).

44

Page 45: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

IrDAIrDA IrDA, similar to UART, is a standard used IrDA, similar to UART, is a standard used

for transmitting data by IR (infrared). The for transmitting data by IR (infrared). The standard is optimized based on various standard is optimized based on various factors such as resistance to environmental factors such as resistance to environmental noise, etc.noise, etc.

45

Page 46: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Hardware MultiplierHardware Multiplier

Processing of digital signals is very Processing of digital signals is very demanding. One of the biggest problems is demanding. One of the biggest problems is the multiplication required for processing of the multiplication required for processing of digital signals.digital signals.

The multipliers owing to their high The multipliers owing to their high complexities are difficult to be built-in in complexities are difficult to be built-in in the majority of micoprocessors or the majority of micoprocessors or microcontrollers. microcontrollers.

46

Page 47: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Cont.Cont. A multiplier is a part of the microprocessor A multiplier is a part of the microprocessor

or microcontroller only in the applications or microcontroller only in the applications when it is absolutely necessary, such as when it is absolutely necessary, such as digital signal processingdigital signal processing

47

Page 48: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

ContCont

The megaAVR is a series of new devices in the AVR RISC Microcontroller family that includes, among other new enhancements, a hardware multiplier. This multiplier is capable of multiplying two 8-bit numbers, giving a 16-bit result using only two clock cycles.

The component that makes a dedicated digital signal processor (DSP) specially suitable for signal processing is the Multiply-Accumulate (MAC) unit. This unit isfunctionally equivalent to a multiplier directly connected to an Arithmetic Logic Unit(ALU).

48

Page 49: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

USBUSB

The Universal Serial Bus, or USB, has grown in The Universal Serial Bus, or USB, has grown in popularity due to its simple physical layer popularity due to its simple physical layer interface, its flexibility, and ease of integrating – interface, its flexibility, and ease of integrating – both at the hardware and software levels. both at the hardware and software levels. Standardized and integrated connectors make it Standardized and integrated connectors make it easy to interface an MCU to the USB cableeasy to interface an MCU to the USB cable

49

Page 50: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

LCD controller and driver LCD controller and driver Our new LCD drivers are also ideal to drive Our new LCD drivers are also ideal to drive

touch sensitive LCDs in combination with touch sensitive LCDs in combination with an capacitive touch controller to implement an capacitive touch controller to implement touch buttons on the display touch buttons on the display

50

Page 51: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

Capacitive TouchCapacitive Touch Many modern MCU come with an Many modern MCU come with an

integrated peripheral touch controller (PTC) integrated peripheral touch controller (PTC) for capacitive touch applicationsfor capacitive touch applications

Ideal for capacitive touch button, slider, Ideal for capacitive touch button, slider, wheel or proximity sensing applications wheel or proximity sensing applications

51

Page 52: Embedded Systems Design. General Purpose Processors: Software BASIC ARCHITECTURE - Datapath BASIC ARCHITECTURE - Datapath 2

CrossbarCrossbar Silicon Labs’ patented crossbar technology Silicon Labs’ patented crossbar technology

enables maximum flexibility and allows designers enables maximum flexibility and allows designers to select needed peripherals without pin out to select needed peripherals without pin out conflicts.conflicts.

52