#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#define PINS GPIO_PIN_6
void delay(int d)
{
for(;d;--d);
}
void SysCtlClockSet(unsigned long ulConfig)
{}
void SysCtlPeripheralEnable (unsigned long ulPeripheral)
{}
void GPIODirModeSet(unsigned long ulPort,unsigned char ucPins,unsigned long ulPinIO)
{}
void GPIOPinWrite(unsigned long ulPort, unsigned char ucPins, unsigned char ucVal)
{}
int main(void)
{
unsigned int i;
SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_OSC|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ);//直接使用外部晶振
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);//使能GPIO的PB模块
GPIODirModeSet(GPIO_PORTB_BASE,PINS,GPIO_DIR_MODE_OUT);//设置PB6输出
for(i=0;i<10;i++)
{
GPIOPinWrite(GPIO_PORTB_BASE,PINS,~PINS);//置PB6低电平
delay(20000);
GPIOPinWrite(GPIO_PORTB_BASE,PINS,PINS);//置PB6高电平
delay(20000);
}
SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_6MHZ);//使用PLL
for(i=0;i<10;i++)
{GPIOPinWrite(GPIO_PORTB_BASE,PINS,~PINS);
delay(20000);
GPIOPinWrite(GPIO_PORTB_BASE,PINS,PINS);
delay(20000);
}
return 0;
}
用的CCSV5 单步执行能执行,但是发现相应的管脚寄存器数据不改变一直是0xBAD0BAD0 |