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.

关于28374S的GPIO误动作问题

波形图说明:绿色为GPIO67输出信号,低电平使能48V电压输出;黄色为48V输出,当绿色低电平时输出,高电平截止。紫色为直流电压,代表整个机器开通管段,蓝色是交流电压。整个系统是整流器。

通过开关电源获得的波形图,上电后,GPIO67始终为高电平与预期一致,48V也无输出

通过整流器直流母线接辅助电源供电,上电初会有GPIO67误动作,且随后会周期出现

对于周期出现的问题,将代码:

	if(SoftErrFlag==0)
	{
	    GpioDataRegs.GPCCLEAR.bit.GPIO67 = 1;
	}

	if(SoftErrFlag==1)
	{
	    PWM_Disable();
	    GpioDataRegs.GPCSET.bit.GPIO67 = 1;
            GpioDataRegs.GPBCLEAR.bit.GPIO41 = 1;
	    GpioDataRegs.GPBCLEAR.bit.GPIO50 = 1;
	}

改为:

	if(SoftErrFlag==0)
	{
		counter++;
		if(counter==100)
		{
			GpioDataRegs.GPCCLEAR.bit.GPIO67 = 1;
			counter=0;
		}
	}

	if(SoftErrFlag==1)
	{
		PWM_Disable();
		counter=0;
		GpioDataRegs.GPCSET.bit.GPIO67 = 1;
		GpioDataRegs.GPBCLEAR.bit.GPIO41 = 1;
		GpioDataRegs.GPBCLEAR.bit.GPIO50 = 1;
	}

提高抗干扰性后没问题了

但第一次上电的误动作还在,最后通过参考问题:e2echina.ti.com/.../118035

将代码

// Step 1. Initialize System Control:
 	InitSysCtrl();
	memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
// Step 2. Initialize GPIO:
	InitGpio();

改为

// Step 1. Initialize System Control:
 	InitSysCtrl();
	memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
// Step 2. Initialize GPIO:
	InitGpio();
	GpioDataRegs.GPCSET.bit.GPIO67 = 1;

没有问题了。

那么问题来了,为什么在InitGpio();后面添加一句GpioDataRegs.GPCSET.bit.GPIO67 = 1;就不会误动作了?