If you can't read please download the document
Upload
crisurdiales
View
1.200
Download
0
Embed Size (px)
Citation preview
Microcontrollers: The brain of the bot MSP430
Cristina UrdialesDepartamento de Tecnologa ElectrnicaUniversidad de Mlaga
INTRODUCTION
What is a microcontroller?
0
MICROPROCESSOR
MICROCONTROLLER
INTRODUCTION
What is a microcontroller?
MICROCONTROLLER
TRADITIONAL CIRCUIT
INTRODUCTION
Types of microcontrollers
GENERAL PURPUSE, LOW COST
ULTRALOW POWER CONSUMPTION
AVERAGE PERFORMANCE
Ethernet, VGA, LCD, Touch-screen, etc
Standard architectures, Limited OS
HIGH PERFORMANCE
Linux, windows CE,
High graphic performance
As powerful as a few years old PC
DSPs
MIXED ARCHITECTURE
DSP+MicroprocessorsFPGAs
Free Hardware
INTRODUCTION
Ultra low power consumption: Examples
Devices of limited weight
Device fed with button battery (80 mAH). Average power consumption: 8 uA => 1,14 years
Devices requiring long term operation:
Wireless sensor network: required life 8 years. Average power consumption 200 uA. => Battery required 15.000 mAH.
INTRODUCTION
Ultra low power consumption: Examples
MSP430 TI
114
MSP430 TI
MSP430 TI
MSP430x1xx Features
Ultra Low Power Consumption
- Feeding range: 1,8 3,6 V- Several ULPC modes
Core: CPU RISC 16 bits
- High processing performance- Memory optimization
High performance periferals: ADCs, TIMERs, USARTs, comparers, battery level indicators, I2C ...
Flexible clock system
JTAG integrated
Low cost
- Development system around 50- Microcontrollers 1-3
MSP430 TI
MSP430x1xx Features
Von Neumann architecture
Data and Address buses: 16 bits
Data format .B and .W
MSP430 TI
MSP430x1xx Features
MEMORY MAP
REGISTERS
MSP430 TI
MSP430x1xx Features
MODE
REP.
DESCRIPTION
EXAMPLE
Valid for
Register
Rn
Data contained in Rn
MOV R10,R11
O y D
Indexed
X(Rn)
Data in (Rn+X)
MOV 2(R5),6(R6)
O Y D
Symbolic
ADDR
Data in (PC+X) (X given by assembler)
MOV EDE, TONI
O Y D
Absolute
&ADDR
Data in address ADDR
MOV &EDE, &TONI
O Y D
Indirect ro Register
@Rn
Rn points to data
MOV @R10,0(R11)
O
Indirect and automatic increase
@Rn+
Rn points to data and increases after operation
MOV @R10+,0(R11)
O
Inmediate
#N
Data is N
MOV #45H,TONI
O
ADDRESS MODES
MSP430 TI
MSP430x1xx Features
ADDRESS MODES
MOV
EDE
TONI
&EDE
TONI
MSP430 TI
MSP430x1xx Features
ADDRESS MODES
MSP430 TI
MSP430x1xx Assembler
#include namefile
Eg. and (only C/C++)
;: Comment
ORG expr; eg. ORG $5000
label EQU expr; eg. PI EQU 3.14
DS8 size, DS16 size, DS32 size; eg. DS8 7
DB val, DW val, DL val; eg. DB 8
PUBLIC simbol, EXTERN simbol; ej. PUBLIC myvar EXTERN myvar
END
DIRECTIVES
MSP430 TI
MSP430x1xx Assembler
INSTRUCTIONS
MSP430 TI
MSP430x1xx Assembler
INSTRUCTIONS
MSP430 TI
MSP430x1xx Assembler
INSTRUCTIONS
MSP430 TI
MSP430x1xx Assembler
INSTRUCTIONS (EMULATED)
MSP430 TI
MSP430x1xx Assembler
INSTRUCTIONS (EMULATED)
MSP430 TI
MSP430x1xx Clock System
SOURCES
SIGNALS
MSP430 TI
MSP430x1xx Clock System
LFXT1
Low Frecuency: XTS=0 and XTL 32768Hz Ultra low power comsumption
High Frecuency: XTS=1 enhanced processing speed
OFF MODE: OSCOFF=1 (LFXT1CLK can't be MCLK or SMCLK)
Equal to LFXT1 in HF mode
XT2 (if available)
MSP430 TI
MSP430x1xx Clock System
LFXT1
Equal to LFXT1 in HF mode
XT2 (if available)
MSP430 TI
MSP430x1xx Clock System
MSP430x1xx. Mdulo de reloj
RC Oscillator frequency changes with T and V
OFF MODE SCG0=1 (as long as it is not the source for MCLK o SMCLK)
DCO
Digital Control
- Injected current DC main frequency forced by resistor- DCOR chooses external or inner resistor- Control Rsel0 Rsel2 => 8 values - Bits DCO0-DCO2 => adjust DCOCLK- Modulation Bits MOD0 MOD4 stabilization
MSP430 TI
MSP430x1xx Clock System
MSP430x1xx. Mdulo de reloj
DCO
MSP430 TI
MSP430x1xx Power Consumption modes
MSP430x1xx. Mdulo de reloj
Bit CPUOFF: (0/1) MCLK active/stopped
Bit OSCOFF: (0/1) LFXT1 active/stopped*Bit SCG0:(0/1) GENERADOR DC active/stopped*Bit SCG1:(0/1) SMCLK active/stopped**As long as not used for main clock signalsj.
MODE
SCG1
SCG0
OSCOFF
CPUOFF
Active
0
0
0
0
Low Power 0
0
0
0
1
Low Power 1
0
1
0
1
Low Power 2
1
0
0
1
Low Power 3
1
1
0
1
Low Power 4
1
1
1
1
MSP430 TI
MSP430x1xx Interruptions
MSP430x1xx. Mdulo de reloj
(depending on CPU state): Finish current instruction/exit LPC
Store PC in pile
Store SR in pile
Choose highest priority interruption
Reset interruption flag (if pertaining)
GIE=CPUOFF=SCG1=V=N=Z=C=0
Load interruption vector content on PC
Recover after RETI
MSP430 TI
MSP430x1xx Interruptions
MSP430x1xx. Mdulo de reloj
International Summer Workshop on microbotics 2011