A practical eight-way Level Measurement Instrumentation based on the 89C52 microcontroller
摘要:基于89C52单片机的实用八路物位测量仪表(以下简称测量仪),由ATMEL公司的89C52作为核心芯片,利用P1的八个I/O口作为输入口完成脉冲量信号采样,用P3口作为八路输出控制;用Maxim公司的Max7219构成串行显示来驱动LED,这种结构最大限度地利用了单片机硬件资源。同时,串行显示方式省去了单片机直接定时对LED的服务时间,节约了CPU时间,在实时性很强的工业控制系统中,显得尤为重要。
关键词:89C52 I/O口 串行显示 脉冲量
Abstract: The practical eight-way Level Meter is based on the 89C52 microcontroller (hereinafter referred meter). its core chip is structed by ATMEL's 89C52, the sampling of pulse input signal is completed by P1 interface eight I / O , and the P3 interface is used as eight-way output control, The Maxim's Max7219 is used as a serial display drive to the LED.
The system is such a optimizing structure that the hardware resources of the microcontroller is fully used. At the same time, this method of serial displays does not occupy the CPU time. It is particularly important in real-time by strong industrial control systems.
Keywords: 89C52 I / O interface serial display pulse
1 总体构成
本测量仪的信号采样通过P0口的八根输入线可接受八路经过整形后的标准TTL电平,因此可测量不同传感器传来的脉冲型物位采样信号,只要在原始信号基础上加以整形处理即可,每来一个脉冲均被P0口捕捉到并可以通过软件编制使脉冲计数增一,定时读取计数和便可以换算成相应的物位情况。通过P3.3"P3.5三条线与串行显示驱动器Max7219的连接加以软件编程可完成八位数码管显示驱动,利用P1.3"P1.6四条口线接入四个按键,完成按键操作,利用P2口作为八路输出控制,可驱动八路固态继电器。具体组成见图1。