Sainsmart LCD2004 with Beaglebone Black

Hello,

I purchased a SainSmart LCD2004, which I believe is a hd44780 LCD with an i2c module pre-soldered to the back of the board. This board is designed for an Arduino, but I wanted to try using it on my Beaglebone. Is this doomed to fail?

Following a few online guides, I have the SDA and SDL pins, as well as the 5v and ground pins attached (with a resistor). I’ve tried endless python scripts and libraries, being careful to configure each to use the addresses that i2cdetect is showing. Upon running some of the scripts, the LCD actually blinks. I tried to go the LCDd route, but no luck with that either. The LCD backlight goes on, but no text.

If I’m in the wrong Forum, or missing something simple, let me know. I can expand on anything that I’ve tried.

A little background - I’m a competent Linux user, so running tools and banging together scripts is the easy part for me. The connecting the electronic components has been the learning part of this journey.

Many thanks.

Hello,

I purchased a SainSmart LCD2004, which I believe is a hd44780 LCD with an
i2c module pre-soldered to the back of the board. This board is designed
for an Arduino, but I wanted to try using it on my Beaglebone. Is this
doomed to fail?

Not necessarily so. It depends on what the I2C module is. You will
need to know what the I2C commands to the module happen to be, that is
one thing. The known commands for the 44780 are likely to be easy to
get. The module I don't know anything about.

Following a few online guides, I have the SDA and SDL pins, as well as the
5v and ground pins attached (with a resistor). I've tried endless python
scripts and libraries, being careful to configure each to use the addresses
that i2cdetect is showing. Upon running some of the scripts, the LCD
actually blinks. I tried to go the LCDd route, but no luck with that
either. The LCD backlight goes on, but no text.

The backlight goes on most likely because there's 5 volts on the
display. The uninitialized display shows a sequence of square blocks
on line 1 (and nothing on line 2).

The SDA and SCL pins need to go to 5 volts through a resistor (each
line independently). The resistor values are generally between about
4.7K and 10K.

What I don't know (and you need to check) is whether or not the BBB's
I2C system runs from 3.3 volts or 5.0 volts. If 5.0 volts AND the LCD
display I2C runs from 5 volts, then you can connect them directly. If
the LCD and BBB run on 3.3 volts (for the interface), then they can be
connected directly. IF they are not the same, then you need a chip
(I'd recommend the PCA9517) to connect the two. This chip allows
dealing with different supply voltages (such as 3.3 and 5.0).

I use this chip in systems I design. Typically, the processor I/O is
at 3.3 volts (even the I2C pins), and the system level is 5.0 volts.
Thus, I need a chip on each board to the system interface. For a 5.0
volt system, I still use the chip because it provides isolation
(there's a limit on current, cable length (related to capacitive
loading) and capacitive loading on each driver; check the specs.)

You might want to look at these issues, they're reasonably easy to
fix.

Harvey

Ah, if you are referring to a logic level converter, I had ordered one but wasn’t sure if that was what I needed. I’ll read more on how to use it, and try that. Thank you.

Ah, if you are referring to a logic level converter, I had ordered one but
wasn't sure if that was what I needed. I'll read more on how to use it,
and try that. Thank you.

You're welcome. However, be aware that there are several kinds of
logic level converter.

The standard variety 8T245 or 74LVC1T45 (think that the numbers are
close) are the standard LS245 type, a bidirectional driver that only
works one way at a time, where the chip has two VCC inputs. This is
quite useful for parallel inputs/outputs where you're only
transmitting one direction at a time, and have a control line that
enables that (such as a read/write line).

The PCA9517A chip is designed specifically for I2C, and is
bidirectional without needing a control. The SCL line is driven by
whatever is the I2C master, but the SDA line is alternately driven by
the master (at all times on writes except for the ACK bit) and the
slave (all the times the slave talks to the master except the ACK bit
from the master). Check the I2C spec for this information. On the
chip, leave the ENA input open, it seems to work just fine like that
(or I suppose you could pull it up to the appropriate VCC).

On this chip, use pins 7 and 6 for the local (processor) pins, and use
pins 2 and 3 for the system (chip to chip) connections. Use pin 8 for
the system VCC and pin 1 for the local VCC.

Pins 7 and 6 are not designed to be paralleled with other chips, and
pins 2 and 3 are designed to be connected to *other* pins 2 and 3 on
other boards, which means that the connections to pins 7 and 6 are
always local.

I2C pins sink to ground and have a resistive pullup to the supply
voltage. However, there is no guarantee that any chip can tolerate an
input voltage greater than its power supply voltage. Thus you need a
voltage level translator between systems with different supply
voltages.

This is how I have the chips connected, and it works properly. Check
the data sheets (NXP) for the details and the backup information.

Harvey