Adafruit 16x2 LCD doesn't turn on with Pine64
#1
Hi all,
I got my self an Adafruit 16x2 LCD display, put it all together, plugged it in and it won't turn on, not even the backlight. I was wondering if someone had experience with the LCD and don't mind helping me.

I got two of the PINE64 while back for my OBDII project as well as for a another project for the kitchen and its been on the shelf for a while. I have no experience with GPIOs or I2C and recently got socked in to experiment with it. From what I read, PINE64 pins are same as it on Raspberry Pi and I though that the LCD would be compatible with PINE64. Aperintly it's not the case. If I can get some guidance on how to make it work with PINE64, that would be awesome.

[Image: img3.jpg]
  Reply
#2
I have used the ada fruit 16x2 LCD many times, most recently for a calculator project;

... the first thing you better do is study this data sheet thoroughly.

Realize that the data buss on this device is bi-directional and the logic is 5v !!!  If you try to use this device with your PineA64 without bi-directional level shifters you will blow your Pine board.  (words to the wise)

The back-light is adjustable (which may be your immediate problem, I don't know, you might have it wired backwards too).

First steps:  study the data sheet.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#3
(08-25-2016, 11:50 AM)MarkHaysHarris777 Wrote: I have used the ada fruit 16x2 LCD many times, most recently for a calculator project;

... the first thing you better do is study this data sheet thoroughly.

Realize that the data buss on this device is bi-directional and the logic is 5v !!!  If you try to use this device with your PineA64 without bi-directional level shifters you will blow your Pine board.  (words to the wise)

The back-light is adjustable (which may be your immediate problem, I don't know, you might have it wired backwards too).

First steps:  study the data sheet.

MarkHaysHarris777, thanks for your reply. This lcd has microchip and resistors already and its desined to be plug-and-play using I2C. It should light up as soon as its plugged (it's designated to be plugged in directly in to RPi GPIO. I've tried to search for an address but I2C tools cameout with nothing on the bus.

Code:
[root@localhost ~]# i2cdetect -y 0
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                        
[root@localhost ~]# i2cdetect -y 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --    
  Reply
#4
Right, there are two i2c channels -- one of them works now, and the other (TWI) does not. The PI bus is not completely compatible with the RPi (as we had originally hoped).

This will not be plug and play on the PineA64 board.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#5
(08-25-2016, 03:18 PM)MarkHaysHarris777 Wrote: Right, there are two i2c channels -- one of them works now, and the other (TWI) does not. The PI bus is not completely compatible with the RPi (as we had originally hoped).

This will not be plug and play on the PineA64 board.

I guess I would have to desolder the connector from the LCD and put it on the breadboard. Do you know which one works and which does not? Also what are the differences between? Pine64 an RPi headers?T
  Reply
#6
Looks from the pictures that the LCD is connected to the SBC via an MCP23017 to the main i2c bus (pins 3 and 5). Thus I would expect that the connections are ok. The MCP23017 although it runs on 5V uses open-drain on its i2c lines, so these can be used on a 3.3V system such as the Raspberry Pi or Pine A64 without deleterious effect.

This i2c bus will be the one visible as /dev/i2c-1, so the i2cdetect -y 1 command is the one looking in the right place.

But there is another important difference between the PineA64 and the Raspberry Pi when it comes to the main i2c bus, the one on the PI-2-BUS connector pins 3 and 5.  Raspberry Pi has a pair of 1.8 kilo-ohm pull-up resistors on these lines, and the Pine does not have these. So to make things work, I would suggest adding external resistors to make up for the ones missing. They don't have to be as low as 1.8 kOhms, something like 3.3 kOhms will work fine.  One goes between pin 3 and pin 1, the other between pin 5 and pin 1, to pull the two i2c lines up to 3.3 V.

The internal pull-up resistors inside the Pine are 100 kOhm nominal, and this large a resistance does not allow for enough current to operate an i2c bus reliably.

The backlight on the LCD is driven from three of the IO pins on the MCP23017, one each for red (A6), green (A7), and yellow (B0); and all of it gets its 5V power supply via the pin 2.
  Reply
#7
(08-25-2016, 08:53 PM)MarkHaysHarris777 Wrote: i can see from your print-out of the i2c registers that it is not detecting the address of the LCD.  How are you powering it?  Double check your connections.  Make sure its on the correct bus...

Mark, I think you need to have a another look at the first post, specifically the picture... you can clearly see the LCD is on a Adafruit LCD Pi Plate, meaning it is i2c, with all comms and power comming from the pi bus. Plus, there is no room for incorrect wiring as assembly is as simply as place LCD here and solder connectors, etc. 

My question here would be does I2C work out of the box with a particular debian or ubuntu image, and if not, what configuration is needed to get it up and running?
  Reply
#8
(08-26-2016, 01:11 AM)pfeerick Wrote:
(08-25-2016, 08:53 PM)MarkHaysHarris777 Wrote: i can see from your print-out of the i2c registers that it is not detecting the address of the LCD.  How are you powering it?  Double check your connections.  Make sure its on the correct bus...

Mark, I think you need to have a another look at the first post, specifically the picture... you can clearly see the LCD is on a Adafruit LCD Pi Plate, meaning it is i2c, with all comms and power comming from the pi bus. Plus, there is no room for incorrect wiring as assembly is as simply as place LCD here and solder connectors, etc. 

My question here would be does I2C work out of the box with a particular debian or ubuntu image, and if not, what configuration is needed to get it up and running?

You are incorrect; on all counts.  

The PI bus on the PineA64 is not compatible with the Raspberry PI .  By definition, the connections of the ada fruit hat are incorrect.

I think you need to read the post ahead of yours....

...  again, I will re-iterate, this project is not going to be plug and play.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#9
(08-26-2016, 01:19 AM)MarkHaysHarris777 Wrote:
(08-26-2016, 01:11 AM)pfeerick Wrote:
(08-25-2016, 08:53 PM)MarkHaysHarris777 Wrote: i can see from your print-out of the i2c registers that it is not detecting the address of the LCD.  How are you powering it?  Double check your connections.  Make sure its on the correct bus...

Mark, I think you need to have a another look at the first post, specifically the picture... you can clearly see the LCD is on a Adafruit LCD Pi Plate, meaning it is i2c, with all comms and power coming from the pi bus. Plus, there is no room for incorrect wiring as assembly is as simply as place LCD here and solder connectors, etc. 

My question here would be does I2C work out of the box with a particular debian or ubuntu image, and if not, what configuration is needed to get it up and running?

You are incorrect; on all counts.  

The PI bus on the PineA64 is not compatible with the Raspberry PI .  By definition, the connections of the ada fruit hat are incorrect.

I think you need to read the post ahead of yours....

...  again, I will re-iterate, this project is not going to be plug and play.

I'm referring to you asking about how the display is connected, as per post #2 above. There was no need to scare about 5v bidirectional logic (which is not normally the case, unless you are reading back from the LCD, when RW is grounded, the IO is one way), as this is not so with the Adafruit Pi Plate. It also explains how the backlight is powered. And as per the post above, the connections are correct, simply that the pine64 doesn't have the pullups on the i2c bus that the rPi does. 

If you only care about the display, the only connections that need to work are 3 (SDA), 4 (5v), 5 (GND) & 6 (SCL)? Are telling me that those most basic of connections are not compatible (bearing in mind that the pullups are indeed missing - which is a bit of an oopsie... considering they made provision for 2k pullups in the schematic and on the board - but just didn't populate the components).

And I'll ask again: Does I2C work out of the box with a particular debian or ubuntu image, and if not, what configuration is needed to get it up and running?

Edit: Nevermind. After adding a 2K pullup to the 3 & 5, pulling them up to 3.3v (note, 3.3v, NOT 5v, so pin 1), the pine64 detects a device attached at addr 20. Without the pullups, a device is NOT detected. This is on a debian image, running kernel 3.10.102-3-pine64-longsleep, and no special configuration done to enable or otherwise configure the I2C. Simply the installation of the i2c-tools package.


Code:
pfeerick@pine64:~$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
  Reply
#10
(08-26-2016, 01:11 AM)pfeerick Wrote:
(08-25-2016, 08:53 PM)MarkHaysHarris777 Wrote: i can see from your print-out of the i2c registers that it is not detecting the address of the LCD.  How are you powering it?  Double check your connections.  Make sure its on the correct bus...

Mark, I think you need to have a another look at the first post, specifically the picture... you can clearly see the LCD is on a Adafruit LCD Pi Plate, meaning it is i2c, with all comms and power comming from the pi bus. Plus, there is no room for incorrect wiring as assembly is as simply as place LCD here and solder connectors, etc. 

My question here would be does I2C work out of the box with a particular debian or ubuntu image, and if not, what configuration is needed to get it up and running?

Although that question might not have been directed at me -- I have one data-point's worth of answer to it.

i2c on the bus in question here, TWI-1 or /dev/i2c-1 as it appears in the Linux file system, does have all necessary support bits in place on the Debian 3.10.102-3-pine64-longsleep kernel. (I had it working with the previous -1- and -2- ones as well, but those are obsolete.) These are ready for use, though one will want to install the i2c-tools and libi2c-dev (and whatever other similar packages apply to python) to be able to use them for anything interesting. Reading and writing to simple devices will be the same.


So much for the software side. Hardware-wise, we have to have something connected of course, and if the i2c-capable device or board connected was originally designed for Raspberry Pi, the good news is that there is a good chance of it working, and the less-than perfectly good news is that we have to add the pull-up resistors to the two i2c lines since they are not present from before.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pine64 and Nexdoc mcf 11 10,712 12-05-2017, 03:10 AM
Last Post: Pander
  Mounting RPI3 "hats" on Pine64 gczuczy 5 5,550 07-30-2017, 10:29 AM
Last Post: KnReLe
  adafruit ultimate gps hat mrjake 3 3,734 02-16-2017, 08:15 PM
Last Post: mrjake
  Analog Amplifier for Pine64 mbt28 2 2,865 02-09-2017, 08:46 AM
Last Post: mbt28
  ZJ080NA-08A and pine64 mbt28 4 3,616 10-10-2016, 05:12 AM
Last Post: mbt28
  Euler bus/Pi2 bus on Pine64 xxvolwarexx 1 4,305 10-05-2016, 06:35 PM
Last Post: pfeerick
Exclamation Pine64+ not starting (never) Alex89cgn 1 2,003 08-15-2016, 12:05 PM
Last Post: MarkHaysHarris777
  Pine64 Eagle LBR openhardwarecoza 3 3,340 08-01-2016, 11:05 AM
Last Post: xalius
  Setting up UART2 for Adafruit GPS hat stephen fleming 1 1,953 05-13-2016, 03:20 PM
Last Post: peterz

Forum Jump:


Users browsing this thread: 2 Guest(s)