MSP430 and Wake-up Receiver
MSP430
- MSP: Mixed Signal Processor
- 16 bit RISC microcontroller from Texas Instrument
- all register are 16 bit wide
- RISC: reduced instruction set computer
- only 27 basic operations in opcode, but multiple possible arguments
- some opcode examples:
- addition, subtraction (ADC, ADD, SUB)
- logical operation (AND, OR, XOR, INV)
- setting, resetting of bits (BIS, BIC)
- program calls (CALL, RETURN)
- incrementing, decrementing (INC, DEC)
- jump commands (unconditional, conditional)
- MOV command
- stack operations (PUSH, POP)
- low current consumption
- low power modes (LPM): setting microcontroller in low-current state when CPU is not in use
- fast entering and leaving of LPMs
- low-power peripherie
- ≥ 1 µA current consumption
MSP430G2553 and Lauchpad MSP-EXP430G2ET
- MSP430G2553 datasheet: https://www.ti.com/lit/ds/symlink/msp430g2553.pdf
- device specific information of MSP430G2553
- e.g. pinout and specific port functions
- MSP430G2553 Functional Blocks:
- 16 KByte Flash
- 512 Byte RAM
- 10 bit ADC
- Port P1 and P2 → 16 GPIO
- 3 Timers (2x Timer A, Watchdog Timer)
- 2 serial communication modules (UART, SPI, I²C)
- Lauchpad's product description: https://www.ti.com/lit/ug/slau772/slau772.pdf
- Lauchpad's features:
- compatible with MSP430G2553
- programmer for several MSP430
- LEDs (red, green, RGB)
- push buttons (1 reset button, 1 user defined)
- 32.768 kHz crystal
-
Set the jumpers accordingly
- GND: GND connection between programmer (top) and MSP430 (bottom)
- 5 V: leave disconnected, no 5 V needed, 5 V can damage MSP430 pins!
- 3.3 V: supply voltage for MSP430
- RXD & TXD: UART pins, see chapter 7, must be connected horizontally, otherwise UART pins are reversed
- SBWTDIO & SBWTCK: Spy-Bi-Wire programming interface
-
Pins P2.6 and P2.7 are connected to crystal oscillator and cannot be used as normal in- and outputs.
- Pullup resistor on user button P1.3 is removed → higher current consumption in sleep mode, when not removed.
Code Composer Studio
- from Texas Instruments recommended IDE
- free licence, so code-size limitations
- based on the Eclipse IDE
Installation
- download link: http://processors.wiki.ti.com/index.php/Download_CCS
-
I recommend to use the version 8.3.1. This is in my opinion the most stable version. I also recommend to use the offline installer.
- while installation: only select MSP430 microcontroller support
Recommended Preferences
- open preferences windows: Window → Preferences
- at the bottom: Show advanced settings
- C/C++ → Editor → Folding → Enable folding when opening a new editor
- C/C++ → Editor → Documentation tool comments → Workspace default: Doxygen
- C/C++ → Code Style → Formatter: K&R [built-in]
Creating a New Project
- File → New CCS Project
- Target: MSP430G2553
- Set project name and project path accordingly
- Submit
-
right click on project in project browser → Properties
Build → MSP430 Compiler → Advanced Options → Language Options → C Dialect: C99 mode
Using the Auto-Formatter
- CCS can automatically format the code. Please use this feature!
- Select code → Ctrl + Shift + F
-
Automatic format on save:
Window → Preferences
C/C++ → Editor → Save Actions → Format source code → Format all lines