Skip to content

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

alt: "Pinout of 20 pin MSP430G2553", w: 75, src: "https://github.com/RobFro96/MSP430Pinouts"

alt: "Functional Block Diagram MSP430G2553", w:50, src: "MSP430G2553 datasheet, page 5"

  • 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

alt: "Pinout of Launchpad MSP-EXP430G2ET", w: 75, src: "https://github.com/RobFro96/MSP430Pinouts"

alt: "Launchpad jumper positions and hardware changes", w:40

  1. 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
  2. Pins P2.6 and P2.7 are connected to crystal oscillator and cannot be used as normal in- and outputs.

  3. Pullup resistor on user button P1.3 is removed → higher current consumption in sleep mode, when not removed.

Code Composer Studio

alt: "Code Composer Studio", w:50

  • from Texas Instruments recommended IDE
  • free licence, so code-size limitations
  • based on the Eclipse IDE

Installation

  • while installation: only select MSP430 microcontroller support
    alt: "Selecting processor support while installation of CCS", w:50

Recommended Preferences

  • open preferences windows: Window → Preferences
  • at the bottom: Show advanced settings
  • C/C++ → Editor → Folding → Enable folding when opening a new editor
    alt: "Enabling the code folding in CCS", w:50
  • C/C++ → Editor → Documentation tool comments → Workspace default: Doxygen
    alt: "Enabling doxygen documentation tool in CCS", w:50
  • C/C++ → Code Style → Formatter: K&R [built-in]
    alt: "Setting the formatter in CCS", w:50

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

    alt: "Setting the C99 Dialect in CCS", w:50

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

    alt: "Alternative to format the code", w:50