SLAAEK4 January   2024 MSPM0C1104

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Comparison Between TIMA and TIMG
  6. Use Case - 3 Pairs of Complementary PWM with Deadband Insertion
    1. 3.1 Principle
    2. 3.2 Implement
  7. Use Case - Timing-Critical PWM Control with Shadow Load and Compare
    1. 4.1 Principle
    2. 4.2 Implement
  8. Use Case - Fault Handler
    1. 5.1 Principle
    2. 5.2 Implement
  9. Use Case – PWM Disable with Software Force Output
    1. 6.1 Principle
    2. 6.2 Implement
  10. Use Case - Asymmetric PWM
    1. 7.1 Principle
    2. 7.2 Implement
  11. Use Case – Optimal Interrupt Generation with Repeat Counter
    1. 8.1 Principle
    2. 8.2 Implement
  12. Summary
  13. 10References

Implement

TIMx can be used to generate desired pulse-width modulation (PWM) output waveforms with the counter and capture/compare modules (compare match). The waveform generation of a CCP output depends on the counting mode and counter compare actions

For example, with different counting mode, edge-aligned PWM or center-aligned PWM can be generated. A typical 2-channel PWM is shown in Figure 8-9. The user can set LOAD value to configure the PWM period, or set CC value to configure the duty cycle. The user can also configure polarity of the signal, CCP output action and so on. Please refer to the TRM for specific configuration.

GUID-357C59BA-D9DF-4C2E-AE72-3D9A4A66AB47-low.svg Figure 3-1 Edge-Aligned PWM and center-aligned PWM

Both TIMA and TIMG can generate PWM. However, TIMA provides the optional feature on complimentary CCP output channels, such as TIMA0_C1 and TIMA0_C1N for a reference PWM signal on TIMA0 CCP output channel 1. Besides, TIMA0 has 4 CCP channels while TIMA1 and TIMG have 2 CCP channels. It means that TIMA0 can output 8 PWMs (4 pairs) and TIMA1 can output 4 PWMs (2 pairs), while TIMG can only output 2 PWMs.

  • TIMA0:
    • TIMA0_C0, TIMA0_C0N
    • TIMA0_C1, TIMA0_C1N
    • TIMA0_C2, TIMA0_C2N
    • TIMA0_C3, TIMA0_C3N
  • TIMA1:
    • TIMA1_C0, TIMA1_C0N
    • TIMA1_C1, TIMA1_C1N
  • TIMGx:
    • TIMGx_C0
    • TIMGx_C1

TIMA also provides the option on deadband insertion(non-overlapping transitions in complimentary PWM signals). Multiple modes of configurable deadband can be inserted in edge-aligned or center-aligned complimentary PWMs, as shown in Figure 7-5 and Figure 7-6.

The user can configure deadband mode and timing information with the deadband control register (TIMA.DBCTL) programmed. With mode 0, rise delay and fall delay are applied with respect to the output generator signal's rising and falling edges to generate CCP and CCP complimentary signal. With mode 1, rise delay and fall delay are both applied to CCP complimentary signal only. Figure 7-5 shows the edge-aligned PWM with deadband (mode 0 only). Figure 7-6 shows the center-aligned PWM with deadband (mode 0 and mode 1).

GUID-B2C51371-F296-459E-989F-664748B0187D-low.svg Figure 3-2 Edge-Aligned PWM with Deadband
GUID-4D25BCEC-020B-42A4-9CB9-774C6B8507AC-low.svg Figure 3-3 Center-Aligned PWM with Deadband

To accelerate development, please refer to the following resources.