[En-Nut-Discussion] LCD_DELAY in avr/dev/hd44780.c

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri Sep 8 17:37:45 CEST 2006

>>>>> "Ole" == Ole Reinhardt <ole.reinhardt at kernelconcepts.de> writes:

    Ole> Hi Uwe,
    >> What is the proper way to submit to CVS.

    Ole> Do you have CVS write access to the NutOS repository?

I have not (yet) applied for CVS write access, so I don't think I have write
access. Maybe later.

    Ole> In this case you first need to check out the most recent version
    Ole> and then apply your patch. Next check in the patch again.

    Ole> This would look like this...

    Ole> cvs update (update your tree) patch...  cvs checkin (checkin the
    Ole> changes)

    >> I found another problem. LCD Read data is only valid after some delay
    >> (tddr = 160 ns) with E asserted. LcdReadNibble first cleared E and
    >> then only read the data.

    Ole> You could send me your patch again, if you like, I'll check this
    Ole> into the CVS too.

The patch was appended in the original mail, but I have appended  again.
Please review and apply.
	Read LCD data after delay while Enable still asserted

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
--- nut/arch/avr/dev/hd44780.c.~1.3.~	2006-09-07 17:53:27.000000000 +0200
+++ nut/arch/avr/dev/hd44780.c	2006-09-08 15:17:20.000000000 +0200
@@ -144,13 +144,15 @@
 static INLINE u_char LcdReadNibble(void)
+    u_char ret;
     sbi(LCD_RW_PORT, LCD_RW_BIT);
     outp(inp(LCD_DATA_DDR) & ~LCD_DATA_BITS, LCD_DATA_DDR);   // enable data input
+    ret = inp(LCD_DATA_PIN) & LCD_DATA_BITS;
-    return inp(LCD_DATA_PIN) & LCD_DATA_BITS;
+    return ret;
 static INLINE u_char LcdReadByte(void)

More information about the En-Nut-Discussion mailing list