SLAA513B December   2011  – February 2022 MSP430G2112 , MSP430G2112 , MSP430G2152 , MSP430G2152 , MSP430G2212 , MSP430G2212 , MSP430G2252 , MSP430G2252 , MSP430G2312 , MSP430G2312 , MSP430G2352 , MSP430G2352 , MSP430G2412 , MSP430G2412 , MSP430G2452 , MSP430G2452

 

  1.   Trademarks
  2. 1Typical Single Time Base Method
  3. 2Multiple Time Base Method
  4. 3Implementing the Multiple Time Base Method in a Custom Application
    1. 3.1 Timer Clock Source Selection
    2. 3.2 Period and Frequency Calculation
    3. 3.3 Duty Cycle Calculation
  5. 4Example Code
    1. 4.1 Method
      1. 4.1.1 ISR for Multiple Frequencies
      2. 4.1.2 ISR for Multiple Frequencies and Duty Cycles (PWM)
    2. 4.2 Included Code Examples
  6. 5Limitations of the Multiple Time Base Method
    1. 5.1 ISR Overhead
    2. 5.2 Maximum Output Frequency vs Number of Signals
    3. 5.3 Power Consumption
  7. 6References
  8. 7Revision History

Abstract

The timer modules on MSP430™ ultra-low power microcontrollers often base several different outputs off of a single time base – a single timer period. This is especially true for the typical implementation of pulse width modulation (PWM) signals on the MSP430 devices, where one capture compare register (TxCCR0) sets the period, and the rest (TxCCRx) simply set different duty cycles. However, in some applications, multiple time bases are needed to generate multiple output frequencies. Normally this is done using multiple timer modules, but this might require upgrading to a part with many more extra features that may not be needed for the application. However, in exchange for a small amount of software overhead, multiple time bases can be implemented on a single MSP430 timer module, allowing for more features to be implemented on a simpler MSP430 device. This potentially can reduce cost and board space by allowing a smaller MSP430 device to be used and, on large MSP430 devices, allows for new applications requiring a large number of different output frequencies to be implemented.

The source code and other files described in this application report can be downloaded from https://www.ti.com/lit/zip/slaa513.