Part Number:
TMS320F28335
Other Parts Discussed in Thread:
C2000WARE
Tool/software:
Code Composer Studio
Hi,
I have found the below code in the TI forum for PI control , which i am trying to run in code composer v6, but am getting a error " #include "DCLF32.h" in this part . Kindly help me as am new to code composer
#include "DSP28x_Project.h" // Device Headerfile and Examples Include File
#include "DCL.h"
#include "DCLF32.h"
#include "DCL_fdlog.h"
#include "DCLC28.h"
#if (CPU_FRQ_150MHZ) // Default - 150 MHz SYSCLKOUT
#define ADC_MODCLK 0x3
#endif
#if (CPU_FRQ_100MHZ)
#define ADC_MODCLK 0x2
#endif
EDIS;
EALLOW;
SysCtrlRegs.HISPCP.all = ADC_MODCLK;
EDIS;
IER = 0x0000;
IFR = 0x0000;
InitPieVectTable();
EALLOW;
PieVectTable.ADCINT = &adc_isr;
EDIS;
InitAdc();
gpio_select();
InitEPwm1();
PieCtrlRegs.PIEIER1.bit.INTx6 = 1;
IER |= M_INT1;
AdcRegs.ADCMAXCONV.all = 0x0001;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x3;
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x2;
pi1.Kp=2.0f;
pi1.Ki=1.0f;
pi1.Umax=0.8f;
pi1.Umin=0.2f;
rk = 20.0f;
lk = 1.0f;
AdcRegs.ADCTRL2.bit.EPWM_SOCA_SEQ1 = 1;
AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1;
EINT;
ERTM;
for
(;;);
void
gpio_select(){
EALLOW;
GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0;
GpioCtrlRegs.GPAPUD.bit.GPIO1 = 0;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1;
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1;
EDIS;
void
InitEPwm1(){
EPwm1Regs.TBCTL.bit.CTRMODE = 0;
EPwm1Regs.TBPRD = 3750;
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;
EPwm1Regs.TBPHS.half.TBPHS = 0x0000;
EPwm1Regs.TBCTR = 0x0000;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x001;
EPwm1Regs.TBCTL.bit.CLKDIV = 000;
EPwm1Regs.TBCTL.bit.SYNCOSEL=1;
EPwm1Regs.CMPA.half.CMPA =1875;
EPwm1Regs.CMPB = 1875;
EPwm1Regs.CMPCTL.bit.LOADAMODE=1;
EPwm1Regs.CMPCTL.bit.SHDWAMODE=0;
EPwm1Regs.AQCTLA.bit.ZRO=2;
EPwm1Regs.AQCTLA.bit.CAU=1;
EPwm1Regs.ETSEL.bit.SOCAEN = 1;
EPwm1Regs.ETSEL.bit.SOCASEL = 1;
EPwm1Regs.ETPS.bit.SOCAPRD = 1;
__interrupt
void
adc_isr(
void
)
yk=(AdcRegs.ADCRESULT0 >>4)*300.0f/4095.0f;
lk=0.0f;
uk = DCL_runPI_C1(&pi1, rk, yk);
if
(uk>0.8f){
uk=0.8f;
else
if
(uk<0.1f){
uk=0.1f;
EPwm1Regs.CMPA.half.CMPA =(EPwm1Regs.TBPRD)*uk;
EPwm1Regs.CMPB = EPwm1Regs.TBPRD*uk;
AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;
AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
return
;
Is the error you are getting that the compiler could not open the header file "DCLF32.h"?
If so, then please refer to this page:
http://software-dl.ti.com/ccs/esd/documents/sdto_ccs_build-errors.html#error-could-not-open-source-file-xxx-h-
Basically you need to make sure that the path to this header file is added to the Compiler's --include_path option inside your project (under
Project Properties->Build->Compiler->Include Options).
If you have
C2000Ware
installed, this header file is in the \libraries\control\DCL\c28\include directory inside C2000Ware, so you would need that path to the compiler options.
Hope this helps.
Hi Aarti ,
No that's not the error , the error is in the DCL32.h source file and the errors are like float32_t undefined .
Am getting a total of something around 80 errors in that source file
Thank you , I appreciate your help
Regards,
Prithvi
Prithvi,
It is difficult to say what is triggering the error without more specifics or access to your project. It sounds more like a generic C code error rather than a CCS specific error. You might get some clues for identifying the source of the error by searching the E2E forum or even the internet for similar errors.
Also if this is a custom project with your own source code, (ie) not an example project from TI, I would suggest comparing your code with an example from TI that uses DCLF32.h. You may be missing some other required header files, etc.
If the above suggestions do not help resolve the error, we may need to have a look at your project to provide more suggestions.
Hi Aarti,
I dont think the code which i posted is an example , because i got it from this forum . I suppose the Project you asked for is the code which i posted earlier , can you please try running that code and may be find out what the error is ?
Can you suggest me a program for PI Control of Three Phase Inverter by controlling the PWM signal ? it would be really helpful.
I thank you so much for your help and valuable time .
with regards,
Prithvi