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

Cross trigger can be used to synchronize different timers. When using a main-secondary timer configuration by connecting multiple timers together, the cross-trigger feature can instruct multiple timer modules in the same power domain or across different power domains using the event fabric to start counting simultaneously.

Cross-triggers can be enabled using software, compare events from other timer instances, zero or load events, or generic subscriber events. Some applications can require more than one counter block that can be simultaneously started across the same power domain (such as TIMA0 and TIMA1) or different power domains (such as TIMA0 and TIMG0). As shown in Figure 8-9, TIMGx is the main timer and TIMAx is the secondary timer that can be cross triggered in the configuration example.

GUID-44418F60-3E80-4B3A-8CA7-B326B3CB7860-low.svg Figure 7-1 Cross Trigger Connections for Main Timer (TIMGx) and Secondary Timer (TIMAx) in Power Domain 1

By using cross trigger, different timers can start counting simultaneously. To produce a controlled phase shift, phase load is required. In TIMA only, the phase load register provides the capability for counter to count from a value other than zero or load value in Up/Down counting mode. Phase load is used to generate asymmetric center-aligned PWM output signals with a controlled phase shift between different timer instances.

When phase load is triggered, the timer counts from the phase load value. Phase load value is latched when the timer starts. The phase load is synchronized every time when the counter reaches the previously latched phase load value. Figure 7-5 shows how the phase load register works when the timer is counting in the up-down direction and the phase load value changes to a new value.

GUID-3A2590CA-58B2-4C08-A884-1456E44797BD-low.svg Figure 7-2 Phase Load Register Synchronization in Up-Down Mode

As an example of asymmetric PWM configuration using CCP channel 0 of TIMA0 and TIMA1, firstly synchronize TIMA0 and TIMA1 using a cross trigger. Configure two center-aligned using TIMA0 and TIMA1 with the same load value and compare value to generate the same PWM frequency and duty cycle. Add a phase shift value for TIMA0 or TIMA1 by configuring the phase load value. The Asymmetric PWM is shown in Figure 7-6.

GUID-2D896918-8BEC-4594-ABF1-ABCDEF1A1C2B-low.svg Figure 7-3 Asymmetric PWM Configuration with Phase Load for CCP Channel 0 of TIMA0 and TIMA1

To accelerate development, please refer to the following resources.