【E1067】RS485通信的测试代码模板

2021-09-11 16:55:18      索炜达电子      415     

项目编号:E1067

文件大小:7M

源码说明:带中文注释

开发环境:C编译器

简要概述:

借着这个机会粗略分享一下学习心得
嵌入式编程首先就得了解硬件,只是单纯的使工作起来一开始其实不用特别深入,只要
1. 确保自己对引脚的认识正确
2. 确保各种配置正确
3. 确保软件逻辑无误
很多错误都产生于移植例程时仅仅简单改动一些表面的变量,很多需要一起更改的地方全然不知
所以在使用一个功能之前确保自己已经配合着文档认真的了解过例程,这样在做修改时就心中有数
即使遇到错误,首先也应该根据已知信息冷静的做出判断,通过逻辑分析和各种辅助工具寻找问题所在
如果最终确实是自己无法解决的问题的话,再及时向他人请教
权当做个小笔记,诸位共勉

目录│文件列表:

 └ USART2-RS485ForTest

    │ README.txt

    ├ Config

    │  │ stm32f10x_flash.icf

    │  │ stm32f10x_flash_extsram.icf

    │  │ stm32f10x_nor.icf

    │  └ stm32f10x_ram.icf

    ├ Libraries

    │  ├ CMSIS

    │  │  ├ startup

    │  │  │  │ startup_stm32f10x_cl.s

    │  │  │  │ startup_stm32f10x_hd.s

    │  │  │  │ startup_stm32f10x_hd_vl.s

    │  │  │  │ startup_stm32f10x_ld.s

    │  │  │  │ startup_stm32f10x_ld_vl.s

    │  │  │  │ startup_stm32f10x_md.s

    │  │  │  │ startup_stm32f10x_md_vl.s

    │  │  │  └ startup_stm32f10x_xl.s

    │  │  └ system

    │  │     │ core_cm3.c

    │  │     │ core_cm3.h.old

    │  │     │ stm32f10x.h

    │  │     │ system_stm32f10x.c

    │  │     └ system_stm32f10x.h

    │  └ 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

    ├ Project

    │  │ USART2-RS485.dep

    │  │ USART2-RS485.ewd

    │  │ USART2-RS485.ewp

    │  │ USART2-RS485.ewt

    │  │ USART2-RS485.eww

    │  ├ Debug

    │  │  ├ Exe

    │  │  │  │ USART1-RS485.sim

    │  │  │  │ USART2-RS485.out

    │  │  │  └ USART2-RS485.sim

    │  │  └ Obj

    │  │     │ crc.o

    │  │     │ crc.pbi.cout

    │  │     │ crc16.o

    │  │     │ crc16.pbi

    │  │     │ crc16.pbi.cout

    │  │     │ crc8.o

    │  │     │ crc8.pbi

    │  │     │ crc8.pbi.cout

    │  │     │ delay.o

    │  │     │ delay.pbi

    │  │     │ delay.pbi.cout

    │  │     │ led.o

    │  │     │ led.pbi.cout

    │  │     │ main.o

    │  │     │ main.pbi

    │  │     │ main.pbi.cout

    │  │     │ misc.o

    │  │     │ misc.pbi

    │  │     │ misc.pbi.cout

    │  │     │ mled.o

    │  │     │ mled.pbi

    │  │     │ mled.pbi.cout

    │  │     │ sled.o

    │  │     │ sled.pbi

    │  │     │ sled.pbi.cout

    │  │     │ startup_stm32f10x_hd.o

    │  │     │ stm32f10x_adc.o

    │  │     │ stm32f10x_adc.pbi

    │  │     │ stm32f10x_adc.pbi.cout

    │  │     │ stm32f10x_bkp.o

    │  │     │ stm32f10x_bkp.pbi

    │  │     │ stm32f10x_bkp.pbi.cout

    │  │     │ stm32f10x_can.o

    │  │     │ stm32f10x_can.pbi

    │  │     │ stm32f10x_can.pbi.cout

    │  │     │ stm32f10x_cec.o

    │  │     │ stm32f10x_cec.pbi

    │  │     │ stm32f10x_cec.pbi.cout

    │  │     │ stm32f10x_crc.o

    │  │     │ stm32f10x_crc.pbi

    │  │     │ stm32f10x_crc.pbi.cout

    │  │     │ stm32f10x_dac.o

    │  │     │ stm32f10x_dac.pbi

    │  │     │ stm32f10x_dac.pbi.cout

    │  │     │ stm32f10x_dbgmcu.o

    │  │     │ stm32f10x_dbgmcu.pbi

    │  │     │ stm32f10x_dbgmcu.pbi.cout

    │  │     │ stm32f10x_dma.o

    │  │     │ stm32f10x_dma.pbi

    │  │     │ stm32f10x_dma.pbi.cout

    │  │     │ stm32f10x_exti.o

    │  │     │ stm32f10x_exti.pbi

    │  │     │ stm32f10x_exti.pbi.cout

    │  │     │ stm32f10x_flash.o

    │  │     │ stm32f10x_flash.pbi

    │  │     │ stm32f10x_flash.pbi.cout

    │  │     │ stm32f10x_fsmc.o

    │  │     │ stm32f10x_fsmc.pbi

    │  │     │ stm32f10x_fsmc.pbi.cout

    │  │     │ stm32f10x_gpio.o

    │  │     │ stm32f10x_gpio.pbi

    │  │     │ stm32f10x_gpio.pbi.cout

    │  │     │ stm32f10x_i2c.o

    │  │     │ stm32f10x_i2c.pbi

    │  │     │ stm32f10x_i2c.pbi.cout

    │  │     │ stm32f10x_it.o

    │  │     │ stm32f10x_it.pbi

    │  │     │ stm32f10x_it.pbi.cout

    │  │     │ stm32f10x_iwdg.o

    │  │     │ stm32f10x_iwdg.pbi

    │  │     │ stm32f10x_iwdg.pbi.cout

    │  │     │ stm32f10x_pwr.o

    │  │     │ stm32f10x_pwr.pbi

    │  │     │ stm32f10x_pwr.pbi.cout

    │  │     │ stm32f10x_rcc.o

    │  │     │ stm32f10x_rcc.pbi

    │  │     │ stm32f10x_rcc.pbi.cout

    │  │     │ stm32f10x_rtc.o

    │  │     │ stm32f10x_rtc.pbi

    │  │     │ stm32f10x_rtc.pbi.cout

    │  │     │ stm32f10x_sdio.o

    │  │     │ stm32f10x_sdio.pbi

    │  │     │ stm32f10x_sdio.pbi.cout

    │  │     │ stm32f10x_spi.o

    │  │     │ stm32f10x_spi.pbi

    │  │     │ stm32f10x_spi.pbi.cout

    │  │     │ stm32f10x_tim.o

    │  │     │ stm32f10x_tim.pbi

    │  │     │ stm32f10x_tim.pbi.cout

    │  │     │ stm32f10x_usart.o

    │  │     │ stm32f10x_usart.pbi

    │  │     │ stm32f10x_usart.pbi.cout

    │  │     │ stm32f10x_wwdg.o

    │  │     │ stm32f10x_wwdg.pbi

    │  │     │ stm32f10x_wwdg.pbi.cout

    │  │     │ system_stm32f10x.o

    │  │     │ system_stm32f10x.pbi

    │  │     │ system_stm32f10x.pbi.cout

    │  │     │ timer.o

    │  │     │ timer.pbi

    │  │     │ timer.pbi.cout

    │  │     │ usart.o

    │  │     │ usart.pbi

    │  │     │ usart.pbi.cout

    │  │     │ USART1-RS485.pbd

    │  │     │ USART1-RS485.pbd.browse

    │  │     │ USART2-RS485.pbd

    │  │     └ USART2-RS485.pbd.browse

    │  └ settings

    │     │ USART1-RS485.crun

    │     │ USART1-RS485.dbgdt

    │     │ USART1-RS485.Debug.cspy.bat

    │     │ USART1-RS485.Debug.driver.xcl

    │     │ USART1-RS485.Debug.general.xcl

    │     │ USART1-RS485.dni

    │     │ USART1-RS485.wsdt

    │     │ USART1-RS485.wspos

    │     │ USART1-RS485_Debug.jlink

    │     │ USART2-RS485.crun

    │     │ USART2-RS485.dbgdt

    │     │ USART2-RS485.Debug.cspy.bat

    │     │ USART2-RS485.Debug.driver.xcl

    │     │ USART2-RS485.Debug.general.xcl

    │     │ USART2-RS485.dni

    │     │ USART2-RS485.wsdt

    │     │ USART2-RS485.wspos

    │     └ USART2-RS485_Debug.jlink

    └ User

       │ main.c

       │ stm32f10x_conf.h

       │ stm32f10x_it.c

       │ stm32f10x_it.h

       ├ CRC

       │  │ crc16.c

       │  │ crc16.h

       │  │ crc8.c

       │  └ crc8.h

       └ Hardware

          ├ LED

          │  │ mled.c

          │  │ mled.h

          │  │ sled.c

          │  └ sled.h

          ├ SYSTICK_DELAY

          │  │ delay.c

          │  └ delay.h

          ├ TIMER

          │  │ timer.c

          │  └ timer.h

          └ USART

             │ usart.c

             └ usart.h

TAGRS485通信的测试代码模板
  • 8 次
  • 演示
  • 1 分