With regard to the plug-and-play problems of the uncertain number of slave stations on RS485 bus,taking the detection requirements of photoelectric modules as an example,a plug-and-play software control method of RS485 bus based on the unique identifier of single chip microcomputer equipment is proposed in the paper.Without changing the hardware circuit,through this method,functions including scanning the number of slave stations,automatically distributing the addresses of slave stations and hot plug detecting for slave stations in the RS485 buses can all be realized.In addition,the effectiveness and flexibility of this method can be proved by experimental data,which solves the problems of user’s demand for arbitrary plugging of the slave stations.
Key words
RS485 /
STM32G473 /
device unique identifier /
plug-and-play /
hot plug
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
References
[1] 刘晨峰.一种基于RS485的异步串行通信设计[J].中国新通信,2019,21(10):21-23.
[2] 陈彬,陈从靖.基于高速串行总线的分布式RS485串口通信接口设计[J].工业控制计算机,2021,34(11):12-13.
[3] 温子祺.ARM Cortex-M4微控制器深度实战[M].北京:北京航空航天大学出版社,2018.
[4] 陶洋.网络系统特性研究与分析[M].北京:国防工业出版社,2014.
[5] 杨希桐.浅谈RS-485通信网络对配套电缆的要求[J].中国新通信,2020,22(10):24.
[6] 张莉,邬宝寅.一种改进型RS485总线设计[J].自动化与仪表,2016,31(10):32-35.
[7] 张加易,柏思忠.RS485总线型即插即用技术研究及实现[J].自动化与仪器仪表,2016(8):87-88.
[8] ST Microelectronics.RM0440 Reference Manual-STM32G4 Series[EB/OL].[2023-01].https://www.st.com/en/microcontrollers-microprocessors/stm32g473rc.html.
[9] 杭春烁,金豫,洪若昕.一种基于DMA方式的高效UART收发机制[J].单片机与嵌入式系统应用,2021,21(5):22-24.
[10] 马涛.DCS和PLC通讯技术在给煤机中的应用[J].科学与财富,2017(24):161.
[11] 邰鸣,李双田.基于RS485通信方式的多单片机控制系统[J].微计算机应用,2008,29(7):109-112.