How to configure HRPWM module on the F28379D TI LaunchPad

28 views (last 30 days)
Hello all,
I am using an F28379D TI Launchpad in a research project, for which I need 6 analog outputs. I use the available DACA and DACB for 2 of the outputs, and I was planning on using the PWM-based DACs (DAC1-4 on the pinout below) for the remaining 4 outputs, which use on-board RC filters to convert PWM to analog.
When choosing the PWM signal frequency, there is a trade-off between the resolution of the analog signal and the ripple in the signal. Ideally, I want a high resolution, around 12-bits like DACA and DACB, and a low ripple. I figured that using the High Resolution option for the PWM modules (HRPWM) would help in achieving this goal.
In the documentation about the ePWM blocks of the C2000 Microcontroller blockset, under the chapter 'HRPWM Tab', it states that 'During HR (High Resolution) configuration for F2837xD processor, the ePWM modules only exists on ePWM1 and SFO only runs on CPU1. Therefore if you want to use HRPWM, then ePWM1 must be allocated to CPU1 and if SFO is enabled, it must run on CPU1.' I do not really understand what the word 'exists' means in this context. Since the PWM-based DACs are driven by ePWM modules 7 & 8, does this mean that they can not be configured in High Resolution mode? Or do they need to be linked to ePWM1 using the ePWMLink options in the block?
I tried the following already; I configured the ePWM8 module with a timer period of 10, which means that the PWM frequency is 10MHz (with the standard EPWMCLKDIV = SYSCLKOUT/2 = 100MHz). Without the High Resolution option turned on, the DAC now has 11 diffrerent outputs (0V 0.33V 0.66V ... 3.3V), which I verified with by measuring the DAC with an oscilloscope. The documentation states that, when enabling the High Resolution mode, the block accepts decimal values for the timer period. When I give a decimal value as input, the DAC still seems to only have 11 outputs. The ePWM block has the following settings.
Can anyone help me find the correct settings to configure the HRPWM on ePWM 7 & 8? Thanks in advance.

Answers (1)

Sumukh
Sumukh on 1 Aug 2024
Hi Jeffrey.
Based on the description you have provided, I get the understanding that you want to use the PWM/DAC functionality on ePWM7 and ePWM8, available on pins GPIO157-GPIO160. At first, only ePWM1 is HRPWM configurable, as provided in the documentation below:
So, it is not possible to use the PWM-DAC functionality using HRPWM configuration for any ePWM module, except ePWM1.
Up to 250kHz, HRPWM is typically not required as per TI documentation, so the ePWM modules can be used for PWM-DAC functionality, however, to have good DAC resolution, the PWM frequency will have to be low, i.e., TBPRD needs to be high. This will surely affect the DAC bandwidth, as it depends on the cutoff frequency of the on-board RC filter, leading to harmonic ripple in DAC output. The R-C filter values can be found in page 13 of the following documentation:
So, a trade-off needs to be done between DAC resolution and DAC bandwidth when using the ePWM module for PWM-DAC functionality, and TBPRD needs to be chosen appropriately.
Currently, there is no documentation available from TI, for implementing the PWM-DAC functionality, specifically in F28379D, following this discussion on the TI C2000 forum:
However, some clarity can be gained from the documentation provided below, that implements this functionality on a similar TI controller, following from the discussion in the above forum:
I hope this helps with the issue.

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!