Based on the study and analysis of PROFIBUS-DP protocol in IEC61158 standard,we implement the data link layer andapplication layer of the master class one of PROFIBUS-DP in software approach strictly according to the standard of the protocol based onuCOS-II operating system and STM32F107VC6 MCU.The software master adopts the mode of shared buffer to transfer the primitives of statemachines,implements uniform scheduling and management of each module through scheduling tasks,and sends and receives the texts usingDMA mode.Implementation result indicates that the master achieves the function of master class one of PROFIBUS-DP,the real-timeproperty of fieldbus reaches the time index.The above provides the theoretical guidance and logic validation for the design and development ofcommunication chip of master class one of PROFIBUS-DP in the future.%通过对IEC61158标准中的PROFIBUS-DP协议的研究分析,基于uCOS-II操作系统和STM32F107VC6芯片,用软件的方式严格按照协议标准实现了PROFIBUS-DP一类主站的数据链路层和应用层。软件主站采用共享缓存区的方式传递状态机原语,通过调度任务对各个模块实行统一调度管理,通过DMA方式发送和接收报文。结果表明,该主站实现了PROFIBU-DP一类主站的功能,总线系统的实时性达到时间指标。为将来设计开发PROFIBUS-DP一类主站的通信芯片提供了理论指导和逻辑验证。
展开▼