Hi nuromantix , I'm trying to use your LCD driver but am a bit lost with the messages. What, in the patch, is prompting something to be sent to the LCD? It seems like the is but I'm not sure how to bang the message once it's in the BELA. Forgive me if this is simple, I'm fairly new and a bit over my head but very excited about the driver you made!

    mollyqh Also new to this forum and can't figure out how to uncross my text... SOS

    SOS'ed. Not sure what happened there

    I'll add to the mix of suggestions something that simplifies this for me.
    Adafruit LCD USB backpack:
    https://www.adafruit.com/product/782

    Then power comes from your BBB USB port and it shows up as a USB TTY device, which should be really easy to use from Pd (I'm talking to it using C++ directly).

    Some extra advice on this USB backpack is the code shipped from Adafruit is a little bit buggy (weird stuff happening with read/write EEPROM), so custom characters and saved stuff get garbled and mixed up sometimes.

    The github user CanyonCasa fixed the bugs and added some nice features (GPIO):
    https://github.com/CanyonCasa/BackpackPlus
    I forked this and added an audio level meter and some other small things that strike my fancy:
    https://github.com/transmogrifox/Adafruit_USB_Backpack_Plus
    Also I added the .hex file for the EEPROM clearing utility, so hypothetically all you need is AVRdude and the instructions on my github to flash this image if you want to.

    The image from Adafruit works mostly ok, so there are only some odd behaviors you will notice when you try to do stuff with custom characters or RGB backlighting saved settings.

    7 days later

    mollyqh

    Sending messages to @string do work. But you have to add @ at the start of a new line. There are examples at the LCD driver patch. You should also check the connections from analog out. It all works for me. But some isolation circuit might be needed because LCD consumes lots of energy and makes voltage lower than usual. Try this scheme:

    http://howtomechatronics.com/wp-content/uploads/2015/07/LCD-Display-Tutorial.png?x57244

    Some of the nodes need to be shorted together. So order of the upper nodes are like this
    [GND, 5V, GND, BELA, GND, BELA, GND, GND, GND, GND, BELA, BELA, BELA, BELA, 5V, GND]

    3 months later

    hope this is not too off topic, but if one wanted to hookup a rectangular display (without touch) of some sort: what would be the easiest solution on the bela? a tft? lcd? oled?

    5 years later

    Thanks for the pd patch @nuromantix

    I've tried breadboarding this with a HD44780 but couldn't get it working yet

    First attempt was using the routing mentioned:
    Bela out 7 to LCD D7
    Bela 6 to D6
    Bela 5 to D5
    Bela 4 to D4
    (D3 to D0 tied to ground)
    Bela 3 to RS
    Bela 2 to Enable

    Then I noticed in the 'send_to_output' sub patch that it shows digi pin inputs on the LCD routed slightly differently:

    Bela out 7 to LCD D0
    Bela 6 to D1
    Bela 5 to D2
    Bela 4 to D3
    (D4-D7 to GND)

    This didn't work either.. The LCD backlight does come on. I've got an alternating message box being sent to string (printed to console to verify it's working)

    Has anybody got any idea where it's going wrong? Or any recommendations for using other LCD/OLED with Pd... i'm open to changing the screen if necessary.

    Thank you

    alt text

    alt text

      I also followed @egegonul 's suggestion to GND the unused digi pins in each scenario

      alt text

      dipaloka
      Bela 3 to RS
      Bela 2 to Enable

      The patch shows:

      alt text

      so it should be:
      Analog out 2 to RS
      Analog out 3 to E

      thanks Giulio,
      some progress... i get some blocks when the patch first opens..

      alt text

      then the metronome kicks in and the blocks are changing from light to dark every 1000ms, but there's no visible text

      currently trying to figure out if there's a way to change contrast settings, perhaps it has something to do with that?

        after changing the string text and making it 2 lines it did this - imgur.com/a/VOHfHmK

        dipaloka currently trying to figure out if there's a way to change contrast settings, perhaps it has something to do with that?

        I don't know :-( I never used this display myself.

        dipaloka Bela out 7 to LCD D0
        Bela 6 to D1
        Bela 5 to D2
        Bela 4 to D3
        (D4-D7 to GND)

        can you try going back to the previous pinout where you are using D4-D7 ? This page seems to indicated that D4-D7 are the lines to be used when in 4-bit mode ...
        If I were your, I'd also try to reverse the order of the pins just in case the comment got it backwards.

        Thanks for the tips Giulio, I've tried your suggestions today but no joy yet. I'm going to try and decipher the initialisation message in the patch and see how it compares to the ones on the link you shared.

        Will follow up here on how it goes

        Ah this looks great! thank you.

        I did just manage to get the HD44780 to initialise by changing the patch as follows:

        alt text

        (weird bcos E & RS are the wrong way around according to comment in Pd, but when switched around the 'correct' way, nothing happens)

        however, instead of displaying the "hello world" text being sent to string straight after init, it spat out some gobbledygook...

        I think I will persevere with this for few more days and then look into the OLED option, it looks really good - thanks again.

        btw do you know when the multiplexers are due back?

          dipaloka btw do you know when the multiplexers are due back?

          They should be back in stock in a couple of weeks if everything goes well.

          gobbledygook...

          that looks like you are:

          • using the correct E and RS
          • using (at least some of) the correct data pins
          • using the data pins in the the wrong order or with the wrong protocol ...

          dipaloka When you say the wrong protocol, do you mean I should check the 'pd char_route' sub patch with the characters listed on here https://protostack.com.au/2010/03/character-lcd-displays-part-1/ ?

          Yeah I was thinking that maybe that may be different on your part? Or it could be something else.

          For instance, I seem to understand than in 4-bit mode you split most (all but the first) 8-bit messages in two halves: you first send the upper 4-bits (most-significant nibble MSN) and then the lower 4-bits (least-significant nibble LSN). If, for some reason, you end up having one extra message in there (or one fewer), you'll end up with your messages being off by one, so if, for instance, you are writing "H" followed by "E", you may think that you are sending out {MSN(H), LSN(H), MSN(E), LSN(E)}, but the display may interpret those as {LSN, MSN, LSN, MSN}, resulting in a scrambled display.

          Look at the section "Interfacing via the 4 bit mode": try executing that specific set of instructions and see if you get an Hello World printed or not.