[En-Nut-Discussion] LCD_DELAY in avr/dev/hd44780.c
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Fri Sep 8 15:29:38 CEST 2006
>>>>> "Ole" == Ole Reinhardt <ole.reinhardt at kernelconcepts.de> writes:
Ole> Hi,
>> Anyone else got the time to add it to the repository? If not, please
>> post a reminder if it doesn't appear in the CVS within the next days.
Ole> I just added it to the CVS.
What is the proper way to submit to CVS.
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.
Changelog:
arch/avr/dev/hd44780.c:
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
sbi(LCD_ENABLE_PORT, LCD_ENABLE_BIT);
LCD_DELAY;
+ ret = inp(LCD_DATA_PIN) & LCD_DATA_BITS;
cbi(LCD_ENABLE_PORT, LCD_ENABLE_BIT);
LCD_DELAY;
- 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