#include "hw_types.h" #include "srcsystick.h" #include "srcsysctl.h" #include "hw_ints.h" #include "hw_nvic.h" #include "srcinterrupt.h" #include "srcgpio.h" #include "hw_memmap.h"
#define PINS GPIO_PIN_4
void SysTickISR(void) { static unsigned int temp=PINS; GPIOPinWrite(GPIO_PORTB_BASE,PINS,temp); temp=~temp; }
int main(void) { SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_OSC|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); GPIODirModeSet(GPIO_PORTB_BASE,PINS,GPIO_DIR_MODE_OUT); GPIOPinWrite(GPIO_PORTB_BASE,PINS,PINS);
SysTickPeriodSet(SysCtlClockGet()/1000-1); SysTickIntRegister(SysTickISR); SysTickEnable(); SysTickIntEnable(); IntMasterEnable();
while(1);
}
不知道哪里有问题,总是进不了SYSTICK中断。 KEIL 3.05A
|