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.

CCS/TMS320F28069: Experimenter's Kit - Piccolo F28069

Part Number: TMS320F28069
Other Parts Discussed in Thread: CONTROLSUITE, , C2000WARE, MOTORWARE

Tool/software: Code Composer Studio

Hi,

I have recently purchased the 'Experimenter's Kit - Piccolo F28069' and have started preparing code for what will be a three-phase current controller to a permanent-magnet motor. For this reason, I am thinking of using the interrupt for EPwm1 to read three ADC channels (reading two phase currents and the dc-link voltage) and performing the current control (resulting in modified duty ratios for the PWM). 

As of now, I have tried to gather code to configure the PWM and ADC and configuring the other GPIO pins. I manage to initially light LD2 and LD3 (outside the PWM interrupt) on the controlCARD and then, I want to start implementing code in the PWM interrupt. The first lines I have added in the PWM interrupt (named ePWM1A_ISR) is to turn off LD3. However, when I run the code, LD3 never turns off. Hence, it seems that the PWM interrupt is never triggered (I have set the PWM interrupt to trigger with a 1 kHz updating frequency (I think)). 

Can you please help me with how I can make the PWM interrupt to trigger. The code I have implemented can be found below. Notice that I am very new to this and likely have misinterpreted things when gathering together the different code pieces from various TI sources. For this reason, also the comments I made could be wrong so any additional comments improving the code would be appreciated as well.

Sincerely,

Oskar Wallmark

CODE (main.c):

//Target configuration:

//Board or device: Experimenter's Kit - Piccolo F28069 (including the Piccolo F2806x controlCARD)
//Connection: Texas Instruments XDS100v1 USB Debug Probe

//The analog-to-digital converter (ADC) will convert from 0V to 3.3V and scale this to 0 -- 4096
//This assumes that the two switches labeled SW2 on the Piccolo F2806x controlCARD
//are set to their downward position (downward position = switch is closest to the DIMM100 pins)
//This is described in "F28069controlCARD_InfoSheet.pdf"

//The boot options for the Piccolo F2806x controlCARD are set with switch labeled SW1
//This is described in "F28069controlCARD_InfoSheet.pdf"

//On the Piccolo F2806x controlCARD, the following LEDs are connected (as described in "F28069controlCARD_InfoSheet.pdf")
//LD1 (green LED) – Turns on when controlCARD is powered on
//LD2 (red LED) – controlled by GPIO-31
//LD3 (red LED) – controlled by GPIO-34

//CCS workspace path (check under Window/Preferences/General/Workspace):
//C:\Users\owa\Documents\Work\Teaching and courses\EMaDLab converter\CCS_workspaces\TemplateProjects

//Location of Includes:
//C:\ti\ccsv8\tools\compiler\ti-cgt-c2000_18.1.4.LTS\include (needed for the compiler)
//C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_common\include (needed to include "DSP28x_Project.h")
//C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_headers\include (needed to include "DSP28x_Project.h")

//Files to be included in the project:
//28069_RAM_lnk.cmd //Memory block specific linker command file
//F2806x_CodeStartBranch.asm //Shared source code
//F2806x_CpuTimers.c //Shared source code
//F2806x_DefaultIsr.c //Shared source code
//F2806x_GlobalVariableDefs.c //This source file is required to use the header files
//F2806x_Headers_nonBIOS.cm //Linker file required by the peripheral specific heard files
//F2806x_PieCtrl.c //Shared source code
//F2806x_PieVect.c //Shared source code
//F2806x_SysCtrl.c //Shared source code
//F2806x_usDelay.asm //Shared source code

#include "DSP28x_Project.h" //This header file includes F2806x_Device.h and F2806x_Examples.h
#include "math.h" //To be able to execute mathematical operation (sin, cos, sqrt, etc)

float ADC0 = 0.0; //Float variable for storing ADC0 input from ADC

float ADC1 = 0.0; //Float variable for storing ADC1 input from ADC

float ADC2 = 0.0; //Float variable for storing ADC2 input from ADC

extern void InitSysCtrl(void);
extern void InitPieVectTable(void);
extern void InitPieCtrl(void);
void ReadAdc(void);
interrupt void ePWM1A_ISR(void);

void configureEPwm(void);

