8/5/2013
MLab MLa b - Emb Embedde edded d Sol Solutio utions ns Địa chỉ: Số 19 ngõ ng õ 204, Lê Thanh Nghị, Hai Bà Trưng, Hà Nội
MLab – Embedded Solutions www.mlab.com.vn
1
MSP430 căn bản
MLab – Embedded Solutions www.mlab.com.vn
2
1
8/5/2013
Nội dung 1. Giới thiệu về MSP430 2. Giới thiệu về phần mềm CCS và Grace 3. Cổng vào ra (GPIO) • Lab 1: Nhấp nháy LED
4. Module tạo clock • Lab 2: Thay đổi tần số clock của hệ thống
3
Giới thiệu về MSP430 • Lịch sử phát triển • Đặc điểm nổi bật • Cấu trúc bên trong • Các ứng dụng tiêu biểu • Công cụ phát triển phần cứng và phần mềm • Định hướng lộ trình nghiên cứu
4
2
8/5/2013
Giới thiệu về MSP430 (tiếp)
Lịch sử phát triển • Hãng sản xuất: Texas Instruments (www.ti.com) • Ngày sinh: 14/02/1994 • Ngày kỷ niệm hàng năm: 30/4 • Khởi điểm là 1 chip MCU được đặt hàng thiết kế
cho một ứng dụng đo khí Gas tại châu Âu • Nhận được rất nhiều giải thưởng quốc tế do các hiệp hội khoa học, tạp chí khoa học trao tặng
5
Giới thiệu về MSP430 (tiếp)
Đặc điểm nổi bật • Công suất tiêu thụ năng lượng siêu thấp • Tích hợp nhiều ngoại vi tính năng cao • Rất đa dạng về chủng loại chip, phù hợp với sự
lựa chọn cho hầu hết các loại ứng dụng • Thời gian tiếp cận và phát triển ứng dụng rất ngắn
6
3
8/5/2013
Giới thiệu về MSP430 (tiếp)
Cấu trúc bên trong • ADC10/12/16/24-bit • DAC12-bit • Op Amp, LCD driver • RF transceiver • AES128 • Capacitive touch IO • USB2.0, Real Time Clock • Bộ nhớ FRAM 7
Giới thiệu về MSP430 (tiếp) Utility Metering Electricity Meters Gas Meters Flow Meters Smart Meters
Wireless Applications Remote Sensors Communication Controllers RFID
Consumer Electronics Portable Electronics Remote Controls Personal Care PC peripherals
Ứng dụng tiêu biểu Thousands of applications are enabled by MSP430 MCUs Differentiation is possible with MSP430 MCU’s Ultra-Low Power performance, high analog & digital peripheral integration, and easy-to-use tool chain.
Energy Harvesting Renewable Energy Battery-less devices Solar, thermal, vibration, etc
Portable Medical Blood Glucose Meters Thermometers Heart-Rate Monitors Implantable Devices
Sensors & Security Smoke Detector Motion Detector Vibration Detector Smart Sensors
Personal Health & Fitness Sports Watches Pedometers Calorimeters Dive watches
8
4
8/5/2013
Giới thiệu về MSP430 (tiếp) Ultra-Low Power F1xx
8MHz 1-60kB Flash Up to 10kB RAM Up to 48 GPIO ADC10/12 Comp, DAC12, Timers, DMA, MPY. USART
Ultra-Low Energy F2xx
16MHz 1-120kB Flash Up to 8kB RAM Up to 64 GPIO ADC10/12 SD16, Comp, DAC12, Timers, DMA, MPY, OpAmp, USCI, USI
F4xx
F5xx
F6xx
FR57xx
Metering/ Medical
USB
USB+LCD
Emb. FRAM
8/16MHz 4-120kB Flash Up to 8kB RAM Up to 80 GPIO ADC10/12 SD16, Comp, DAC12, Timers, DMA, MPY, OpAmp, USCI, USART, ESP430, ScanIF
25MHz 8-256kB Flash Up to 18kB RAM Up to 87 GPIO ADC10, Comp, DAC12, PMM, Timers, DMA, MPY, USCI, USB, 5V I/O, Hi-res PWM
25MHz 8-256kB Flash Up to 18kB RAM Up to 74 GPIO ADC10/12, SD24, Comp, Timers, DAC12, PMM, DMA, MPY, USCI, USB, LCD
FR59xx Wolverine
24MHz 4-16kB FRAM Up to 1kB RAM Up to 33 GPIO ADC10, Comp, Timers, DMA, MPY, USCI, FRAM, MPU
16MHz 32-64kB FRAM Up to 1kB RAM Up to 40 GPIO ADC12, Comp, Timers, CRC16, AES256, CapTouch I/O, DMA, MPY, USCI, FRAM, MPU Coming soon…
Value Line
Emb. RF
Low Voltage
G2xx3
CC430
L092
CapSense I/O & USCI
MCU+RF SoC
Native 0.9V
16MHz 0.5-16kB Flash Up to 512 B RAM Up to 24 GPIO ADC10, Comp, Timers, USCI, CapTouch I/O
20MHz 8-32kB Flash Up to 4kB RAM Up to 44 GPIO ADC12, PMM, Comp, MPY, DMA, USCI, emb. RF, LCD
4MHz Up to 2kB RAM or ROM Up to 11 GPIO Analog Pool (ADC8, DAC8, Comp, SVS), Timers, Native 0.9V operation
Ultra-Low Power -High integration - Easy-to-use tools
MSP430
Utility Meters
Wireless & Automotive
Portable Medical
Consumer Electronics
Health & Fitness
Sensors & Security
ti.com/msp430
9
Giới thiệu về MSP430 (tiếp) Các dạng
packages
10
5
8/5/2013
Giới thiệu về MSP430 (tiếp) LaunchPad & BoosterPack Ecosystem Complete development k it for $9.99 •
MSP-EXP430G2 LaunchPad provides all of the HW and SW needed to get started! • Supports MSP430G2xxValue Line MCUs • F ea tu re s: • On-board emulation • 20-pinDIP socket • On-board LEDs & switches • Includes 2 MCUs • MS P4 30 G2 55 3 Blast off @ • MS P4 30 G2 45 2
ti.com/launchpad
Growing Ecosystem of BoosterPacks • •
Many plugin modules are available, with more coming soon! Featuring Capacitive Touch, Wireless & other technologies!
eZ430 Starter Kits
Experimenter’s Boards Highly int egrated development k its for evaluating MSP430 devices Experimenter’s Bpards featire selected MSp430 device s and additional hardware components for easy system evaluation and prototyping! Perfect for learning a new architecture or testing the capabilities of a device family. F5529 USB Experimenter’s Board - BasedonMSP430F5529 - Complete USB development kit - On-board emulation - SD card reader, captouch & more! - $149
CC430Experimenter’sBoard - Based on CC430 MCU+RF SoC - Includes a Base Board & Daughter Board - On-board emulation - Complete RF development kit - $149
FRAMExperimenter’sBoard - BasedonMSP430FR5739 - Featuring unique FRAMmemory - On-boardemulation - On-boardsensors - $49
See them all @ ti.com/msp430tools
Target Boards & Emulation Tools
Features onboard emulation and unique form factors. • Embedded Emulation means smaller form factors, allowing the kit to be the same size as a USB stick, and only require 2 pins for programming/debugging. eZ430-RF2500 - Based on MSP430F2274 - Plus CC2500 2.4GHz RF - On-board switch & LED -$49
eZ430-Chronos - Based on CC430 - Sub-1GHz RF - Integrated sensors - Reprogrammable - $49
See them all @ ti.com/ez430
One tool to rul e them all. MSP430 Flash Emulatio n Tool The MSP-FET430UIF can program & debug all MSP430 devices when paired with the appropriate target board. Target boards are available for all MSP430 devices, and feature a ZIF target socket for interfacing with various pinouts and package types. Production programmers, such as the MSP-GANG are also available. These kits enable quicker time to market and can program 8 targets at once! MSP-FET430UIF
eZ430-F2013 - BasedonMSP430F2013 - Detachable target board - On-board switch & LED - $20
MSP-TS430xyz
MSP-FET430Uxyz
11
Giới thiệu về MSP430 (tiếp) MSP430 IDEs
MSP430Ware – A collection of MSP430 resources Windows & Linux support -
Featuring MSP430Ware Grace UL P A dv is o r More…
Continued collaboration with IAR -
Integrating MSP430Ware contentinto IAR Up-to-date device support
Increased support for MSPGCC -
Free, Open Source & community-supported Up-to-date device support C om in g so on – code examples, projects & other resources
Software Tools for Ultra-Low Power (ULP)
Everything you need to become an MSP430 expert delivered in an intuitive & sleek GUI. Find documentation & software resources quickly & easily: • Featuring Brand New Driver Library • C Code Examples • Grace templates • Datasheets • User Guides • HW Design Files Now available!!! Integrated into CCSv5.2 and later
Other MSP430 Software Tools GraceTM Code Generation Tool for enabling & configuring GPIO and peripherals. Integrated into CCSv5
ULP Advisor TM -
Checks your codeagainst a “ULP Checklist” Currently 15 ULP Rules, with a growing backlog of new rules Highlights areas of improvement and points to helpful resources such as code examples, doc umentation & more Integrated into CCSv5.1and later
Other software packages include:
EnergyTraceTM -
-
-
During debug, EnergyTrace reports back current status of the CPU, peripherals & timers. Allo ws developers to correlate power-relevant information to the MCU program code C om in g So on …
RTOS
• • • •
Capacitive touch library Energy Library (AFE2xx) USB Developer’s Package RF software resources
See the complete portfolio of MSP430 Software Tools @
ti.com/msp430software
12
6
8/5/2013
Giới thiệu về MSP430 (tiếp) Tài liệu
và cộng đồng
• Trang web chính: www.ti.com/msp430 • Blogs TI Blog: www.ti.com/430blog Community Blog: www.43oh.com
• E2E Forums: http://e2e.ti.com http://diendanti.com
13
Giới thiệu về MSP430 (tiếp)
Định hướng lộ trình học tập, nghiên cứu • Căn bản: MSP430 Value line • Nâng cao: MSP430F5xxx • Theo chuyên đề , ứng dụng: • Thiết kế phím bấm kiểu cảm ứng điện dung • Thiết kế giao diện đồ họa • Lưu trữ dữ liệu trên thẻ nhớ SD • Giám sát, điều khiển bằng mạng wifi • Giám sát, điều khiển bằng mạng RF • Nhúng hệ điều hành thời gian thực (RTOS) 14
7
8/5/2013
Giới thiệu MSP430 LaunchPad USB Emulator Connection
Embedded Emulation
• 16kB Flash • 512B RAM • 2 Timer_A3’s • 8 Ch. Comp_A+ • 8 Ch. ADC10 • USCI
6-pin eZ430 Connector Crystal Pads Chip Pinouts
Part and Socket
Power Connector
P1.3 Button LEDs and Jumpers P1.0 & P1.6
Reset Button
15
Giới thiệu về CCS • CCS = Code Composer Studio (www.ti.com/ccs) • Hãng phát triển: Texas Instruments • Là IDE (Integrated Development Environment)
cho tất cả các dòng chip vi xử lý, vi điều khiển và DSP của TI • Có phiên bản giới hạn dung lượng code (16 hoặc 32KB) và phiên bản giới hạn thời gian sử dụng (90 days)
16
8
8/5/2013
Giới thiệu về Grace • Là công cụ phần mềm ở dạng giao diện đồ
họa, cho phép người dùng cấu hình các ngoại vi của MSP430 một cách rất dễ dàng và nhanh chóng (www.ti.com/grace) • Hoàn toàn miễn phí • Được tích hợp sẵn trong CCSv5.x • Có bản chạy độc lập để có thể sử dụng với các IDE khác như IAR 17
Bài thực hành số 1 (GPIO) Cơ sở lý thuyết (tài liệu “MSP430x2xx Family User’s Guide”, chương 8 “ Digital I/O”)
• Thanh ghi P1DIR: định hướng của chân cổng
(0 = vào, 1 = ra) • Thanh ghi P1OUT: chứa mức logic của đầu ra
(1 = đưa ra điện áp cao, 0 = đưa ra điện áp thấp)
18
9
8/5/2013
Bài thực hành số 1 (GPIO) Lab 1: Nhấp nháy một trong các LED nối với các tín hiệu P1.0 & P1.6 (1 = sáng, 0 = tắt) Thanh
ghi P1DIR = … Thanh ghi P1OUT = … Tạo trễ bằng phần mềm, có thể sử dụng hàm có sẵn của IDE __delay_cycles(số chu kỳ)
19
Bài thực hành số 1 (GPIO)
Lab
1: • Nháy LED1 hoặc LED2 Thay đổi số chu kỳ
20
10
8/5/2013
Bài thực hành số 2 (Clock) Cần phân biệt
các khái niệm: Clock source
và clock signal • Clock source là nguồn cung cấp dao động đầu
vào cho module tạo xung nhịp • Clock signal là xung nhịp được tạo ra ở đầu ra
21
Bài thực hành số 2 (Clock) Cơ sở lý thuyết (tài liệu “MSP430x2xx Family User’s Guide”, chương “Basic Clock Module”)
22
11
8/5/2013
Bài thực hành số 2 (Clock)
Clock sources: • Thạch anh (Crystal) • Dao động ngoài (External clock) • Dao động nội: DCO (tần số cao), VLO (tần số thấp)
Clock signals: • MCLK: dùng cho CPU và hệ thống • SMCLK: dùng cho các ngoại vi • ACLK: dùng cho các ngoại vi
MSP430 đã căn chỉnh sẵn một số tần số dao động nội phổ biến như 1MHz, 8MHz, 12MHz, 16MHz
23
Bài thực hành số 2 (Clock)
Lab 2: Thay đổi clock của bài thực hành số 1 • 8MHz • 16MHz
24
12
8/5/2013
Thank you !!!
MLab – Embedded Solutions www.mlab.com.vn
25
13