
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
ID | Name | Designator | Footprint | Quantity |
---|---|---|---|---|
1 | CH340N | U3 | CH340N | 1 |
2 | LED-0603_R | LED1 | LED0603_RED | 1 |
3 | 22u | C6,C7,C8,C9 | C0603 | 4 |
4 | 0.1u | C10,C11,C12 | C0603 | 3 |
5 | 100nf | C5 | C0603 | 1 |

评论