//In up-down-count mode, the time (in seconds) of a PWM period Ts is computed as Ts = 2*EPWM_PRD*TBCLK.
//Hence, EPWM_PRD = Ts/(2*TBCLK). The corresponding PWM frequency (in Hz) fs is then given by fs = 1/Ts.
//See also Figure 2-3 in "TMS320x280x, 2801x, 2804x Enhanced Pulse Width Modulator (ePWM) Module.pdf"
//The microprocessor TMS320F28069 operates at fClock = 90 MHz.
//TBCLK = 2/fClock = 22.2 ns where the multiplication with two is set in configureEPwm()
//Example: For fs = 10 kHz --> EPWM_PRD = 1/(fs*2*TBCLK) = 1/(10e3*2*2/(90e6)) = 2250
//fs = 1 kHz --> EPWM_PRD = 22500
//fs = 5 kHz --> EPWM_PRD = 4500
//fs = 10 kHz --> EPWM_PRD = 2250
//fs = 20 kHz --> EPWM_PRD = 1125
#define EPWM_PRD 22500 //PWM period [# clock cycles]
//Deadband period time (in seconds) TDB is computed as TDB = EPWM_DB*TBCLK
//Example: For TDB = 0.2e-6 s, EPWM_DB = TDB/TBCLK = 0.2e-6/(2/90e6) = 0.1e-6*90e6 = 0.25*90 = 9
//TDB = 0.2e-6 s--> EPWM_DB = 9
//TDB = 0.4e-6 s--> EPWM_DB = 18
//TDB = 0.8e-6 s--> EPWM_DB = 36
#define EPWM_DB 18 //Deadband period [# clock cycles)]

//Pin mapping (register definitions for the different GPIO pins described in "F2806_Gpio.h")
//GPIO0 --> EPWM1A (set in InitEPwm1Gpio())
//GPIO1 --> EPWM1B (set in InitEPwm1Gpio())
//GPIO2 --> EPWM2A (set in InitEPwm2Gpio())
//GPIO3 --> EPWM2B (set in InitEPwm2Gpio())
//GPIO4 --> EPWM3A (set in InitEPwm3Gpio())
//GPIO5 --> EPWM3B (set in InitEPwm3Gpio())
//GPIO31 controls LD2 (red LED) on the Piccolo F2806x controlCARD
//GPIO34 controls LD3 (red LED) on the Piccolo F2806x controlCARD
//GPIO20 --> EQEP1A (eQEP input) (set in InitEQep1Gpio())
//GPIO21 --> EQEP1B (eQEP input) (set in InitEQep1Gpio())
//GPIO22 --> EQEP1S (eQEP strobe) (set in InitEQep1Gpio())
//GPIO23 --> EQEP1I (eQEP index) (set in InitEQep1Gpio())

//Used analog input pins:
//ADCINA0 --> Activated
//ADCINA1 --> Activated
//ADCINA2 --> Activated

