您当前的位置:五五电子网电子知识单片机-工控设备DSP/FPGA技术微处理器仅用一条线驱动LCD的实现 正文
微处理器仅用一条线驱动LCD的实现

微处理器仅用一条线驱动LCD的实现

点击数:7540 次   录入时间:03-04 11:42:13   整理:http://www.55dianzi.com   DSP/FPGA技术

  MICroChip公司 PIC10F 系列 微处理器 使用单一I/O管脚 驱动 HD44780 LCD 。

  HD44780 LCD是嵌入式系统中最流行的文字数字显示装置。唯一的不足是它们在4位逐点显示模式下使用6个I/O管脚,8位模式下使用11个管脚。早期设计方案已经描述了许多节省或扩展I/O管脚的方法(参考文献1~3)。驱动兼容HD44780的LCD,使用基线微处理器替代逻辑芯片更好,因为微处理器价格低,占用空间小,且有可编程性。Microchip推出最小的PIC10F微处理器系列,具有6管脚SOT23封装形式。

  图1中电路证明了,对任意管脚有限的嵌入式系统,单线与兼容HD44780显示的接口是可用的,这个单线串联为通过一个波特率9600的异步单一RS232协议。使用PIC10F202, PIC10F系列的任何一款都合适,因为列表1中高优化源代码允许程序代码少于256个字。尝试高于9600的波特率是没有用的,因为PIC10F202使用1%频率误差的RC内部晶振,LCD需要如说明书上所称“清屏”的延时时间为长达1.6ms。

系统电路图

  列表1(程序列表见英文原文)为LCD232模块的 全注释汇编程序源代码;主程序由2?sec延时“刷屏”的显示组成,然后进入死循环等待LCD的1字节命令,LCD数据最大为16个字节,和ASCII码零。出于外部PIC微处理器嵌入式系统测试的目的,列表2为简单的汇编源代码发送另一个刷屏命令。

  英文原文:

  Microcontroller drives LCD with just one wire

  A Microchip PIC10F family microcontroller sparks an HD44780 LCD using a single I/O PIN.

  Noureddine Benabadji, University of Sciences and Technology, Oran, Algeria; Edited by Charles H Small and Fran Granville -- EDN, 12/3/2007

  HD44780 LCDs are the most popular alphanumeric displays in embedded systEMS. The only downside is that they use six I/O pins in 4-bit nibble mode and as many as 11 pins in 8-bit mode. Earlier Design Ideas have described many approaches to saving or expanding I/O pins (reference 1, reference 2, and reference 3). In driving an HD44780-compatible LCD, it would be better to use a baseline microcontroller instead of logic chips, because the microcontroller is lower cost, uses less board sPACe, and has programming features. Microchip has introduced the smallest PIC10F microcontroller family, which comes in a six-pin SOT-23 package.

  The circuit in Figure 1 proves useful for any pin-limited embedded system that must interface with an HD44780-compatible display through a one-wire serial link using an asynchronous, simplified RS?232 protocol at 9600 baud. It uses a PIC10F202, but any member of the PIC10F family is suitable, because the highly optimized source code in Listing 1 allows the program code to take fewer than 256 words. It is useless to try higher baud rates than 9600,because the PIC10F202 uses an RC internal oscillator with 1%-Frequency tolerance, and the LCD requires a delay as long as 1.6 msec for some instructions, such as “clear display.”

www.55dianzi.com

  Listing 1 is the fully commented assembler source code for the LCD 232 module; the main routine consists of the display of a 2?sec-delay “splash screen,” and then it enters an endless loop to wait for 1 byte as a command for the LCD, a maximum of 16 bytes as data for the LCD, and an ASCII zero. For test purposes wit h an external PIC microcontroller embedded system, Listing 2 is a simple assembler source code, which sends another splash screen.

  References

  Raynus, Abel, “Squeeze extra outputs from a PIN-limited microcontroller,” EDN, Aug 4, 2005, pg 96.

  “Microcontroller provides low-cost analog-to-digital conversion, drives seven-segment displays,” EDN, May 10, 2007, pg 80.

  Niven, Rex, “RC lowpass fiLTEr expands microcomputer’s output port,” EDN, June 21, 2007, pg 74.
 
英文原文地址: http://www.edn.com/article/CA6505569.html




本文关键字:微处理器  DSP/FPGA技术单片机-工控设备 - DSP/FPGA技术