I couldn't get the display to power up from 3.3 volts but it is probably enough for the logic.
So you could power from the 5V rail but use digi outs for the logic.
I wasn't brave enough to risk mixing up the wires in case I fried the Bela!
Hooking up an LCD
Awesome, this is really great!
We should probably think about ways of sharing/distributing community-contributed code and pd objects etc like this.
Thought I ought to give something back after all my beginner questions......
- Edited
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!
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.
- Edited
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]
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?
not sure. Some details on using an OLED display here https://forum.bela.io/d/314-does-anyone-successfully-using-i2c-oled-lcd/3
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
dipaloka
Bela 3 to RS
Bela 2 to Enable
The patch shows:
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..
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?
- Edited
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
I should also mention that today there is a very straightforward way of communicating to OLED displays on Bela (though not the LCD you are targeting), as described here: https://learn.bela.io/using-bela/bela-techniques/using-an-oled-screen/ .
- Edited
Ah this looks great! thank you.
I did just manage to get the HD44780 to initialise by changing the patch as follows:
(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 ...