main(void)
{
InitSysCtrl(); //Initializes the System Control registers to a known state.
//-Disables the watchdog
//-Set the PLLCR for proper SYSCLKOUT frequency
//-Set the pre-scaler for the high and low frequency peripheral clocks
//-Enable the clocks to the peripherals

DINT; //Disable all maskable CPU interrupts (maskable CPU interrupts are interrupts that can be suppressed)
InitPieCtrl(); //initializes the PIE control registers to a known state

//Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;

InitPieVectTable(); //Initializes the PIE vector table to a known state.

//Interrupts that are used in this example are re-mapped to ISR functions found within this file.
EALLOW; //Enable write access to protected registers
PieVectTable.EPWM1_INT = &ePWM1A_ISR;
EDIS; //Disable write access to protected registers

InitEQep1Gpio(); //Configure GPIO20-GPIO23 to function as EQEP pins

InitEPwm1Gpio(); //Configure GPIO0-GPIO1 to function as EPwm1 pins (and disables internal pull-up for the selected GPIO pins)
InitEPwm2Gpio(); //Configure GPIO2-GPIO3 to function as EPwm2 pins (and disables internal pull-up for the selected GPIO pins)
InitEPwm3Gpio(); //Configure GPIO4-GPIO5 to function as EPwm3 pins (and disables internal pull-up for the selected GPIO pins)

configureEPwm(); //Configure EPwm1, EPwm2, and EPwm3 channels (EPwm2 and EPwm3 are synchronized with EPwm1)

//Configure GPIO31 which controls LD2 (red) on the Piccolo F2806x controlCARD
EALLOW; //Enable write access to protected registers
GpioCtrlRegs.GPAPUD.bit.GPIO31 = 1; //1 --> Disable pull-up on GPIO31 (GPIO0-GPIO31 --> GPAPUD (see "F2806_Gpio.h"))
GpioCtrlRegs.GPADIR.bit.GPIO31 = 1; //1 --> GPIO31 becomes an output pin (GPIO0-GPIO31 --> GPADIR (see "F2806_Gpio.h"))
GpioCtrlRegs.GPAMUX2.bit.GPIO31 = 0; //GPIO16-GPIO31 --> GPAMUX2 (see "F2806_Gpio.h")
GpioDataRegs.GPADAT.bit.GPIO31 = 0; //0 --> LD2 lit, 1 --> LD2 not lit (GPIO0-GPIO31 --> GPADAT (see "F2806_Gpio.h"))
EDIS; //Disable write access to protected registers

//Configure GPIO34 which controls LD3 (red) on the Piccolo F2806x controlCARD
EALLOW; //Enable write access to protected registers
GpioCtrlRegs.GPBPUD.bit.GPIO34 = 1; //1 --> Disable pull-up on GPIO34 (GPIO32-GPIO63) --> GPBPUD (see "F2806_Gpio.h"))
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1; //1 --> GPIO34 becomes an output pin (GPIO32-GPIO63) --> GPBDIR (see "F2806_Gpio.h"))
GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0; //GPIO32-GPIO47 --> GPBMUX2 (see "F2806_Gpio.h")
GpioDataRegs.GPBDAT.bit.GPIO34 = 0; //0 --> LD3 lit, 1 --> LD3 not lit (GPIO32-GPIO63 --> GPBDAT (see "F2806_Gpio.h"))
EDIS; //Disable write access to protected registers

/*
//Enable GPIO output on GPIO8 (taken from "Example_2806xGpioSetup.c")
//EALLOW; //Enable write access to protected registers
GpioCtrlRegs.GPAPUD.bit.GPIO8 = 0; //Enable pull-up on GPIO8
GpioDataRegs.GPASET.bit.GPIO8 = 1; //Load output latch (by default, the pin is in input mode and with pull-up enable the output will be '1'. If you change the direction of the pin as ouput then it'll be driven '0'. By loading output latch with '1' before changing the direction, value on pin remains '1' after pin is configured as output.)
GpioCtrlRegs.GPAMUX1.bit.GPIO8 = 0; //GPIO8 = GPIO8
GpioCtrlRegs.GPADIR.bit.GPIO8 = 1; //1 --> GPIO8 becomes an output pin
//EDIS; //Disable write access to protected registers

//Enable GPIO input in GPIO34 (taken from "Example_2806xGpioSetup.c")
//EALLOW; //Enable write access to protected registers
GpioCtrlRegs.GPBPUD.bit.GPIO34 = 0; //Enable pull-up on GPIO34
GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0; //GPIO34 = GPIO34
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 0; //0 --> GPIO34 becomes an input pin
//EDIS; //Disable write access to protected registers
*/

InitAdc(); //Initialize ADC to a known state
AdcOffsetSelfCal(); //Re-calibrates the ADC zero offset error

//EALLOW; //Enable write access to protected registers
//SysCtrlRegs.WDCR = 0x00AF; //Re-enable the watchdog
//EDIS; //Disable write access to protected registers

IER |= 4; //Enable CPU interrupt 1
PieCtrlRegs.PIEIER3.bit.INTx1 = 1; //Enable EPWM INTn in the PIE: Group 3 interrupt 1-6

//Enable global Interrupts and higher priority real-time debug events:
EINT; //Enable global interrupt INTM
ERTM; //Enable global real-time interrupt DBGM

//Configure ADC
//Values for TRIGSEL to select the specific trigger source are listed in Table 8-18 in "TMS320x2806x Piccolo Technical Reference Guide (Rev. G).pdf"
//Values for CHSEL to select the specific ADC input channel are (also) listed in Table 8-18 in "TMS320x2806x Piccolo Technical Reference Guide (Rev. G).pdf"
EALLOW; //Enable write access to protected registers
AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1; //Enable non-overlap mode
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1; //ADCINT1 trips after AdcResults latch
AdcRegs.INTSEL1N2.bit.INT1E = 1; //Enabled ADCINT1
AdcRegs.INTSEL1N2.bit.INT1CONT = 0; //Disable ADCINT1 Continuous mode
AdcRegs.INTSEL1N2.bit.INT1SEL = 1; //Setup EOC1 to trigger ADCINT1 to fire
AdcRegs.ADCSOC0CTL.bit.CHSEL = 0; //Set SOC0 channel select to ADCINA0
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; //Set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; //Set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC1CTL.bit.CHSEL = 1; //Set SOC1 channel select to ADCINA1
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; //Set SOC1 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1
AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; //Set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC2CTL.bit.CHSEL = 3; //Set SOC2 channel select to ADCINA2
AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5; //Set SOC2 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1
AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; //Set SOC2 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
EDIS; //Disable write access to protected registers

//Wait for interrupts
for(;;)
{
}
} //End of main(void)

