Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] OT: HD44780 LCD lock-up - busy flag stays set

2007-08-22 by Tim Gilbert

Mark,
Being HD44780 compatible only means that they cloned the command set developed by Hitachi some 20 years ago.  In my collection of LCDs (and I have a lot of them), I've only ever seen 1 unit that had real hitachi HD44780 chips  (it's really old and required the 8 bit interface!).  The original LCD modules required several driver and controller chips to run the display.  That's way we now have displays, like the 16x4, where the pcb is twice as big as the glass.  Everything has changed except the archaic command set and the oversized footprint.

I've run into this lockup problem once several years ago while trying to control a 1 HP motor.  Every so often the noise from the motor would lock up the LCD module.  The problem was related to the ribbon cable running to the display.  (That's why in all our prototype development kits we keep the lcd connection as short as possible.)  Another option is to control the power to the LCD module so you and reset it if it locks up.

There is a huge difference in the quality of LCD modules and I don't think the problem is with your design.  I wouldn't try to patch it if it's worked for 15 years; tell your purchasing agent to go back to the old supplier; he didn't save you any money.

Regards,

Tim Gilbert
JEM Innovation Inc.
303-926-9053 (office)
303-437-4342 (cell)
720-890-8582 (fax)
www.jeminnovation.com
www.pdksolutions.com


  ----- Original Message ----- 
  From: Mark Nowell 
  To: AVR-Chat@yahoogroups.com 
  Sent: Wednesday, August 22, 2007 6:59 AM
  Subject: [AVR-Chat] OT: HD44780 LCD lock-up - busy flag stays set


  Apologies in advance for the thoroughly non-AVR question but I'm really 
  tearing my hair out with an LCD problem and I'm sure there are some 
  really clever/experienced LCD'ers here (grovel, scrape) ...

  We've recently switched to yet another cheaper, brighter, 16x2, HD44780 
  compatible LCD (Ampire AC162DY1LY). A small number of these latest 
  displays lock-up after correctly initialising and executing a (variable) 
  number of display commands. By "lock-up" I mean that the busy-flag stays 
  set for at least 150ms, after which time the watchdog resets the micro, 
  which then attempts to re-initialise the display, and fails, presumably 
  because it's still busy. Display shows the last written text overwritten 
  by blocks on the top line, bottom line blank. The display controller 
  appears to still be alive because the successive E-cycles show different 
  data-bit patterns for the alternate BF and AC3 cycles (4-bit mode).

  The LCD driver code has been untouched over 15 years, several thousand 
  displays and half-a-dozen different display types. I've double-checked 
  the timings and they're not even close to marginal. Code below [ok, it's 
  an 80C196 but the comments are in english - 12MHz - port writes take 
  833ns, branches 833/1500ns - I'll claim it's a deliberate reminder of 
  how what a marvel AVR RISC is].

  Has anyone experienced anything like this? Should I suspect faulty 
  displays? Or my code?

  TIA,
  Mark

  void LMFWriteData( void ) {
  /* on entry LMDATA contains DB0-7 */
  /* check busy status */
  asm bbc lmNoDisplay,0,checkBusyFlag ;
  asm br lmfwdEnd ;
  checkBusyFlag:
  ioport1 = 0x2f ; /* rw=1, db4-7=weak1, e=rs=0 */
  ioport1 = 0x6f ; /* e=1, db7->busy flag */
  asm bbc ioport1,3,busyFlagClr ;
  ioport1 = 0x2f ; /* e=0 */
  ioport1 = 0x6f ; /* e=1, db7->AC3 */
  asm br checkBusyFlag ;
  busyFlagClr:
  ioport1 = 0x2f ; /* e=0 */
  ioport1 = 0x6f ; /* e=1, db7->AC3 */
  ioport1 = 0x2f ; /* e=0 */
  /* write instr */
  asm ldb LMDATAHI,LMDATA ;
  asm shrb LMDATAHI,#4 ; /* LMDATAHI.0-3=hi data */
  asm andb LMDATA,#0x0f ; /* Clr LMDATA.4-7 */
  asm ldb ioport1,#0x1f ; /* put rs=1,r/w=0,db4-7=weak1,e=0 */
  asm addb ioport1,LMDATAHI,#0x50 ; /* e=1,db4-7=hi data */
  asm addb ioport1,LMDATAHI,#0x10 ; /* e=0 */
  asm addb ioport1,LMDATA,#0x50 ; /* put lo data,e=1 */
  asm addb ioport1,LMDATA,#0x10 ; /* e=0 */
  lmfwdEnd: ;
  }



   

[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.