This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hi ,
I was looking at an example code / code snippet that could help me configure the ePWM in F28069.
i am looking at providing an input period that is greater than 16 bits .
This makes it difficult to directly write the whole period to the TBPRD register as it would truncate it to 16 bits .
i believe that i would need to use the TBPRDM register if i have to configure for 24 bits period ? is that correct ?
i have used the code below . Am i missing something ?
EPWM_REGS is as defined in the F2806x_Epwm.h (C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_headers\include)
volatile struct EPWM_REGS *pepwm;
pepwm->TBPRDM.half.TBPRDHR = temp && 0x000000FF;
pepwm->TBPRDM.half.TBPRD = (temp >> 8) & 0x0000FFFF;
Are there any other registers that need to be configured ?
The LSB 8 bits are in the TBPRDHR and the bits 24 to 8 are in TBPRD . is this the right way to do it ??
Need these details to configure some upper level details for a customer ...
Thanks .
Regards .
hi Kris ,
Yes the real intention is to be able to provide a period greater than 16 bits using the epwm timer module.
From the TRM it is unclear of the configurations needed for the same .
The only reference i see is of the registers that i have provided in the first mail .
Regards .
We do not have a way to change the size of the TBPRD register, but if you are looking for a slower frequency the EPWM Time Base Clock (TBCLK) can be divided down to reduce the clock rate of the EPWM. Will that work for your application?
Great reference material.
The TBPRDHR register is for high resolution PWM usage. It does not add to the total period size, but when the PWM is configured for high resolution mode, it adds finer granularity within the existing 16 bits of the TBPRD.
Please have a look at the CLKDIV and HSPCLKDIV bits of the TBCTL register. You can find the details in the TRM that I linked to below on page 334. Essentially, you'll want to decrease the TBCLK to a frequency slow enough that you hit the targeted 5 seconds with 16 bits.