CS计算机代考程序代写 arm GPU compiler Hardware Platforms for IoT

Hardware Platforms for IoT

Syllabus
This module will cover the following
• What is a hardware platform
• Types of memory
• Power saving techniques
• Types of sensors
• Analog-to-digital conversion
2 © 2020 Arm Limited

What is a hardware platform?
A set of compatible physical components that determine the functionality of a device
Key characteristics
Integrated platforms
CPU
GPU IMU
Main platform with extension
BLE
Transceiver MCU
ADC DSP MCU Memory


Dictates what type of software can be run on a particular device
Same functionality might be programmed once for different platforms, but the compiler must produce machine language that can be executed by the specific target platform
3
© 2020 Arm Limited
Memory

Designing a hardware platform
Application type/cost → choice of CPU/GPU
Energy constraints
→ line power/battery
Connectivity
→ Ethernet/4G/BLE
I/O → Serial/GPIO Debugging
→ JTAG/Serial © 2020 Arm Limited
4G modem
Wi-Fi/BLE
SPI
I2C Integrated CPU/GPU
GPIO
Debug serial
4

Microcontroller architectures
MCUs typically implement the Harvard architecture
• •
Integrated circuit with processing unit(s), memory block, analog/digital I/O, and interfaces to peripherals
Processing is undertaken by computational modules (ALU) and control units
ALU
Instruction memory
Control Data unit memory
I/O
5
© 2020 Arm Limited

Types of memory
Depending on the purposes served, different types of memories are embedded into MCUs
EEPROM: Non-volatile memory used for data storage; byte erasable
Flash: Non-volatile memory used to store code; block erasable
DRAM: Volatile data memory; high storage density
SRAM: Static RAM; volatile but has remanence; faster than DRAM
6 © 2020 Arm Limited

Memory limitations
Due to size and cost constraints, MCUs have limited memory
• Example: STM32L053C6
• Based on Arm Cortex-M0+ architecture • 64KB Flash, 2KB EEPROM, 8KB SRAM
Flash (program)
SRAM (data)
• Although Flash memory is much larger than SRAM, only 64KB are available for the program that is relatively little
• Architecture optimization such as compressed instruction sets and compiler optimization techniques are used to reduce program size
7 © 2020 Arm Limited
EEPROM
(data)

Energy consumption

Several factors influence the energy consumption of a hardware platform, including
• Power drained by MCU during operation
• What fraction of the time the MCU is active • Heat dissipation and environment
temperature (that may require cooling)
However, a processor that drains more power P, but is less frequently active might be more energy efficient. We can compute energy E consumed over a period T as

𝐸 = # 𝑃 𝑡 𝑑𝑇 !

Example: Two MCUs operating at 5V nominal voltage, each powered by a 2Ah battery
• M1 operates continuously, consumes 0.1W • M2 idle 90% of time, consumes 1W when
active
The total energy budget is 10Wh. Both MCUs have a lifetime of 100h.
Recall that
Power (Watts) = Voltage (Volts) • Current (Amperes)
8
© 2020 Arm Limited

Power saving
Different techniques can be implemented to reduce energy consumption
Switching off peripherals when not in use, e.g., wireless interfaces if no TX/RX Implementing MCU sleep modes that turn off (part of) functionality when not required Adaptive voltage/frequency scaling to reduce/enhance computing performance as required Power consumption optimization at program compilation time (software)
Power-efficient circuit design (manufacturing)
9 © 2020 Arm Limited

Sleep modes
Multiple low-power/sleep modes available in modern MCU
MCU does not process data all the time
• Each low-power mode brings different power consumption reduction at the cost of a performance penalty
• Wake-up time increases as performance decreases – MCU needs to respond to interrupts
• The number of wake-up sources decreases as performance decreases
Example: STM32L0 devices implement five low-power modes
LPRun
Sleep
LPSleep
Stop
Standby
Performance
1
2
3
4
5
Power consumption
4
5
3
2
1
Wake-up time
2
1
4
3
5
Wake-up sources
1
2
3
4
5
(1) Best; (5) Worst
10 © 2020 Arm Limited

Dynamic voltage and frequency scaling (DVFS)
• Linear relationship between power consumption P and operational frequency f and quadratic relationship between power consumption and operational voltage V, i.e.,
𝑃 ≈ 𝐶×𝑉!×𝑓,
where C is the switching capacity of the logic circuit controlled.
• DVFS can also reduce heat dissipation.
• Current processor architectures allow for multiple voltage/frequency pairs.
11 © 2020 Arm Limited

