您好,
我使用tm4c123g開發板,使用ccs內建的一個範例程式"hello.c"
下面是我寫的一小段程式
int
main(void)
[
//vola
tile uint32_t ui32Loop;
//
// 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 GPIO port that is used for the on-board LED.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
//
// Enable the GPIO pins for the LED (PF2 & PF3).
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2);
//
// Initialize the UART.
//
ConfigureUART();
//
// Hello!
//
UARTprintf("Hello, world!n");
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_PIN_0);
//
// We are finished. Hang around doing nothing.
//
while(1)
[
//
// Turn on the BLUE LED.
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, GPIO_PIN_2);
//
// Delay for a bit.
//
SysCtlDelay(SysCtlClockGet() / 10 / 3);
//
// Turn off the BLUE LED.
//
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 0);
//
// Delay for a bit.
//
SysCtlDelay(SysCtlClockGet() / 10 / 3);
]
]
我設定GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_PIN_0);
但在PF0的輸出,不管我設定是HIGH或是LOW,都沒有任何變化.
而且輸出的電壓都是2伏特左有變化
請問我是哪裡設定錯了???