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.

[参考译文] TMS320F28379D:错误:#66预期 A ""

Guru**** 2616675 points

Other Parts Discussed in Thread: CONTROLSUITE

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1011810/tms320f28379d-error-66-expected-a

器件型号:TMS320F28379D
Thread 中讨论的其他器件:controlSUITE

我的代码用于 main(),如下所示:  

#include "F28x_Project.h"     // Device Header File and Examples Include File
#include "sgen.h"

#define SIGNAL_LENGTH 512

/* Create an instance of Signal generator module    */
SGENT_1 sgen = SGENT_1_DEFAULTS;  
  
#pragma DATA_SECTION(v, "SGENipcb");
int v[SIGNAL_LENGTH];  
int xn,yn,i;

// external function prototypes
extern void InitSysCtrl(void);
extern void InitPieCtrl(void);
extern void InitPieVectTable(void);

// Prototype statements for functions found within this file.
void Gpio_select(void);
void Setup_ePWM1(void);
void Setup_ePWM2(void);

interrupt void ePWM_compare_isr(void);



void main(void)
{
	InitSysCtrl();	// Basic Core Init from SysCtrl.c

	EALLOW;
   	//SysCtrlRegs.WDCR= 0x00AF; 	// Re-enable the watchdog
   	EDIS;			// 0x00AF  to NOT disable the Watchdog, Prescaler = 64

	DINT;				// Disable all interrupts
	
	Gpio_select();		// setting for ePWM Outputs

	Setup_ePWM1();		// init of ePWM1A and ePWM1B
	Setup_ePWM2();      // init of ePWM2A and ePWM2B

	InitPieCtrl();		// basic setup of PIE table; from PieCtrl.c
	
	InitPieVectTable();	// default ISR's in PIE ; from PieVect.c

	EALLOW;

	PieVectTable.32 = &ePWM_compare_isr;

	EDIS;

	//ENABLING ADC INERRUPT
	PieCtrlRegs.PIEIER1.bit.INTx6 = 1;
	

	IER |=1;			// enable INT1 FOR ADC 

	EINT;
	ERTM;
	
	
	// Sync ePWM
	    EALLOW;
	    CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;
	    EDIS;

	    // Start ePWM
	    EPwm2Regs.TBCTL.bit.CTRMODE = 0;            // Un-freeze and enter up-count mode


	//while(1)
	//{    
	  
	//}
} 

    在构建时、此行中出现唯一错误#66预期为";":

第48行:PieVectTable.32 =&ePWM_COMPARE_ISR;  

中断 void  ePWM_COMPARE_ISR (void)中的内容如下:  

            sgen.offset=1;
	        sgen.gain=0x7fff; // gain=1 
	        sgen.freq=5369; // freq = 50Hz
	        sgen.step_max=1000; /* Max Freq= (step_max * sampling freq)/65536 */
	        sgen.alpha=8192;    /* phase_norm =(pi/4/(2*pi))*2^16=8192   */
	        
	        
	        for(i=0;i<SIGNAL_LENGTH;i++)
	        {
	            v[i]=0;
	        }

	        for(i=0;i<SIGNAL_LENGTH;i++)
	        {
	            sgen.calc(&sgen);
	            xn=sgen.out;
	            v[i]=xn;
	            EPwm1Regs.CMPA.bit.CMPA = v[i] ;
	            EPwm2Regs.CMPA.bit.CMPA = v[i] ;

	        }
	

	// Return from interrupt
      AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;      // Clear ADC INT1 flag
 
  	// Acknowledge this interrupt to receive more interrupts from group 3
       PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;   // Acknowledge interrupt to PIE
}

此函数在 main 之外执行。 我已经在这个论坛上搜索了这个解决方案、但我找不到我的问题的解决方案

此程序的控制台窗口如下所示:  

________________________________________________________________


****项目 Lab3_cpu01的配置调试构建****

"C:\\ti\\ccsv7\\utils\\bin\\gmake"-k all

'生成文件:"../new_open_loop_WD_OFF_ADC_INTERRUPT.c"
'调用:C2000编译器'
"c:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/bin/cl2000 -v28 -ml -mt --vcu_support=vcu2 --tmu_support=tmu0 -cla_support=cla1 -float_support=fpu32 -opt_for_speed=2 -include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.6.LTS/include -include_path="C:/ti/controlSUITE/libs/dsp/SGEN/v101/include -f37xD_new_board_suppremote_display_suppremote_display_display_new_over-f37xd_board.cpu_display_new_board.cpu_suppremote_display_suppremote_display_super -new_suppremote_display_over-f37xd_new_board.cp_board.cpue_display_new_suppage=v/new_board.cpue_display_over-d_suppremote_display_over-f37x_board_board.cpu_board_suppremote_display_suppage=v_suppage=v_board.cp_suppage=v28x_suppremote_display_suppremote_board

>>编译失败
subdir_rules.mk:72:目标'new_open_loop_WD_OFF_ADC_interrupt.obj'的配方失败
"./new_open_loop_WD_OFF_ADC_INTERRUPT.c"、第48行:错误#66:预期为";"
1在"../new_open_loop_WD_OFF_ADC_INTERRUPT.c"的编译中检测到错误。
gmake:***[new_open_loop_WD_OFF_ADC_INTERRUPT.obj]错误1
gmake:目标"全部"不会由于错误而重新生成。

****构建完成****

_________________________________________________________

提前感谢、

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="490330" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1011810/tms320f28379d-error-66-expected-a "]第48行:PieVectTable.32 =&ePWM_COMPARE_ISR; [/引用]

    您是否可以尝试用以下内容替换此行:

    PieVectTable.EPWM2_INT =&ePWM_COMPARE_ISR;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可以查看结构 PIE_VECT_TABLE 的定义并适当地分配 ISR。  

    编译器给出 了错误消息。

    此致

    Siddharth

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我尝试  了 PieVectTable.ADCA1 =&ePWM_COMPARE_ISR; 因为我想使用 ADC 中断、所以我使用了参考中提到的 MUX 等效数 手动 、但它给出了错误、即 PieVectTable 中没有名为 ADCA1的位、而参考中提到了该位 手册。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尝试使用"ADCA1_INT"而不是"ADCA1"

    此致

    Siddharth