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.

28335GPIO不受控



电路如上图所示,其中LED0=GPIO34,LED1=GPIO35。

初始化如下

EALLOW;

// Initialize GPIO pins for LED circuit
//---------------------------------------------------------------------------
// LED0
GpioCtrlRegs.GPBPUD.bit.GPIO34 = 0; // Enable pullup on GPIO34
GpioCtrlRegs.GPBMUX1.bit.GPIO34 = 0; // GPIO34 = GPIO34
GpioDataRegs.GPBSET.bit.GPIO34 = 1; // GPIO34 = high
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1; // GPIO34 = output
// LED1
GpioCtrlRegs.GPBPUD.bit.GPIO35 = 0; // Enable pullup on GPIO35
GpioCtrlRegs.GPBMUX1.bit.GPIO35 = 0; // GPIO35 = GPIO35
GpioDataRegs.GPBSET.bit.GPIO35 = 1; // GPIO35 = high
GpioCtrlRegs.GPBDIR.bit.GPIO35 = 1; // GPIO35 = output

EDIS;

测试程序如下

void LedCircuitTest()
{
 GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1;        // Turn on LED0
DELAY_US(1000000);                                              // Delay 1s
GpioDataRegs.GPBSET.bit.GPIO34 = 1;              // Turn off LED0

GpioDataRegs.GPBCLEAR.bit.GPIO35 = 1;        // Turn on LED1
DELAY_US(1000000);                                             // Delay 1s
GpioDataRegs.GPBSET.bit.GPIO35 = 1;             // Turn off LED1
}

问题:LED0、LED1不亮,GPIO34和GPIO35两引脚的电压始终为+3.3V,这是为什么?先谢过了。