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

Comparison Between TIMA and TIMG

Specific features for each TIMA instance include:

  • 16-bit up, down, or up-down counter, with repeat-reload mode
  • Selectable and configurable clock source
  • 8-bit programmable prescaler to divide the counter clock frequency
  • Repeat counter to generate an interrupt or event only after a given number of cycles of the counter
  • Up to four independent channels for:
    • Output compare
    • Input capture
    • PWM output (Edge-Aligned and Center-Aligned)
    • One-shot mode
  • Two additional capture/compare channels for internal events (CC4/CC5)
  • Shadow register for load and compare values
  • Complementary PWM output with programmable deadband insertion
  • Asymmetric PWM output

The TIMG module consists of 16-bit and 32-bit auto reload counters driven by a programmable prescaler with two capture/compare (CC) blocks for multiple capture/compares, PWM outputs, and interval timing. TIMG also has extensive event generation capabilities, including counter overflow, reload, and capture/compare actions for a variety of use cases.

Specific features for TIMG include:

  • 16-bit up, down, or up-down counter, with repeat-reload mode
  • 8-bit programmable prescaler to divide the counter clock frequency
  • Up to two independent channels for
    • Output compare
    • Input capture
    • PWM output (Edge-Aligned and Center-Aligned)
    • One-shot mode
  • Shadow register mode for load and compare values
  • Support for quadrature encoder interface (QEI)
  • 3-input Hall sensor mode for position sensing and speed computation
  • Support synchronization and cross trigger among different TIMx instances in the same power domain
  • Support CPU interrupt generation and cross peripherals (such as ADC, DAC, and so on) using the Event

Table 2-1 shows the configuration for TIMA and TIMG instances.

Table 2-1 TIMx Instance Configuration
Instance Power Domain Counter Resolutio n Prescaler Repeat Counter CCP Channels (External /Internal) External PWM Channels Phase Load Shadow Load Shadow CCs Deadband Fault Handler QEI/Hall Input Mode
TIMG0 PD0 16-bit 8-bit - 2 2 - - - - - -
TIMG1 PD0 16-bit 8-bit - 2 2 - - - - - -
TIMG2 PD0 16-bit 8-bit - 2 2 - - - - - -
TIMG3 PD0 16-bit 8-bit - 2 2 - - - - - -
TIMG4 PD0 16-bit 8-bit - 2 2 - Yes Yes - - -
TIMG5 PD0 16-bit 8-bit - 2 2 - Yes Yes - - -
TIMG6 PD1 16-bit 8-bit - 2 2 - Yes Yes - - -
TIMG7 PD1 16-bit 8-bit - 2 2 - Yes Yes - - -
TIMG8 PD0 16-bit 8-bit - 2 2 - - - - - Yes
TIMG9 PD0 16-bit 8-bit - 2 2 - - - - - Yes
TIMG10 PD1 16-bit 8-bit - 2 2 - - - - - Yes
TIMG11 PD1 16-bit 8-bit - 2 2 - - - - - Yes
TIMG12 PD1 32-bit - - 2 2 - - Yes - - -
TIMG13 PD0 32-bit - - 2 2 - - Yes - - -
TIMG14 PD1 16-bit 8-bit - 4 4 - - - - - -
TIMA0 PD1 16-bit 8-bit Yes 4/2 8 Yes Yes Yes Yes Yes -
TIMA1 PD1 16-bit 8-bit Yes 2/2 4 Yes Yes Yes Yes Yes -