LCD1602 Driver for Daisy SM VS Code

Hi, I have a LCD1602 LCD and want to set it up with Daisy SM. I have connected the clock and data outputs to D9 SPI SCK and D10 SP MOSI as the forum link below but now am stuck.

How do I install a driver for the 1602 in VS Code?
I saw some info that 1602 driver is now included in LibDaisy:

I found it, I was looking in DaisyExamples\libDaisy\examples and it is in src/dev folder.

https://electro-smith.github.io/libDaisy/lcd__hd44780_8h_source.html

1 Like

So I can include it now from the dev folder but how do I find out the OledDisplay name? I’m getting the error below:

#include “dev/lcd_hd44780.h”

/** Typedef the OledDisplay to make syntax cleaner below

  • This is a 4Wire SPI Transport controlling an 128x64 sized SSDD1306 */

using MyOledDisplay = OledDisplay;

Error output:

OLED.cpp:11:35: error: ‘SSD130x4WireSpi128x64Driver’ was not declared in this scope
11 | using MyOledDisplay = OledDisplay;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
OLED.cpp:11:62: error: template argument 1 is invalid
11 | using MyOledDisplay = OledDisplay;

I don’t know what exact display you’re using, but the HD44780 driver is built into libDaisy,
so you use it by creating an instance of the class:

LcdHD44780 lcd;

and then, usually in main(), you initialize that object:

LcdHD44780::Config cfg;
// fill in some values in the Config struct here.
lcd.Init(cfg);

I don’t understand why you’re mixing up OLED and 16x2 stuff here. You might do better posting a photo (front and back) of the display you’re using.

1602 LCD displays natively use 4 or 8 pins parallel for programming, 1602 is also commonly used with a backpack module to provide an I2C interface.

Hi, I’ve done some work on this following the example in link above for HD44780 and have taken the code out to setup and test it. I’ve been told though that this example uses parrallel interface and not I2C - my board has the I2C interface on the back as you said. So how can I get this to work with I2C and not parrallel?

This is the code I have been using:

The board connections

The code you’re using is for the parallel interface, it won’t work with the I2C backpack.

Hi, This is the only example code I found for using the HD44780 and I spent hours doing this. I did look through the driver and the code references the driver correctly so I expect some of this is the same for I2C just not the pin definition stuff? Hard for a newbie to get this going. Do you know where I can find an example for using I2C? Thanks.

I don’t know of any 1602 I2C driver code for STM32, which doesn’t mean it doesn’t exist.

Maybe examining the Adafruit LiquidCrystal Arduino driver would give you some insight, but this whole topic is probably just over your head, no offense intended.

I also haven’t seen much (any?) interest in Daisy code for 1602, and the parallel code in libDaisy is more appropriate for Seed, because it needs so may pins.

Oh well, thanks for your honesty. I thought the 1602 being popular with Arduino was a straightforward LCD to set up with the Daisy. I have seen doing this project that looking in libDaisy drivers folder the peripherals with drivers is limited.

Isn’t HD44780 and 1602 the same thing? I’ve searched and find reference to HD44780 1602 LCD 16x2. The HD44780 is a familly of LCD’s and 1602 is one of them, and also 20x4 LCD as well.

Is this driver compatible with the 1602 and is it only parrallel then and not I2C? I have also contacted the author for some advice here. So I feel like I have invested a lot of time on this and would like to find out how it could be possible to get the 1602 I2C working. Would I have to write a new driver - yes this would be beyond me. I have some 1306 on the way to try out but it is disappointing how limited the support for common peripherals Daisy is.

I actually just thought if I buy a parallel 1602 it should be relatively easy to get this working then? Is a parallel 1602 just one without I2C that can utilise all 16 pins - I could just remove the I2C interface or buy one without?

Description: LCD class for a 16x2 LCD using the Hitachi HD44780 driver chip

Thats the parallel driver code from libDaisy. No, it won’t work for I2C, without modification that you can’t do. And you’re using patch_sm, which doesn’t have enough extra pins to drive the parallel display, so removing the I2C board also won’t help.

We’re both wasting too much time on an inappropriate $2 display.

I was about to try and connect it in parallel, first test it with Arduino then try Daisy SM but you have answered my question. I didn’t know it wasn’t possible with Daisy SM - In this example it uses 6 data pins plus GND/VCC, is this not possible? These boards cost £5 here in the UK.

What appropriate large display would you recommend?

I don’t have a recommendation.

You might try the Daisy Discord server.

Looks like the only supported OLED or LCD are the Solomon series ssd130x.
You say the 1602 is an inappropriate display?

1602 is inappropriate if you can’t get a driver to work. But most people just go for OLED these days.

That’s what most people use with Daisy, and, unlike a 1602 LCD, it’s very flexible about font size, # lines, graphics, and available in several different sizes.

You mention Patch SM - are you using Patch.Init()? Are you intending to use it for Eurorack? Others have used SSD130x displays with Patch.Init().