Sensors
Sensors are devices that measure a particular property of the environment and convert that into an electrical output
Typically sensors have a linear function between the physical property measured and the electrical output
The sensitivity of a sensor indicates the minimum value of the measured input that can produce a certain output signal
An analog-to-digital converter employed to turn a sensor output into signals that can be processed by MCUs
Different physical phenomena underpin the operation of sensors, e.g., the piezoelectric effect (accumulation of electric charge when mechanical pressure is applied)
12 © 2020 Arm Limited

Types of sensors
● Push-button/switch ● Temperature
● Acceleration
● Pressure
● Optical/photodiode ● Humidity
13 © 2020 Arm Limited

Input/Output
I/O defines how an MCU can interact with the environment
• Different I/O protocols are available
• Universal Asynchronous
Receiver/Transmitter (UART) – two wires to send/receive data between devices
• Serial Peripheral Interface (SPI) – any number of bits can be sent/received without interruption
• Inter-Integrated Circuit (I2C) – combines features of UART and SPI
• General purpose I/O (GPIO) – controllable by user at run time.
UART
SPI
MCU
GPIO
I2C
14 © 2020 Arm Limited

GPIO
Can be set up to accept or source different logic voltage levels, through which MCU can control peripherals or receive external input/interrupts.
If pins are configured for interrupts, they can be used to move wake-up from low-power/sleep modes. Can be grouped into a GPIO port and controlled as such.
Pulse-width modulation (PWM) employed when the linear processes must be controlled (e.g., fans)
Limited to low-current applications → transistors and relays used to help drive higher current loads.
15 © 2020 Arm Limited

Pulse-width modulation
Reducing average power output by switching on/off at high rates
• Duty Cycle – the fraction of one period T during which a signal is active:
𝐷 = 𝑃𝑊 ×100 [%] 𝑇
• Frequency – rate of periods: 𝑓 = 𝑇1 [ H z ]
• Average voltage: 𝐷 𝑉”#$ =𝑉%&×100
16 © 2020 Arm Limited

Analog-to-digital conversion
Sensors sometimes output continuous signals; microcontrollers require discrete input
Sampling
Sample and hold circuit
• Stores electric charge in a capacitor
• A clock-controlled switching device, e.g., a field
effect transistor (FET)
• A buffer amplifier to ensure voltage across capacitor is proportional to the input
• •
Sampling involves taking snapshots of an input at discrete time instants
The inverse of the period between two sampling instances is called the sampling frequency
17
© 2020 Arm Limited

Aliasing
Different signals becoming indistinguishable when sampled
• •
Impossible to reconstruct the original input if the sampling frequency is too small.
Nyquist criterion: sampling frequency should be at least twice the highest spectral component of the sample signal to avoid aliasing.
18
© 2020 Arm Limited

Quantization
Sampling is only one part of analog-to-digital conversion
Mapping sampled values to countable sets
• The sampled signal may result in a large number of discrete values
• Quantization maps such large sets to smaller ones that are countable
• This allows representing a signal on a finite number of bits, but often introduces errors
• The sampled signal is fed to a bank of operational amplifiers that compare it to fractions of the maximum reference voltage
3-bit quantizer
19 © 2020 Arm Limited

ADC resolution
The number of bits used to represent a sample value
The larger the number of bits, the better the precision
• Resolution typically expressed as volts per step 𝑄 = 𝑉max − 𝑉min
2#
• This is effectively the ratio between the representable voltage range and the total number of levels (n is the number of bits)
• Example:
An 8-bit quantizer working with a 0–3V range
has a resolution 𝑄 = $⁄ = 46.875mV/step %&
Quantization error of a 3-bit ADC
20 © 2020 Arm Limited

Signal-to-noise ratio (SNR)
• Thequantizationerrorwilltranslateintonoisefigures
• ToappreciatehowgoodanADCperforms,wecalculateitssignal-to-noiseratioas
𝑆𝑁𝑅 = 20 log 𝑉)&$*”+ [dB] ‘( 𝑉*,&)-
• TheSNRofanidealn-bitADCis
𝑆𝑁𝑅 = 𝑛 ⋅ 6.02 + 1.76
• Example: Ideal 8-bit convert has an SNR of 49.92dB 21 © 2020 Arm Limited

Digital-to-Analog Conversion (DAC)
The inverse process of converting a digital signal into its analog equivalent
• This is typically a continuous voltage, but certain DACs are also able to produce complex waveforms
• Sometimes digital to analog conversion can be emulated through PWM, for instance to continuously ramp up a voltage in order to drive a motor
• DAC performance indicators include:
• Dynamic range: difference between the largest and smallest signals
produced
• Resolution: number of output levels that can be reproduced
• Total harmonic distortion and noise introduced to the reproduced signal
22 © 2020 Arm Limited