操作环境(蓝色粗体字为特别注意内容)
1,开发板:STM32F103C8T6最小系统核心板。
1,开发板:STM32F103C8T6最小系统核心板。
2,开发环境:Keil uv5
在我的工程里面用到SysTick_Config函数,如下:
RCC_Configuration(); //系统时钟设置
NVIC_Configuration();
GPIO_Configuration(); //IO口初始化
Usart1_Init(); //串口1初始化
/* 配置systic作为1ms中断 */
if (SysTick_Config(72000)) //时钟节拍中断时1ms一次 用于定时
{
/* Capture error */
while (1);
}
FIFO_GPIO_Configuration();
Delay(2); //延时10ms
disableJTAG();
led();
其中led()函数如下:
#include "led.h"
void GpioConfigurationLed(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* Enable the GPIO_LED Clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
|RCC_APB2Periph_GPIOC
|RCC_APB2Periph_GPIOD, ENABLE);
/* Configure the GPIO_LED pin */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出