基于STC单片机的数字采控电路设计
2018-04-13胡邓华冯刚孙际哲
胡邓华 冯刚 孙际哲
摘 要: 以STC15F2K60S2单片机为控制核心,利用74HC165扩展40个TTL输入端口,74HC595扩展48个TTL输出端口,MAX7219扩展8位数码管显示驱动,并利用STC15F2K60S2单片机集成的A/D转换器提供8路10位A/D通道。上位机可以通过无线通信方式控制该采控电路。通过仿真和测试显示,该电路运行可靠、通用性强、成本低廉,具有很好的实际应用价值。
关键词: 数字输出控制; 数字输入采集; 数码管显示; 模/数转换; STC15F2K60S2; 无线通信
中图分类号: TN431.2?34; TP274.2 文献标识码: A 文章编号: 1004?373X(2018)08?0053?04
Abstract: Taking the microcontroller STC15F2K60S2 as the control core, 40 TTL input ports are extended by using the 74HC165, 48 TTL output ports are extended by using the 74HC595, 8?bit nixie tube display driver is extended by using the MAX7219, and eight 10?bit A/D channels are provided by using the A/D converter integrated by the microcontroller STC15F2K60S2. The host computer can control the acquisition and control circuit by means of wireless communication. The simulation and test results show that the circuit has reliable operation, high universality, and low cost, which has a good practical application value.
Keywords: digital output control; digital input acquisition; nixie tube display; A/D conversion; STC15F2K60S2; wireless communication
随着信息化技术的发展,数字采控系统已越来越广泛地应用于工业控制、军事应用及农业生产等多个领域。采控对象可分为按钮开关输入、电位计模拟量输入、指示灯开关量输出及LED或LCD指示输出等[1?3]。数字采控电路对整个系统的正常运行具有重要意义,因此设计结构简单、性能稳定、通用性好、成本低廉的数字采控电路十分必要[4?6]。本文采用STC15F2K60S2单片机为控制核心,由6片74HC595芯片串联扩展48个数字输出接口;由5片74HC165芯片扩展40个数字输入接口;由MAX7219驱动8位数码管动态显示;采用STC15F2K60S2单片机集成的10位A/D模块提供8路模/数转换通路;采用nRF24L01无线数传模块设计全双工异步串行无线通信接口。该数字采控电路具有I/O端口多、设计简单、性价比高等特点,可广泛应用于各种采集控制应用系统[4]。
1 系统工作原理
该采控电路主要由控制中心、I/O输入模块、I/O输出模块、A/D转换模块、数码显示模块、电路地址设置及无线通信模块组成,通过无线通信模块和上位机相连,其系统的硬件组成如图1所示。……
