20x4 LCD Module Question

Posted on
  • Long story short, I bought this LCD board: http://www.amazon.com/gp/product/B003B22­UR0/ref=oh_details_o01_s00_i01?ie=UTF8&p­sc=1
    which has an I2C adapter on back and at least looks similar to the HD44780, but when I try to connect it to the Espruino and use the following code:

    I2C1.setup({scl:B6, sda:B7});
    var lcd = require("HD44780").connectI2C(I2C1);
    lcd.print("Hello World!");
    

    I wind up with this output in the console:

    1v55 Copyright 2014 G.Williams
    >echo(0);
    INTERNAL ERROR: Timeout on I2C Write Transmit Mode 2
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    INTERNAL ERROR: Timeout on I2C Write Transmit
    at line 2 col 21
    d,d,e,e,e|4,e|4,e,e])}
                         ^
    in function "a" called from line 1 col 8
    in function "f" called from line 2 col 23
    in function "connectI2C" called from line 1 col 45
    ERROR: Using '.' operator on non-object at line 1 col 4
    lcd.print("Hello World!");
        ^
    =undefined
    

    As I am still new to using this stuff, what is wrong is not clear. I tried connecting 10K resistors on the SDA and SCL pins, (which are connected to B7 and B6 respectively) but this has not changed anything. Anyone know what I'm doing wrong?

  • Just a thought, but could it be that the problem is due to trying to run the 5V LCD off of a 3.3V pin?

  • Yes, it could be a voltage thing... Also, have you connected one resistor from 3.3v to SDA and the other from 3.3v to SCL? Also are you sure SDA and SCL are the right way around?

    Those I2C errors are because it can't find the I2C device on the bus, so it probably is a relatively simple problem...

    Can you let us know what's written on the black IC on your board (the one nearest the I2C connections)? Just so we know it's the same one that Espruino is expecting :)

  • Sorry, haven't checked this in a while.

    The I2C board is labeled as LCD2004. Perhaps I am misunderstanding something here, but I connected SDA and SCL each with a resistor to the B6 and B7 pins on the board. I was under the impression that these were just signal pins and got their power from the VCC connection.

  • SDA/SCL are connected directly to the SDA and SCL pins on the espruino, not through resistors.

    The resistors are connected between the SDA and SCL pins and +3.3v (pull-up resistors). Sometimes these are included in I2C breakout board - reviews on amazon imply that this is the case for this.

  • So to be clear, the SDA and SCL pins on the I2C board are just connected to the corresponding signal pins on the espruino board. There is no need to connect additional resistors to anything because they appear to be built into the I2C board.

    I have already tried connecting the board in such a manner (VCC to +3.3V, GND to ground, SDA to B6 and SCL to B7 with no resistors on either), which results in the same code as seen above.

  • You could try connecting VCC to Bat. IIRC that's what I had to do with an I2C LCD2004 board.

  • Since nothing I tried seemed to make the Espruino want to work with the I2C board, I decided to try desoldering the board from the LCD and connecting the pins manually. This seems to have sort of worked, since I can now produce a flashing square where before there was no response whatsoever. The problem is, it still isn't displaying any characters (I've fiddled with the backlight brightness and rechecked the pins to make sure that wasn't the problem). The only result of using

    var lcd = require("HD44780").connect(A0,A1,C0,C1,C­2,C3);
    var count = 0;
    function showData() {
     count++;
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Current data:");
     lcd.setCursor(4,1);
     lcd.print("Count: "+count);
    }
    setInterval(showData, 1000);
    

    to test the setup is that the cursor square randomly moves to several different positions on the screen (it moves every time the program runs the showData function). It also looks like the screen cycles between different display "modes" with the faintly visible background squares disappearing or changing shape slightly when the cursor moves.

    My question is, does this just sound like the pin order is wrong? I'm not sure what else the problem could be.

  • Yes - you might find that the data pins are in the wrong order - that sounds pretty similar to what happened when I did that anyway...

    It's worth a try...

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

20x4 LCD Module Question

Posted by Avatar for Anomaly @Anomaly

Actions