This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How should i configure the Capcom unit6 to get my pwm signal on the Outputs cc6x and COUT6x

Hello,
could anyone tell, how iÂ'm going to configure the Capcom unit6, EBC, and SYSCON3 register to get the pwm Signal on the repectives outputs?
Thanks.

  • For the EBC you must use multiplexed mode as you need to use P1L for the CAPCOM6 signals. For the SYSCON3 register you need to make sure the CAPCOM6 bit is cleared (you can set this in the (START_V2.A66).

    Here is a simple example for a PWM on PL.6 (COUT63)

    #include <XC167.h>            /* Special Function Registers XC167 */
    #include <intrins.h>
    
    /* MAIN PROGRAM */
    void main (void)  {
    
      CCU6_T13PR  = 0xFFFF;     /* Period */
      CCU6_CC63SR = 0x8000;     /* Duty Cycle */
      CCU6_MODCTR = 0x8000;     /* COUT63 is controlled by T13 directly */
      CCU6_TCTR4  = 0x4000;     /* enable transfer requests for T13 */
    
      /* use port pin P1L.6 */
      _bfld_(ALTSEL0P1L,0x40,0x40);
      _bfld_(P1L,0x40,0x40);
      _bfld_(DP1L,0x40,0x40);
    
      CCU6_TCTR4 = 0x0200;      /* start T13 running */
    
      for(;;) {
      }
    }