微控制器( Microcontroller )具有低消耗功率、高性能、低單價等特性,其應用極為廣泛,如工業控制、車用電子裝置、辦公室自動化( OA )及家用消費性電子等等用途。由於其應用領域不斷的擴大,使得今後在大部份的產品都將會有嵌入式( Embedded )的功能內建在其中,所以微控制器( Microcontroller )所佔的份量一直是有增無減。而Modbus協定為工業界所使用的通訊協定,如電表、變頻、PLC等。 本論文係以嵌入式微控制器為核心,依據Modbus協定,使用C語言自行研發應用軟體,應用於讀取類比信號及數位輸入信號,或寫入資料,經串列通訊,作雙向通訊的功能,完成控制、監控及資料蒐集之目的。 本論文所研發之應用軟體,係針對工業應用上的需求或其不足處,其特色為具有Modbus協定通訊及自動鮑率檢測等功能。一般串列通訊在傳送資料時,須先設定鮑率,如鮑率不合則造成無法通訊。經驗証結果,本文應用Modbus及自動鮑率檢測等功能,改善了通訊問題。
The Microcontroller has low power, high performance, low price, etc. The applications include Car Electronics, Office Automation and Consumer Electronics, etc. And the Modbus Protocol is used to communicate in industry, such as the Ammeter, Inverter, PLC and etc. This thesis uses the core of the Embedded Microcontroller, then using C Language to research and development the software which reading the analog signal and digital input signal, or writing the data by myself according to the Modbus Protocol. It completes to control, monitor, and search the data when using the serial port to write or read. The software that research and development is mainly aimed at the industry application. It includes the Modbus Protocol communication and AutoBaued Rate function and etc. The serial port have to configure the baud rate format before transmitting, we can not communicate if the baud rate format is not correct. The findings of the examination, this thesis applies the Modbus Protocol and AutoBaud detect function to improve the communication problems.