随笔分类 -  stm32

摘要:1. 错误信息:..\Libraries\CMSIS\core_cm3.h(1502): error: #20: identifier "IRQn_Type" is undefined 2. 解决方法: 在编写的bsp_systick.h中添加#include "stm32f10x.h",且必须添加 阅读全文
posted @ 2022-02-17 21:43 JRS077 阅读(1537) 评论(0) 推荐(0) 编辑
摘要:1. 项目:51单片机可以通过控制位进行控制单片机的端口电平,类似的stm32也具有同样的功能。现在使用stm32的位带操作控制GPIO端口的电压实现流水灯效果。 2. 代码: 主函数main.c #include "stm32f10x.h" #include "bsp_led.h" /*位带操作公 阅读全文
posted @ 2022-02-10 18:11 JRS077 阅读(1474) 评论(0) 推荐(0) 编辑
摘要:1. 使用固件库操作实现按键输入检测功能,同时使用LED灯指示按键状态。 2. 代码: main.c主函数 #include "stm32f10x.h" #include "bsp_led.h" #include "bsp_key.h" /*主函数*/ int main(void) { LED_GP 阅读全文
posted @ 2022-01-25 21:48 JRS077 阅读(380) 评论(0) 推荐(0) 编辑
摘要:1. 项目:使用stm32f10x点亮LED灯,并实现流水灯效果。 2. 代码: main.c #include "stm32f10x.h" #include "bsp_led.h" /*延时函数*/ void Delay(uint32_t count) { for(;count!= 0; coun 阅读全文
posted @ 2022-01-21 20:07 JRS077 阅读(546) 评论(0) 推荐(0) 编辑
摘要:1. 编译提示:.\Objects\BH-F103.axf: Error: L6218E: Undefined symbol RCC_APB2PeriphClkCmd (referred from bsp_led.o). 2. 解决办法: 选中RCC_APB2PeriphClkCmd按F12或者右键 阅读全文
posted @ 2022-01-21 19:21 JRS077 阅读(2764) 评论(0) 推荐(0) 编辑
摘要:1. 新建文件夹stm32f10x, 然后在该文件夹内新建4个文件夹: Doc, Libraries, Project, User。 添加如下图所示,Project中无需添加。 2. 打开Keil5, 点击Project->New uVersion Project弹出Create New Proje 阅读全文
posted @ 2022-01-20 21:52 JRS077 阅读(1344) 评论(0) 推荐(0) 编辑
摘要:1. 项目:使用固件库点亮LED灯。 2. 代码: main.c #include "stm32f10x.h" #include "stm32f10x_gpio.h" /*宏定义实现快速移植*/ #define LED_GPIO_PORT GPIOB #define LED_GPIO_CLK_ENA 阅读全文
posted @ 2022-01-15 20:38 JRS077 阅读(271) 评论(2) 推荐(0) 编辑
摘要:1. 项目: 使用野火stm32指南者开发板寄存器点亮RGB LED灯。 2. 代码: main.c #include "stm32f10x.h" int main(void) { /*操作寄存器绝对地址*/ *(unsigned int *)0x40021018 |= ((1)<<3); //打开 阅读全文
posted @ 2022-01-15 20:28 JRS077 阅读(1333) 评论(0) 推荐(0) 编辑
摘要:项目: 野火STM32指南者开发板,使用寄存器点亮LED灯 代码: #include "stm32f10x.h" int main(void) { *(unsigned int *)0x40021018 |= ((1)<<3); //打开GPIO端口时钟 *(unsigned int *)0x400 阅读全文
posted @ 2022-01-04 20:58 JRS077 阅读(342) 评论(0) 推荐(0) 编辑
摘要:转载:(55条消息) keil5串口USART输出中文乱码的解决方法_zhouml_msn的博客-CSDN博客 阅读全文
posted @ 2021-11-21 22:08 JRS077 阅读(679) 评论(0) 推荐(0) 编辑
摘要:1. 项目 类似与C51单片机的位操作使能引脚来点亮LED. 例如,sbit P0^0 = 0 LED1 = P0^0; 2. 代码 main.c #include "stm32f10x.h" //相当于51单片机中的 #include <reg51.h> #include "bsp_key.h" 阅读全文
posted @ 2021-10-21 22:50 JRS077 阅读(745) 评论(0) 推荐(0) 编辑
摘要:1. 项目 通过按键控制开关LED灯,按下按键灯亮,再按一下灯灭。 2. 代码 mian.c #include "stm32f10x.h" //相当于51单片机中的 #include <reg51.h> #include "bsp_key.h" #include "bsp_led.h" void D 阅读全文
posted @ 2021-10-19 22:45 JRS077 阅读(314) 评论(0) 推荐(0) 编辑
摘要:1. 项目 使用STM32F103VE的固件库实现流水灯设计。 2. 代码 由于这是基于野火的视频进行学习的,项目代码在上节基础上进行编写的。 点亮绿灯: main.c #include "stm32f10x.h" //相当于51单片机中的 #include <reg51.h> #include " 阅读全文
posted @ 2021-10-19 18:34 JRS077 阅读(467) 评论(0) 推荐(0) 编辑
摘要:1. 项目:使用stm32寄存器点亮LED, 分别点亮红、绿、蓝3个灯。 2. 步骤 先新建个文件夹保存项目 再新建项目 将startup_stm32f10x_hd.s拷贝到该文件夹下 新建main.c子项目 再次在文件夹中新建stm32f10.h文件 编写main.c,将stm32f10.h导入编 阅读全文
posted @ 2021-10-10 15:27 JRS077 阅读(347) 评论(0) 推荐(0) 编辑
摘要:没有区别,作用相同。只是这样写便于修改和沿用。 对于只用到PB0端口的程序~(0x0f << (4*0)) 和~0x0f没有区别。0x0f <<(4*N) 就是 向左 移动N个4位,所以0x0f << (4*0)和0x0f一样。 如果使用PB1,则为~(0x0f << (4*1))。即0x0f << 阅读全文
posted @ 2021-09-29 22:00 JRS077 阅读(3148) 评论(2) 推荐(0) 编辑
摘要:1. 项目:使用stm32寄存器点亮LED, 分别点亮红、绿、蓝3个灯。 2. 代码: 只需要编写main.c程序,stm3210x.h程序为空(只需要新建即可)。 2.1 点亮绿灯main.c程序 #include "stm32f10x.h" int main(void) { //打开GPIOB端 阅读全文
posted @ 2021-09-15 22:22 JRS077 阅读(803) 评论(2) 推荐(0) 编辑
摘要:1. 错误提示信息: D:\Software\Keil5\ARM\PACK\Keil\STM32F1xx_DFP\2.1.0\Device\Include\stm32f10x.h(483): error: #5: cannot open source input file "core_cm3.h": 阅读全文
posted @ 2021-08-24 18:50 JRS077 阅读(9258) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示