[En-Nut-Discussion] RE: Medianut and LCD display

Eduardo Serantes eserantes at telefonica.net
Thu Dec 23 13:16:36 CET 2004


Hi Bent,

I have got working ok a 16x2 LCD display with the hd44780 driver, so it's
possible you have a bug in your software when addressing the second line.
Try with:

fputs(ESC_POS "\x21" "\x20",LCD);
fputs("Hi Bent!!",LCD);

If it doesn't work, try to change the LcdInit routine. As example, I changed
the routine for 8 bits operation as follows:

static void LcdInit(void)
{
 	NutDelay(20);
    /*
     * Set LCD register select and enable outputs.
     */
    sbi(LCD_REGSEL_DDR, LCD_REGSEL_BIT);
    sbi(LCD_ENABLE_DDR, LCD_ENABLE_BIT);
	
	// Enable escritura
	
	sbi(LCD_RW_DDR,LCD_RW_BIT);
	cbi(LCD_RW_PORT,LCD_RW_BIT);

     /*
     * Initialize for 8-bit operation.
     */
    cbi(LCD_REGSEL_PORT, LCD_REGSEL_BIT);
    LcdSendNibble(0x30);
    NutDelay(50);
    LcdSendNibble(0x30);
    NutDelay(50);
    LcdSendNibble(0x30);
    NutDelay(50);
    LcdSendNibble(0x38);
    NutDelay(50);
 
    /*
     * Clear display.
     */
    LcdWriteCmd(0x08, 2 * long_delay);

	LcdWriteCmd(0x01,  2 * long_delay);
    /*
     * Disable display shift and set incremental mode.
     */
    LcdWriteCmd(0x06,  2 * long_delay);

    LcdWriteCmd(0x0C,  2 * long_delay);
	
    LcdWriteCmd(0x02,  2 * long_delay);

    
			
}

Regarding the 40 chars, you should change the struct TERMDCB dcb_term (in
hd44780.c): change "Number of visible columns" from 16 to 40. In fact, I use
the value 17 in this field because I had a problem of blinking char at the
16th column (try with 41 if you find the same problem).

I hope this helps!!

Eduardo


> Hi all
> 
> I am working with the medianut just for the fun. And it is fun but:
> 
> The new configurator does not work it does not make the makedefs right.
> But I reverted to the old nut/net system ver.: 3.4.2 which can still be
> found on egnites homepage (not ethernuts homepage) and it works in first
> attempt.
> 
> The LCD driver does not work properly with a LCD display but works fine
> with a similar VFD display. The LCD display is not initialized properly
> since the second line in the display never gets initialized.
> 
> Apart from this it is very impressive and great fun to play with it4s
> obvious that a great deal of time and hard work has been spend on this
> kit, and I  as the novice I am in network  find it very interesting,
> but also hard to understand since it4s a whole new worldt I4m stepping
> into.
> 
> Could anyone tell me, how do I change the number of characters in the
> display to match my actual display with 2 lines of 40 characters each?
> Right now it only shows 16 characters in each line.
> 
> 
> Best regards and the wish of a good Christmas
> And thanks to the hard working guys out there (especially to you Harald)
> 
> 
> Bent Neumann
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://www.egnite.de/pipermail/en-nut-
> discussion/attachments/20041223/76e7619a/attachment-0001.htm
> 
> ------------------------------
> 




More information about the En-Nut-Discussion mailing list