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?
Hooking up an LCD
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 ...
thank you
i tried re-ordering the data pins in the patch but it failed to init the LCD.
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/ ?
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.