void configureEPwm()
{
//EPwm1Regs (master PWM module)
EPwm1Regs.TBPRD = EPWM_PRD; //PWM period
EPwm1Regs.TBPHS.half.TBPHS = 0x0000; //Set Phase register to zero
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; //Up-down-count mode
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; //Disable phase loading (acting as master PWM module)
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; //Sync down-stream module
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; //Set actions
EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm1Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; //Enable dead-band module
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; //Active high complementary
EPwm1Regs.DBFED = EPWM_DB; //Deadband period (falling edge)
EPwm1Regs.DBRED = EPWM_DB; //Deadband period (rising edge)
EPwm1Regs.CMPA.half.CMPA = (EPWM_PRD*0.5); //Initial duty cycle set to 50%
EPwm1Regs.TBCTL.all = 0; //Default values
EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1; //TB_DIV1 --> CLKDIV = 1
EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; //TB_DIV2 --> TBCLK = SYSCLKOUT/(2*CLKDIV) = SYSCLKOUT/2 (since CLKDIV is set to 1)
EPwm1Regs.TBCTL.bit.PHSDIR = TB_DOWN;
EPwm1Regs.AQCTLA.all = 0x0060;//CMPA up = set; CMPA down = clear
EPwm1Regs.ETSEL.all = 0;
EPwm1Regs.ETSEL.bit.INTEN = 1; //Enable ePWM1 int (set only in the master PWM module)
EPwm1Regs.ETSEL.bit.INTSEL = 5; //CMPA down match
EPwm1Regs.ETPS.bit.INTPRD = 1; //1st event
PieCtrlRegs.PIEIER3.bit.INTx2 = 1; //ePWM1
EPwm1Regs.DBCTL.bit.IN_MODE = DBA_ALL;

//EPwm2Regs (slave PWM module)
EPwm2Regs.TBPRD = EPWM_PRD; //PWM period
EPwm2Regs.TBPHS.half.TBPHS = 0x0000; //Set Phase register to zero
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; //Up-down-count mode
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; //Enable phase loading (acting as slave PWM module)
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; //Sync flow-through
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm2Regs.AQCTLA.bit.CAU = AQ_SET; //Set actions
EPwm2Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm2Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; //Enable dead-band module
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; //Active high complementary
EPwm2Regs.DBFED = EPWM_DB; //Deadband period (falling edge)
EPwm2Regs.DBRED = EPWM_DB; //Deadband period (rising edge)
EPwm2Regs.CMPA.half.CMPA = (EPWM_PRD*0.5); //Initial duty cycle set to 50%
EPwm2Regs.TBCTL.all = 0; //Default values
EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV1; //TB_DIV1 --> CLKDIV = 1
EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; //TB_DIV2 --> TBCLK = SYSCLKOUT/(2*CLKDIV) = SYSCLKOUT/2 (since CLKDIV is set to 1)
EPwm2Regs.TBCTL.bit.PHSDIR = TB_DOWN;
EPwm2Regs.AQCTLA.all = 0x0060; //CMPA up = set; CMPA down = clear
EPwm2Regs.ETSEL.all = 0;
EPwm2Regs.DBCTL.bit.IN_MODE = DBA_ALL;

//EPwm3Regs (slave PWM module)
EPwm3Regs.TBPRD = EPWM_PRD; //PWM period
EPwm3Regs.TBPHS.half.TBPHS = 0x0000; //Set Phase register to zero
EPwm3Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; //Up-down-count mode
EPwm3Regs.TBCTL.bit.PHSEN = TB_ENABLE; //Enable phase loading (acting as slave PWM module)
EPwm3Regs.TBCTL.bit.PRDLD = TB_SHADOW;
EPwm3Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; //Sync flow-through
EPwm3Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
EPwm3Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm3Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; //Load on CTR=Zero
EPwm3Regs.AQCTLA.bit.CAU = AQ_SET; //Set actions
EPwm3Regs.AQCTLA.bit.CAD = AQ_CLEAR;
EPwm3Regs.DBCTL.bit.OUT_MODE = DB_FULL_ENABLE; //Enable dead-band module
EPwm3Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; //Active high complementary
EPwm3Regs.DBFED = EPWM_DB; //Deadband period (falling edge)
EPwm3Regs.DBRED = EPWM_DB; //Deadband period (rising edge)
EPwm3Regs.CMPA.half.CMPA = (EPWM_PRD*0.5); //Initial duty cycle set to 50%
EPwm3Regs.TBCTL.all = 0; //Default values
EPwm3Regs.TBCTL.bit.CLKDIV = TB_DIV1; //TB_DIV1 --> CLKDIV = 1
EPwm3Regs.TBCTL.bit.HSPCLKDIV = TB_DIV2; //TB_DIV2 --> TBCLK = SYSCLKOUT/(2*CLKDIV) = SYSCLKOUT/2 (since CLKDIV is set to 1)
EPwm3Regs.TBCTL.bit.PHSDIR = TB_DOWN;
EPwm3Regs.AQCTLA.all = 0x0060; //CMPA up = set; CMPA down = clear
EPwm3Regs.ETSEL.all = 0;
EPwm3Regs.DBCTL.bit.IN_MODE = DBA_ALL;
} //End of void configureEPwm()

