这个是我写的一个测试程序,经验证是PB4可以正常翻转。
可以到你的板子上测试一下。如果无法输出可能是硬件的问题.
int
main(void)
[
//
// Enable lazy stacking for interrupt handlers. This allows floating-point
// instructions to be used within interrupt handlers, but at the expense of
// extra stack usage.
//
ROM_FPULazyStackingEnable();
//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
SYSCTL_OSC_MAIN);
//
// Enable the peripherals used by this application.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlDelay(10);//模块时钟使能需要等待6个cycle以上
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_4);
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4,GPIO_PIN_4);
//
while(1)
[
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4, GPIO_PIN_4);
SysCtlDelay(5000);
ROM_GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_4, 0);
SysCtlDelay(5000);
]
]