Você está na página 1de 99

EEE026 - Projeto de Sistemas Embutidos

Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 1

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 2


uP

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020 3
uControladores
uC

uP

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Familias de uC

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
CPU

•  ISA
•  Registradores
•  representação de dados e números

Vide unidade Tecnologia de uControladores!

EEE026 – PSE – UFMG 2020 6


Memória

•  Tipos
•  Mapas de memória
•  Extensão de memória
•  Representação de dados e números

EEE026 – PSE – UFMG 2020 7


Tipos de memória

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Espaço de Memória

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Banco de memória

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Mapa de Memória

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Mapa de Memória do MSP430

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Expansão de Memória

PCF8570 – 258x8 SRAM

SST26VF064B– 64Mb Flash

AT24c256– 32kx8 E2PROM

I2C Logic Selection Guide 2003. Philips.

EEE026 – PSE – UFMG 2020 15


Final da parte 1

EEE026 – PSE – UFMG 2020 16


EEE026 - Projeto de Sistemas Embutidos
Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 2

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 18


Representação de dados

© 2014 by M. Jiménez, R.
Palomera, & I. Couvertier
EEE026 – PSE – UFMG 2020
Representação de Números

EEE026 – PSE – UFMG 2020


Inteiro com sinal

EEE026 – PSE – UFMG 2020


Real de ponto fixo

EEE026 – PSE – UFMG 2020


Real de ponto flutuante

EEE026 – PSE – UFMG 2020


Quantização

EEE026 – PSE – UFMG 2020


EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
E/S

•  Interface com SW
•  Tipos
•  Protocolos
•  E/S mapeada em memoria

EEE026 – PSE – UFMG 2020 27


EEE026 - Projeto de Sistemas Embutidos
Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 3

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 29


Exemplo de interface de E/S

EEE026 – PSE – UFMG 2020 30


Interface de Saida

EEE026 – PSE – UFMG 2020


EEE026 – PSE – UFMG 2020
sinalizacao

EEE026 – PSE – UFMG 2020


Tempo

•  Clock
•  Reset
•  Interrupção
•  Bootstrap

EEE026 – PSE – UFMG 2020 34


Clock

EEE026 – PSE – UFMG 2020


Cristal

EEE026 – PSE – UFMG 2020


EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
EEE026 – PSE – UFMG 2020
Final da parte 3

EEE026 – PSE – UFMG 2020 49


EEE026 - Projeto de Sistemas Embutidos
Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 4

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 51


Início e Reset

•  POR – power-on reset:


–  reset de dispositivo ao ligar a F.A.
•  PUC – power-up clear:
–  Após um POR ou watchdog.
•  BOR – brownout reset:
–  reset devido a power-up, wake-up ou variação na
queda na tensão de alimentação.
•  Diferentes eventos disparam esses sinais.
•  Geram Diferentes estados internos na CPU.

EEE026 – PSE – UFMG 2020


•  POR •  PUC
–  Dispositivo é ligado –  Após um POR
–  Supervisor de tensão –  Watchdog (overflow)
(SVS) –  Acesso a endereço de
memória reservado

EEE026 – PSE – UFMG 2020 53


Power-on Reset

EEE026 – PSE – UFMG 2020


POR simples

EEE026 – PSE – UFMG 2020


Reset

VDD
τ = R×C
τ

treset α (VDD, R×C)


EEE026 – PSE – UFMG 2020
CI para POR

EEE026 – PSE – UFMG 2020


EEE026 – PSE – UFMG 2020
Brownout Reset

EEE026 – PSE – UFMG 2020


POR+PUC para MSP430x2xx

EEE026 – PSE – UFMG 2020


Interrupção

•  Conceito
–  Geralmente as prioridades são fixas em uC
–  São vetorizadas
–  Apresentam certa latência
•  Tipos
–  Reset
–  NMI
–  Mascaráveis
•  Usos
–  Fontes internas e/ou externas
EEE026 – PSE – UFMG 2020 61
Bootstrap

•  Execução após um POR


