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.

Problem generating variable PWMs

Other Parts Discussed in Thread: TMS570LS1224, HALCOGEN

Hi

Im using TMS570LS1224 MCU for the control of 12 DC motors

I did a test today for see the changes on the Duty cycle using this code: 

/* Include Files */

#include "sys_common.h"

/* USER CODE BEGIN (1) */
#include "stdio.h"
#include "system.h"
#include "etpwm.h"
unsigned int c;

void main(void)
{
c=0;


/* Initialise EPWM and ECAP with GUI configuration */
etpwmInit();
//ecapInit();
etpwmStartTBCLK();
for(;;){
do{

etpwmSetCmpA(etpwmREG1, 15);
etpwmSetCmpB(etpwmREG1, 15);
etpwmSetCmpA(etpwmREG2, 15);
etpwmSetCmpB(etpwmREG2, c);
etpwmSetCmpA(etpwmREG3, c);
etpwmSetCmpB(etpwmREG3, c);
etpwmSetCmpA(etpwmREG4, c);
etpwmSetCmpB(etpwmREG4, c);
etpwmSetCmpA(etpwmREG6, c);
etpwmSetCmpB(etpwmREG6, c);
etpwmSetCmpA(etpwmREG7, c);
etpwmSetCmpA(etpwmREG7, c);
c+=5;
__delay_cycles(160000000);
}while(c<100);
c=0;
}

/* Start counter in CountUp mode */
//etpwmSetCount(etpwmREG1, 0);
//etpwmSetCounterMode(etpwmREG1, CounterMode_Up);

// while(1);

/* USER CODE END */
}

but when runing, the code did not work as expected.. Am I missing something???

The configuration was done using Halcogen with a Period of 25kHz

Best regards