【B113】STM32 IO口模拟实现软件串口

2021-08-15 14:49:25      索炜达电子      458     

项目编号:E113

文件大小:283K

源码说明:带中文注释

开发环境:C编译

简要概述:

实现思路

-IO口模拟串口的思路也比较简单,一切按串口协议进行操作即可。

-对于发送,计算好不同波特率对应的延时时间进行数据发送。

-对于接收,稍微复杂。通过外部中断检测接收管脚的下降沿,检测到起始信号后开启定时器,定时器按照波特率设定好时间,每隔一段时间进入定时器中断接收数据,完成一个字节后关闭定时器。

测试Demo说明

TXD : PC13

RXD : PB14

波特率:9600 ,1-8-N

Demo功能

接收11个数据,然后把接收到的数据发送出去

文件列表:

目录│文件列表:

 └ SoftWareSerial

    │ keilkilll.bat

    ├ CORE

    │  │ core_cm3.c

    │  │ core_cm3.h

    │  └ startup_stm32f10x_hd.s

    ├ OBJ

    │  │ SoftWareSerial.hex

    │  └ Template.hex

    ├ STM32F10x_FWLib

    │  ├ inc

    │  │  │ misc.h

    │  │  │ stm32f10x_adc.h

    │  │  │ stm32f10x_bkp.h

    │  │  │ stm32f10x_can.h

    │  │  │ stm32f10x_cec.h

    │  │  │ stm32f10x_crc.h

    │  │  │ stm32f10x_dac.h

    │  │  │ stm32f10x_dbgmcu.h

    │  │  │ stm32f10x_dma.h

    │  │  │ stm32f10x_exti.h

    │  │  │ stm32f10x_flash.h

    │  │  │ stm32f10x_fsmc.h

    │  │  │ stm32f10x_gpio.h

    │  │  │ stm32f10x_i2c.h

    │  │  │ stm32f10x_iwdg.h

    │  │  │ stm32f10x_pwr.h

    │  │  │ stm32f10x_rcc.h

    │  │  │ stm32f10x_rtc.h

    │  │  │ stm32f10x_sdio.h

    │  │  │ stm32f10x_spi.h

    │  │  │ stm32f10x_tim.h

    │  │  │ stm32f10x_usart.h

    │  │  └ stm32f10x_wwdg.h

    │  └ src

    │     │ misc.c

    │     │ stm32f10x_adc.c

    │     │ stm32f10x_bkp.c

    │     │ stm32f10x_can.c

    │     │ stm32f10x_cec.c

    │     │ stm32f10x_crc.c

    │     │ stm32f10x_dac.c

    │     │ stm32f10x_dbgmcu.c

    │     │ stm32f10x_dma.c

    │     │ stm32f10x_exti.c

    │     │ stm32f10x_flash.c

    │     │ stm32f10x_fsmc.c

    │     │ stm32f10x_gpio.c

    │     │ stm32f10x_i2c.c

    │     │ stm32f10x_iwdg.c

    │     │ stm32f10x_pwr.c

    │     │ stm32f10x_rcc.c

    │     │ stm32f10x_rtc.c

    │     │ stm32f10x_sdio.c

    │     │ stm32f10x_spi.c

    │     │ stm32f10x_tim.c

    │     │ stm32f10x_usart.c

    │     └ stm32f10x_wwdg.c

    ├ SYSTEM

    │  ├ delay

    │  │  │ delay.c

    │  │  └ delay.h

    │  ├ sys

    │  │  │ sys.c

    │  │  └ sys.h

    │  └ usart

    │     │ usart.c

    │     └ usart.h

    └ USER

       │ JLinkSettings.ini

       │ main.c

       │ SoftWareSerial.uvguix.Administrator

       │ SoftWareSerial.uvguix.Tony

       │ SoftWareSerial.uvoptx

       │ SoftWareSerial.uvprojx

       │ stm32f10x.h

       │ stm32f10x_conf.h

       │ stm32f10x_it.c

       │ stm32f10x_it.h

       │ system_stm32f10x.c

       └ system_stm32f10x.h

TAG软件串口
  • 7 次
  • 1 分