
STM32F103最小系统
简介
基于STM32F103VET6最小系统,可直接连接仿真器下载程序,或用USB下载
简介:基于STM32F103VET6最小系统,可直接连接仿真器下载程序,或用USB下载开源协议
:Public Domain
描述
测试程序
下载程序到最小系统中,让B0接入一个led测试模块,若灯亮则没问题
#include "stm32f10x.h"
#define LED_PORT GPIOB
#define LED_PIN (GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7)
#define LED_PORT_RCC RCC_APB2Periph_GPIOB
int main()
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(LED_PORT_RCC,ENABLE);
GPIO_InitStructure.GPIO_Pin=LED_PIN;
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
GPIO_Init(LED_PORT,&GPIO_InitStructure);
GPIO_SetBits(LED_PORT,LED_PIN);
while(1)
{
GPIO_ResetBits(LED_PORT,GPIO_Pin_0);
}
}
设计图
未生成预览图,请在编辑器重新保存一次BOM
暂无BOM
克隆工程

评论