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

The output of the CCP channel can be forced to high or low. Additionally, in TIMA only, the complimentary output channel can also be forced to high or low. Table 6-1 shows the software force output action configuration options.

Table 6-1 Force Output Action Configuration
Bit Field Value Description or Comment
SWFRCACT / SWFRCACT_CMPL 0 No forced output. Output is directly from the signal generation block.
1 Force output high
2 Force output low

The user can set the SWFRCACT bit in register to force or release the PWM output. Besides, the user can call the API to produce the same effect as shown in the following code.

/**
 *  @brief Overrides the timer CCP output
 *
 *  @param[in]  gptimer       Pointer to the register overlay for the
 *                            peripheral
 *  @param[in]  out           Specifies the CCP output state.
 *                            @ref DL_TIMER_FORCE_OUT
 *  @param[in]  outComp       If timer insatance supports complementary output,
 *                            it allows to override complementary out also.
 *                            If timer instance doesn't support complementary
 *                            output, this parameter is ignored.
 *                            @ref DL_TIMER_FORCE_CMPL_OUT
 *  @param[in]  ccIndex       Index associated to capture compare register
 *                            @ref DL_TIMER_CC_INDEX.
 */
void DL_Timer_overrideCCPOut(GPTIMER_Regs *gptimer, DL_TIMER_FORCE_OUT out,
    DL_TIMER_FORCE_CMPL_OUT outComp, DL_TIMER_CC_INDEX ccIndex);