[En-Nut-Discussion] How to use HD44780 on ethernut 1.3H?

DreamCat huayuliang at gmail.com
Wed Jul 27 15:33:34 CEST 2011


Hello everybody.

     I'm learning ethernut, and I want to do the exercise of every example
and device about avr.
I will have a lot question to ask all of you. I hope I can write some driver
for ethernut after my exercise. I also want to use and stm32 on ethernut
after avr.

here is my test code for HD44780:

#include <dev/hd44780.h>
#include <dev/term.h>

FILE *lcd_1602;

if (NutRegisterDevice(&devLcd, 0, 0)) {
    puts("Failed to register LCD"); // what is the name of devLcd?
}
if ((lcd_1602 = fopen("Lcd", "w")) == 0) {
        puts("Failed to open device stream.");
}
/* it seems the device register ok, and file open ok, but after this, I
don't know how to write string to LCD */

fprintf(lcd_1602, "Hello world!"); // stay here .... dead.
fclose(lcd_1602);

how to locate cursor and line?
isn't it need initialization?

I also test my code on proteus. it give me some warning message:
[HDD44780] Attempted read after write writing a single nibble.
file open mode is wrong ?
I useing 4bit mode, all pin on port D..

btw, my new chip ATMEGA128 is on the way, I have to wait it for testing.
-- 
【花生】



More information about the En-Nut-Discussion mailing list