–  Programas bootstrap loader automaticamente carregam
programas (e dados) de uma memoria externa para a
memória interna.
–  Programa em memória interna para comunicação da CPU
com um sistema de desenvolvimento.
•  Infineon:
–  The on-chip firmware stored in the BootROM is the first software to be executed by the
CPU after reset. The BootROM of the XMC4000 family provides a number of different
boot modes including the CAN Bootstrap Loader (BSL) mode.
–  Using the CAN Bootstrap Loader it is possible to load code or data into the internal RAM
of the device via the MultiCAN interface. This document describes how to program user
code into the internal flash of XMC4000 devices via the CAN BSL.

EEE026 – PSE – UFMG 2020 62


Bootloader

•  No MSP430:
–  “This bootstrap loader (BSL) provides a method to program
the flash memory during MSP430 project development and
updates. It can be activated by a utility that sends commands
via the familiar UART protocol. The BSL enables the user to
control the activity of the MSP430 and to exchange data
using a personal computer or other device that supports a
UART protocol.”
–  “this code is stored in a special factory-masked boot ROM.
The BSL cannot ever be erased.”

EEE026 – PSE – UFMG 2020 63


Final da parte 4

EEE026 – PSE – UFMG 2020 64


EEE026 - Projeto de Sistemas Embutidos
Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 5.a

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 66


Energia

•  Modos de operação
•  Consumo
•  Fontes de alimentação
•  Reguladores

EEE026 – PSE – UFMG 2020 67


Modos de operação

•  CPU ativa ou inativa


•  Periféricos desabilitados
•  Interrupções
•  Sinais de clock

EEE026 – PSE – UFMG 2020 68


EEE026 – PSE – UFMG 2020
Consumo de Energia

•  Operação de circuitos digitais CMOS


•  Fontes de alimentação

EEE026 – PSE – UFMG 2020 70


Dissipação de potência em CMOS

P = 12 C ⋅ Vdd 2 ⋅ a ⋅ f + I sc ⋅Vdd + Ileak ⋅Vdd


!##"## $ !"
# # $ !#"# $
dinâmica curto−circuito estática

EEE026 – PSE – UFMG 2020 71


Fontes de Energia em SE

EEE026 – PSE – UFMG 2020


PMIC

•  Power Mgmt. IC
•  Gerencia as diversas
fontes de energia e
alimentação de um SE

EEE026 – PSE – UFMG 2020 73


PMIC

EEE026 – PSE – UFMG 2020 74


Baterias: químicas

•  Primárias:
–  Alcalinas
•  Secundárias
–  NiCd
–  NiMH 1.8 Volt Technology – Benefits. AN550. Microchip.

–  Li+: Li-Ion, LiPo, LiFo

EEE026 – PSE – UFMG 2020 75


Baterias – descarga

EEE026 – PSE – UFMG 2020 76


Baterias - carga

EEE026 – PSE – UFMG 2020 77


Baterias – ciclos de carga

1.8 Volt Technology – Benefits. AN971. Microchip

EEE026 – PSE – UFMG 2020 78


Baterias - proteção

•  Baterias a base lítio


precisam de cuidado
extra em uso.
–  Não pode descarregar
completamente.
–  não pode baixar de um
certo nível de tensão.

EEE026 – PSE – UFMG 2020 79


Final da parte 5.a

EEE026 – PSE – UFMG 2020 80


EEE026 - Projeto de Sistemas Embutidos
Organização de uC

Diógenes C. da Silva Jr.


DEE/UFMG
diogenes@ufmg.br

Parte 5.b

EEE026 – PSE – UFMG 2020


Sumário

•  CPU
•  Memória
•  Entradas e Saídas
•  Tempo
•  Energia

EEE026 – PSE – UFMG 2020 82


Fontes de Alimentação

EEE026 – PSE – UFMG 2020


Reguladores de Tensão

EEE026 – PSE – UFMG 2020


Reguladores Lineares

AN660 - Regulator Topologies for Battery-Powered Systems. Maxim Integrated.

AN751 - LINEAR REGULATORS IN PORTABLE APPLICATIONS


EEE026 – PSE – UFMG 2020 85
Reguladores chaveados

AN751 - LINEAR REGULATORS IN PORTABLE APPLICATIONS


EEE026 – PSE – UFMG 2020 86
FA para SE portateis
•  Power a Digital Still Camera with
2AA Batteries and a Single Integrated
Power Supply

