HD44780 LCD on Maple board

Posted on
  • I'm running Espruino on the original LeafLab's Maple rev.5 board, and can control all the pins, with the help of attached pins-mapping table between STM32 GPIO pins, "official" Espruino board rev. 1.3, and Maple rev.5 board.
    Now I'd like to connect the HD44780 LCD to my Maple board. According to the http://www.espruino.com/HD44780 and my table, the LCD should be connected to D0 (RS), D1 (EN) and D15-D18 (D4-D7 data lines), with the code modified as:

    var lcd = require("HD44780").connect(D0,D1,D15,D16­,D17,D18);
    lcd.print("Hello World!");

    However, nothing is displayed, and the Web IDE just spits out:

    echo(0);
    =undefined

    What might be a problem? Any advise is very much appreciated. Many thanks in advance.


    1 Attachment

    • Espruino-Maple_pins_matching.JPG
  • When you plug the LCD in, do you get a black bar before you use any code? That should be the default state if it's wired up right. If not, check power and the contract pin.

    Also, you can actually use any pins at all to drive the HD44780, so don't worry about getting the exact same ones that the Espruino board uses.

    The communication with Espruino is one-way, so Espruino will do what you tell it, but won't have any idea if there's any problem talking to the display.

  • You mean the line of black rectangles? No, normally I don't see, but if I increase the contrast, I can see the whole first line (my LCD is 2x24) as black bar, but second line is blank...

    If I run lcd.cursor() I see a black underscore line at first column of first line, which then becomes a blinking rectangle with lcd.cursor(1) - understand that's how it should be. The lcd.setCursor(col,row) also works as it should, moving the cursor correctly.

    Running lcd.write() doesn't make any changes, but when I enter lcd.print("anything"), the cursor disappears, and reappears with lcd.setCursor() or lcd.clear() commands.

    So, what might be a problem? Looks like the commands mode works, but not the displaying of characters? Your advise is very much appreciated. Many thanks.
    Mac Ha

  • That all sounds promising - you definitely need to adjust contrast such that you see the line of black rectangles though.

    LCD.write is for individual characters - so I wouldn't really expect you to see much there. LCD.print should work though.

    If setting the cursor is working (but not text), I'm really not sure what to suggest - especially if the cursor appears in the right place.

    All I could think is maybe you should re-check the wiring of the data pins. It might be they are in the wrong order or one of them isn't connected.

  • @ngmacha:
    Did you ever figure this out?
    Looking at your mapping table and at http://www.espruino.com/HD44780 it seems that:
    RS = A0 (Espruino) = D2 (Maple)
    EN = A1 (Espruino) = D3 (Maple)

    So with that the constructor would have to be:
    var lcd = require("HD44780").connect(D2,D3,D15,D16,D17,D18);

    (Also, I am not sure if you just could use the Espruino pin names directly or if the Maple build remaps those to the Maple pin names - I assume so since you probably thought of that already).

    Regards,
    Mike

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

HD44780 LCD on Maple board

Posted by Avatar for ngmacha @ngmacha

Actions