zoukankan      html  css  js  c++  java
  • STM32串口通信程序设计要点

    设计要点:

    1、要是能串口时钟同时要是能复用总线时钟和对应的IO时钟,如:

    //使能串口1,PA,AFIO总线

        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | 

                RCC_APB2Periph_AFIO |

                RCC_APB2Periph_USART1 , 

                ENABLE);

    2、stm32f10x_conf.h 中使能 

    #include "stm32f10x_usart.h"  

    #include "misc.h"

    3、使能中断的话要配置NVIC,在中断函数中加入相应的程序。

    简单的配置例程:

     

    ★emouse 思·睿博客文章★ 原创文章转载请注明:http://emouse.cnblogs.com
  • 相关阅读:
    浮点数
    2020.07.13
    2020.07.07
    2020.07.06
    剑指offer(三)
    剑指offer(二)
    剑指offer
    堆排序
    归并排序
    希尔排序
  • 原文地址:https://www.cnblogs.com/emouse/p/2198193.html
Copyright © 2011-2022 走看看