•  AN909 – Maxim Int.

EEE026 – PSE – UFMG 2020 87


FA para sistemas industriais

EEE026 – PSE – UFMG 2020 88


FA para sistemas automotivos

EEE026 – PSE – UFMG 2020 89


Distribuição da Energia em SE

EEE026 – PSE – UFMG 2020


EEE026 – PSE – UFMG 2020
Layout

EEE026 – PSE – UFMG 2020


Supervisory Circuits

•  A supervisory circuit can be used for several different


applications, but there are two primary functions that a
supervisor provides:
–  During a power up sequence, the device holds a
microcontroller in reset until the system power has come up
to the correct level and stabilized (the POR function), and
–  reset the controller immediately if the power drops below a
nominal value either at power down or during a ‘brown-out’
condition.
•  Some supervisor devices also provide things like low
battery warning, watchdog timer and other more
elaborate functions.EEE026 – PSE – UFMG 2020 93
POR+BO

Understanding and Using Supervisory Circuits. AN686. Microchip.

EEE026 – PSE – UFMG 2020 94


Circuitos Supervisores

•  What would happen to the microcontroller (or other


devices in the system) if there was noise on the supply
voltage as it powers up?
•  What would happen if there is a glitch on the power
supply while the system is running?
•  What does the microcontroller do when the system
power is turned off?

EEE026 – PSE – UFMG 2020 95


Principais Problemas
1.  Noisy environments, unreliable power or battery power in many microcontroller
applications may create a variety of system-level problems that can be eliminated
with power-on reset or brown-out detect functions found on the supervisors. The
power-on reset devices are designed to hold the microcontroller in reset until the
supply voltage reaches a predetermined operating level and stabilizes.

2.  Supervisor circuit protects from brown-out conditions occurring as a result of supply
voltage drops below the safe operating level. It eliminates a slowly decaying power
supply which causes the microcontroller to begin executing instructions without
enough voltage to sustain its SRAM, producing indeterminate results, and helps
prevent a runaway system or helps back up critical data during power fluctuations.

EEE026 – PSE – UFMG 2020 96


–  Voltage detectors simply indicate that a voltage is above or below a specific
value.
–  A power-on reset IC monitors a supply voltage and resets or turns off another
device, like a microprocessor, if the supply voltage is low.
–  A multivoltage monitoring IC provides voltage monitoring for several voltage
rails. a complex system can maintain four or five supply voltages (12V, 5V, -5V,
3.3V, and 2.5V, for example).

–  Most processor data sheets provide a minimum reset period, during which the
device should remain out of operation until the local power supply has stabilized
for a specified interval (200ms is typical). The processor is not guaranteed to
correctly operate if brought out of reset too quickly. During this reset interval,
the processor's clock is allowed to stabilize and the internal registers have time
to load properly.

3.  Even the best-designed systems are subject to errors other than power
supply fluctuation. Bugs in the program code, incorrect clocking signals,
or poorly responding peripherals can all force the processor out of its
normal operating code or into a dead-end loop. When a processor leaves
the expected instruction path, it may have no way of knowing that it is
incorrectly operating and needs to restart.

–  A common industry-standard timeout period for watchdogs is 1.6s, but suppliers


offer options from 1ms to 1 minute.
EEE026 – PSE – UFMG 2020 97
•  To solve this problem, many supervisor ICs (like the industry-standard MAX823
family and newer MAX6316–MAX6318 devices) include a watchdog timer as a
low-cost means for ensuring that the processor is executing within the proper
code boundaries. This scheme requires that the processor update a watchdog
logic input continually, within a specified minimum time period. Otherwise, the
supervisor issues a system alert.
•  MAX6316/MAX6320: Watchdog + Voltage Monitoring. 5-Pin µP Supervisory
Circuit with Watchdog, Manual RESET, and Active-Low Open-Drain RESET
Output

•  The Why, What, How, and When of Using Microprocessor Supervisors. Tutorial. Maxim. 2018.

EEE026 – PSE – UFMG 2020 98


Final da parte 5.b

EEE026 – PSE – UFMG 2020 99

Você também pode gostar