Hallo, jemand da der sich mit dem Infineon XC167 und dessen CAPCOM6 auskennt? Ich möchte ein PWM Signal erzeugen. In den Regs siehts gut aus aber an den Pins kommt noch nichts an. -
In the Debugger i can see that the Registers are loaded correctly and that the State Bit switches from 1 to 0 depending on the actual Counter Value. That works allright. But I cannot see a PWM signal on the output COUT63 (Pin123) of my microcontroller. Do I have to enable any more Bits or Registers to see the signal on the pin? What about Multichannel Mode? Here is my code (as far as until now) ++++++++++++++++++++++++++++++++++++ CCU6_TCTR0 = 0x0400; //Prescaler and CLK CCU6_T13 = 326; //Counter predefinition CCU6_CC63SR = 500; //Duty Cycle=50% CCU6_T13PR = 1000; //Period=1000 counts CCU6_TCTR4 = 0x0400; //T13 reset CCU6_TCTR4 = 0x4000; //Make Shadow Transfer // Here I am in doubt: CCU6_CMPSTAT = 0x0000;//Passive Level=0, TIM=0 CCU6_MODCTR = 0x8000; //ECT13O=1 CCU6_TCTR4 = 0x0200; //start Timer ********************************* I'm thankful for help Martin
Hi Martin, you must configure the output pins of the port (alternate functions). E.g.
/// ----------------------------------------------------------------------- /// Configuration of the used CCU6 Channel Port Pins: /// ----------------------------------------------------------------------- /// - P1L.0 is used for CAPCOM6 output (CC60) /// - P1L.1 is used for CAPCOM6 output (COUT60) ALTSEL0P1L |= 0x0003; // select alternate output function P1L = (P1L & ~(uword)0x0003) | 0x0003; //set data register DP1L = (DP1L & ~(uword)0x0003) | 0x0003; //set direction register