void readADC()
{
ADC0 = AdcResult.ADCRESULT0;
ADC1 = AdcResult.ADCRESULT1;
ADC2 = AdcResult.ADCRESULT2;
} //End of void readAdc()

interrupt void ePWM1A_ISR(void)
{
//Here comes the actual control code
readADC();

EALLOW; //Enable write access to protected registers
GpioDataRegs.GPBDAT.bit.GPIO34 = 1; //0 --> LD3 lit, 1 --> LD3 not lit (GPIO32-GPIO63 --> GPBDAT (see "F2806_Gpio.h"))
EDIS; //Disable write access to protected registers

EPwm1Regs.ETCLR.bit.INT = 1; // Clear interrupt flag for this timer
PieCtrlRegs.PIEACK.all = PIEACK_GROUP3; //Acknowledge this interrupt to receive more interrupts from group 3
} //End of interrupt void ePWM1A_ISR(void)

  • Oskar,

    When posting code onto the forum, please use the code formatting tool marked by the </> button. This tool can be located by clicking the "Insert Code, Attach Files, and more" link on the bottom right hand side of the Reply menu. The Code Formatting Tool allows the code to be easily read and can help you get support faster on the forums.

    I suggest that you use breakpoints to debug your code when it is possible to have a debug probe connected. LEDs work, but its easy for you to have a bug in your code that causes unexpected results that could lead you to chasing a problem that doesn't exist.

    Reviewing long pieces of code is very time intensive, if you have found a problem or a portion of the code that is not working correctly I can help you debug that portion. I will be simpler for you to compare your code with an example, The best place to find a ePWM example is in C2000Ware. Try looking at "Example_2806xEPwmTimerInt.c".

    Once you understand what that example is doing it should be simple to incrementally merge your code with the example.

    Regards,
    Cody

  • Dear Cody,

    Thank you for your friendly suggestions. I must confess that I found the different software suites (C2000Ware, MotorWare, controlSUITE) somehat messy to navigate when trying to learn how to develop code for this microprocessor. However, I realized that I accidently tied ePWM1 to an incorrect interrupt, i.e., the line

    PieCtrlRegs.PIEIER3.bit.INTx2 = 1; //ePWM1

    in in configureEPwm() should not be there. Now the code seems to be working and I can continue.

    Sincerely,
    Oskar Wallmark