TMDSCNCD28388D: Generate a PWM automatically changing the time base period

Part Number: TMDSCNCD28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "f28x_project.h"
#include "sysctl.h"
//#include "f2838x_epwm.h"
// DEFINIZIONI
#define MYPWM_FREQUENCY 40000
#define MYDEADBAND_VALUE 0.001
#define OSC_FREQ 25000000
uint32_t MYSYSCLK;
uint32_t tbprd;
uint32_t clockDivider;
uint32_t timebaseclk;
//PROTOTIPI
void inizializzapwm1(void);
void inizializzapwm2(void);
// Main
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Dear Texas support,

I am a PhD student at ENEA in Italy, and I would like to create a code that automatically updates the Time Base Period (TBPRD) value to achieve the desired PWM signal frequency for a given frequency. In my code, the Time Base Period changes, but it does not allow me to achieve the desired PWM frequency. I would greatly appreciate your help in understanding where I might be going wrong.

Thank you in advance for your assistance.