【正文】
基于 LPC1754 的條形碼 打印設計 基于 LPC1754 的條形碼打印設計 摘 要 隨著科學技術的快速發(fā)展,條形碼技術是信息數(shù)據(jù)自動識別、輸入的重要方法和手段,現(xiàn)已廣泛應用到醫(yī)療、商業(yè)、工業(yè)等使用標簽更多的行業(yè)。本文介紹了一種基于 32 位單片機 LPC1754 的條形碼打印機的組成,詳細的闡述了整個硬件工作流程以及各個功能模塊的硬件設計。該系統(tǒng)包括步進電機驅動模塊、熱敏打印頭過熱保護模塊、熱敏打印頭缺紙檢測模塊、 RS232 通信模塊以及供電等功能模塊。其中步進電機驅動模塊主要控制打印頭走紙及切紙,熱敏打印頭的過熱保護采用的是熱敏電阻保護方式,此外采用 光電傳感器完成缺紙檢測功能,采用 RS232 通信串口完成打印機與上位機之間的通信。供電模塊給控制電路及熱敏打印頭供電。本次設計結構較為簡單可以很好的實現(xiàn)條形碼打印控制功能,經反復測試,可以很好的的實現(xiàn)條形碼打印。 關鍵字 LPC1754 單片機 步進電機傳感器 RS232 熱敏打印頭 基于 LPC1754 的條形碼 打印設計 A Bar Code Printing Based LPC1754 ABSTRACT With the rapid development of science and technology, bar code automatic identification technology information data, enter the important methods and means, it has been widely applied to the medical, mercial, industrial and other use of labels more industries. This paper describes a position of 32bit microcontrollers based on the LPC1754 of bar code printers, detail the hardware design of the entire hardware workflow, and each module. The system includes a stepper motor drive modules, thermal print head overheat protection module, the thermal print head is out of paper detection module, RS232 munication module and power supply and other functional modules. Wherein the stepper motor driver module controls the print head and take the paper cutter, thermal protection thermal printing head is used thermistor protection, in addition to the use of photoelectric sensors plete paper out detection, the use of RS232 serial port for printer and PC munication munication between machines. Power supply module to the control circuit and power the thermal print head. The design of the structure is relatively simple and can achieve a good bar code print control function, after repeated tests, can be very good implementation of bar code printing. Keywords: LPC1754 microcontroller stepper motor sensors RS232 thermal print head 基于 LPC1754 的條形碼 打印設計 目 錄 中文摘要 ..................................................................................................................... 1 英文摘要 ..................................................................................... 錯誤 !未定義書簽。 1 緒論 ......................................................................................................................... 1 課題研究背景以及需求 ............................................................................. 1 課題研究的內容和目標 ............................................................................. 2 研究的意義與價值 ...................................................................................... 2 2 系統(tǒng)設計原理及方案概述 ............................................................................... 3 系統(tǒng)方案概述 ................................................................................................ 3 需求分析 ................................................................................................. 4 控制系統(tǒng)總 體設計 ...................................................................................... 4 控制系統(tǒng)的總體設計 ............................................................................. 4 3 系統(tǒng)硬件設計 ....................................................................................................... 6 電源電路 ......................................................................................................... 6 5V 電源電路 ............................................................................................ 6 電源電路 ........................................................................................ 7 電源保護電路 ....................................................................................... 10 主控系統(tǒng) ....................................................................................................... 11 最小系統(tǒng)電路 ....................................................................................... 11 邊界掃描系統(tǒng) (JTAG 接口 ) .................................................................. 13 復位電路 ............................................................................................... 15 時鐘電路 ............................................................................................... 16 步進電機驅動系統(tǒng) .................................................................................... 17 基于 LPC1754 的條形碼 打印設計 步進電機驅動模塊 ............................................................................... 17 步進電機選型及其優(yōu)點 ....................................................................... 19 打印頭工作模塊 ......................................................................................... 21 熱敏打印頭過熱保護 模塊 ...................................................................... 22 熱敏打印頭缺紙檢測模塊 ...................................................................... 23 4 系統(tǒng)軟件設計 ..................................................................................................... 25 熱敏投打印初始化函數(shù) ........................................................................... 26 SPI 數(shù)據(jù)發(fā)送函數(shù) ..................................................................................... 26 SPI 初始化函數(shù) .......................................................................................... 27 熱敏打印數(shù)據(jù)處理函數(shù) ........................................................................... 27 熱敏打印頭停止打印函數(shù) ...................................................................... 27 總 結 ....................................................................................................................... 29 致 謝 ....................................................................................................................... 30 參考文獻 ................................................................................................................... 31 附 錄 ...........................................................................................