













摘要:針對采用控制器局域網絡(CAN: Controller Area Network)總線的自動操舵系統和采用串口通訊的航海導航設備之間通訊的不匹配問題, 設計了一種基于Cortex-M3嵌入式平臺的通信轉換模塊, 實現了串口與CAN總線數據的雙向轉換功能。同時對傳統CAN收發器CTM1050存在的信號穩定性不足、 波特率精準度低等問題, 提出并實現了一種硬件電路的替代方案, 提高了數據通訊的時效性和穩定性?;贑AN2.0B擴展幀, 設計了自動操舵系統內部CAN總線協議。該協議可根據報文信息優先級分配標識幀, 保證了總線數據的有序傳輸。實驗結果表明, 該通訊模塊功能使用正常且通訊效果良好, 具有一定通用性, 可在多種需要轉換的設備系統上推廣使用。
關鍵詞:Cortex-M3微控制單元; 控制器局域網絡; 串口; 自動操舵系統; 標識符
中圖分類號: TP273 文獻標志碼: A
Design and Implementation of Serial Port and CAN Conversion Interface Based on Cortex-M3
CHEN Jielu, HE Guoxiang, YANG Zijian, SHI Chaofan
(Process Department, CSSC Marine Technology Limited Liability Company, Shanghai 200136, China)
Abstract: In order to solve the problem of communication mismatch between autopilot system using CAN (Controller Area Network)bus and navigation equipment using serial port communication, a communication conversion interface module based on Cortex-M3 is designed and the function of data conversion between serial port and CAN bus is realized. Aiming at the problems of poor signal stability and low baud rate accuracy of traditional CAN transceiver circuit CTM1050, an alternative hardware scheme is proposed and implemented to improve the timeliness and stability of data communication. Based on the CAN2.0B extension frame, the internal CAN bus protocol of the autopilot system is designed to ensure the scalability and stability of the bus. The protocol can assign identity frames according to the priority of message information to ensure the orderly transmission of bus data.The actual test results indicate that the communication module is normal and the communication effect is good. The communication module has a certain universality and can be used in a variety of equipment systems.
Key words: Cortex-M3 microcontroller unit; controller area network(CAN); serial port; autopilot system; identifier
0 引 言
船用自動操舵系統是在舵手輸入目標航向或位置信息后自動操控舵機打舵使艦船到達準確的目標航向或地點, 相當于艦船的大腦, 實時發出指令至舵機。自動操舵系統與電子海圖、 羅經、 計程儀、 BNWAS(Bridge Navigational Watch amp; Alarm System)等航海導航設備組成智能航行系統, 在操控過程中實時接收位置、 航向、 速度和舵角等航海導航信息進行算法處理后發出適時的操控指令, 因此保證前端數據通訊的穩定性及實效性是保障操控精準的關鍵。
隨著計算機技術與現場總線技術的發展, 船舶數據通信領域正在發生一場深刻的技術革命。相較于傳統的串口通信模式, CAN(Controller Area Network)現場總線具有傳輸距離遠、 速度快、 可靠性高、 抗干擾能力強等特點, 因此更多地應用于船舶通訊網絡中[1]?!?br>