Help using an LCD Display

ookkiesookkies Posts: 5
edited 2019-11-17 - 18:11:14 in Microcontrollers
I ordered an LCD display to use with my Activity Board, but i'm having trouble finding a code to use it with. It has GND, VCC, SDA, and SCL connections.

The only tutorial I could find was this http://learn.parallax.com/tutorials/language/propeller-c/propeller-c-simple-protocols/half-duplex-serial but it's using different pins for the incoming data. Can anyone lead me in the right direction?

For reference, this is what I have https://www.amazon.com/gp/product/B01DKETWO2

Comments

  • Your LCD display is not the right kind of "serial" to work with the tutorial's driver. It's more like a memory device (using the I2C protocol). Look at the <simpletools.h> library functions i2c_newbus and i2c_out. The i2c_out call doesn't use a memory address, so memAddrCount is zero and memAddr is NULL. The device address "i2cAddr" (according to the Amazon link) is 0x27.
  • ookkiesookkies Posts: 5
    edited 2019-11-17 - 21:05:26
    Mike Green wrote: »
    Your LCD display is not the right kind of "serial" to work with the tutorial's driver. It's more like a memory device (using the I2C protocol). Look at the <simpletools.h> library functions i2c_newbus and i2c_out. The i2c_out call doesn't use a memory address, so memAddrCount is zero and memAddr is NULL. The device address "i2cAddr" (according to the Amazon link) is 0x27.
    Looking at the library, I found these
    i2c_newbus(int sclPin, int sdaPin, int sclDrive);
    int i2c_out(i2c *busID, int i2cAddr, int memAddr, int memAddrCount, const unsigned char *data, int dataCount);
    What would I put for i2c*busID and const unsigned char*data? I assume int dataCount would be a variable that has what I want to be outputted?
  • ookkiesookkies Posts: 5
    edited 2019-11-17 - 22:59:40
    I've tried using this code, but I'm not recieving anything on my lcd screen



    #include "simpletools.h"

    i2c *eeBus;

    int main()
    {
    eeBus = i2c_newbus(14, 13, 0);


    i2c_out(eeBus, 0x27,
    NULL, 0, "abcdefg", 8 );


    while(i2c_busy(eeBus, 0x27));

    char testStr[] = {0, 0, 0, 0, 0, 0, 0, 0};


    i2c_in(eeBus, 0x27,
    NULL, 0, testStr, 8 );


    print("testStr = %s \n", testStr);
    }
  • See if you can find further documentation on your display. The description on the Amazon webpage doesn't tell you what you have to send to the display to make it work. It may be that there are specific addresses (like registers) that you have to initialize. I can't help further you without this sort of information.
  • I was working on a library for this i2c to Parallel LCD backback, but I never got to finish it. The commands you send would be very similar to the ones you would send the screen if it were hooked up in parallel. The best I can do is point you to the Arduino library for this thing, and the parallax library for the parallel version:
    https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c
    https://github.com/parallaxinc/Simple-Libraries/tree/Community/Learn/Simple Libraries/Display/liblcdParallel
    Matthew Matz
    STEM/Robotics Educator
    Parallax Inc.
Sign In or Register to comment.