Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE, CONTROLSUITE
Tool/software: Code Composer Studio
Hello,
I am new to programming on F28379D Experminters kit and trying to understand various clocks in the MCU.
********************************************************************************************************************
#define PWM1_PERIOD 0x07D0
#define PWM1_CMPR25 PWM1_PERIOD>>2
Uint16 period1 = PWM1_PERIOD;
Uint16 dutyCycle1 = PWM1_CMPR25;
ClkCfgRegs.PERCLKDIVSEL.bit.EPWMCLKDIV = 1;
EPwm1Regs.TBCTL.bit.CTRMODE = 0; // Count up
EPwm1Regs.TBPRD = period1; // Set timer period
EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0; // Clock ratio to SYSCLKOUT
EPwm1Regs.TBCTL.bit.CLKDIV = 0;
// Set Compare values
EPwm1Regs.CMPA.bit.CMPA = dutyCycle1; // Set compare A value
// Set actions
EPwm1Regs.AQCTLA.bit.ZRO = 2; // Set PWM1A on Zero
EPwm1Regs.AQCTLA.bit.CAU = 1; // Clear PWM1A on event A, up count
***************************************************************************************************************************
With these lines in my code I am getting a 0.25 duty PWM at 50kHz frequency at ePWM1. which corresponds to TBCLK frequency of 100 MHz. This along with HSPCLKDIV and CLKDIV corresponds to 100MHz EPWMCLK.
since EPWMCLKDIV is set for /2, SYSCLK is at 200 MHz.
By keeping every thing same and adding _LAUNCHXL_F28379D in the predefined symbols I am getting a 0.25 duty PWM at 100kHz frequency. which infers 200MHz EPWMCLK and 400MHz SYSCLK.
I think this is to do with these lines
#ifdef _LAUNCHXL_F28379D
InitSysPll(XTAL_OSC,IMULT_40,FMULT_0,PLLCLK_BY_2);
#else
InitSysPll(XTAL_OSC, IMULT_20, FMULT_0, PLLCLK_BY_2);
#endif // _LAUNCHXL_F28379D
I read somewhere in forum that launchpad has 10MHz crystal and controlcard has 20Mhz crystal! Where can i get this information in product datasheets?
I remember reading in one of the datasheets that EPWMCLK max freq is limited to 100MHz. Can PLL deliver 400MHz to core? Is it possible to run CPU1 at 400MHz?
Am I missing anything here, kindly explain?