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.

如何使用MSP432E401Y使一个IO口输出高电平

Other Parts Discussed in Thread: MSP-EXP432E401Y, MSP432E401Y

我通过官方例程修改设置一个IO口周期的输出高低电平,但使用示波器或万用表测量时电平没有变化,但是换一个接LED的IO口就有一亮一灭的现象,这是为什么?

下面是我的代码:

int main(void)
{
    MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN |
                          SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480),
                          120000000);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOB)));

    MAP_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_4);

    GPIOB->PUR |= GPIO_PIN_4;
    while(1)
    {

        MAP_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4 , 0);
        delay_us(500);
        MAP_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4 , 1);
        delay_us(500);
    }
}