What am i doing wrong with my hd44780 16x2 lcd?
-
Ok I'm going to go through the software things you've suggested, i2cdetect -y 1 returns no error but neither does it return an address.
My i2c backpack looks the same as the one in the guide so i'll get hold of a level shifter asap.
The pins on the backpack are connected via a header on my HiFiBerry Dac+ light and not directly to the pi, so I'm thinking maybe connecting directly to the pi to rule out any soldering issues on the header (although I'm going to double check those in a minute).
-
I've just checked /etc/modules and it contains 2 instances of both i2c-bcm2708 and i2c-dev for some reason.
There are no blacklist entries in raspi-blacklist.conf.
/boot/config.txt contains the following:dtparam=i2c_arm=on
dtparam=i2c1=on
dtparam=i2s=onI think I might have added dtparam=i2s=on while trying things.
-
@Boz
No it's okay to ask for annother topic but you see I2S can sometimes be a mess. Because some devices deisgned for Arduino (5V on it's I/O Pins) will be selled for RPi also. That could work if you connect your Display to 3,3V the chance that this will work are very low. The method I introduces to you in the previous posting is, to remove I2S hat and directly connect to GPIO. Then the display runs with 5V, the GPIOs are independend and send data with 3,3V... Do not connect a output channel from LCD to GPIO 3,3V vs 5V isn't the best method.@future-child seems to have much more experience than me in wiring.
-
i2c does indeed seem to be a bit of a mess, just so I understand this correctly I currently have the lcd connected like this:
GND - pin 6
VCC - pin 4
SDA - pin 3
SCL - pin 5I followed this diagram:
Pin 4 shows 5v so if my backpack is TTL (5v) how does this pose a problem?
PS: Thanks for both of your help btw it's much appreciated.
-
@cyperghost I have a spare hd44780 with no backpack to wire up directly if need be, but I'm concerned I won't have room for a breadboard so I was trying to stay away from that if possible.
-
@boz The pi can output 5V as well as 3v3 but the gpio ports are only 3v3 tolerant, therefore you need a level shifter. The 5V produced by the backpack is simply to high and possibly could damage the ports.
-
Ok i'll disconnect the lcd for now until I get the level shifter (will be next week now).
Is this one ok?
https://shop.pimoroni.com/products/sparkfun-logic-level-converter-bi-directional?utm_medium=cpc&utm_source=googlepla&variant=7493045377&gclid=CjwKCAjwzMbLBRBzEiwAfFz4gQd35zRrMF0RFk7mjybTQZZHGF0hfcEVPTglsuBgr-SAGlMsuHTdDBoCKX0QAvD_BwE -
@boz Yes that one would do fine.
-
@Boz
No No! Please don't directly wire 5V to SDA/SCL! This will damage the Input GPIO! You rather should use Pin 1 for power... with much much luck it works!If you prefer easy wiring then use a I2S designed for RPi with 3,3V TTL but most LCDs need at least 5V.
Annother method could this one
You power it up with 5V to ground and the PIC "could" interpret 3,3V signals from UART of Pi.... I said "could". Usually the signal of high is 2,5-2,7V to 3,3V could work!What the difference between the UART and the I2C? The UART is a one way communication so no signal reaches the Pi and so overvoltage is no risk!
The cleanest way imho is the direct wiring! The Breadboard is just for testing. If it works you can solder it directly
-
@future-child said in What am i doing wrong with my hd44780 16x2 lcd?:
@boz The pi can output 5V as well as 3v3 but the gpio ports are only 3v3 tolerant, therefore you need a level shifter. The 5V produced by the backpack is simply to high and possibly could damage the ports.
right!
-
@cyperghost So there is already a chance that the SDA/SCL pin is damaged? If so would it have damaged the Dac+light or the pi itself?
I'm grateful that people write tutorials such as the one I followed for the display but there seems to be a lot of conflicting information out there.
So i can either go with the level shifter or the direct wiring without the backpack, I'm gonna read back through your posts and see what pins need to be connected to directly wire this.
Hopefully there has been no damage and i can carry on with my troubleshooting or better still the damn thing just works lol! -
Well I have an I2S backpack here, without LCD and I can detect it with
i2cdetect -y 1
on 27h.
Try to wire the whole thing on 3,3V and take a look to the red LED. Then check withi2cdetect -y 1
There are tons of "how to" connect a HD44780 on google, the poti isn't needed - it's for contrast setting
EDIT: Easier setup without resistors! This one is for Pi B, but the GPIOs are backwards compatible. This graphic is only for example! How a wiring should work! I've tested it for several years and it worked so far!
-
So i just swap pin 4 for pin 1?
-
I feel which ever method i choose i should remove the dac and connect directly to the pi. Even though the lcd was connected without a level shifter it still had power...so the reason why i get no address from i2cdetect -y 1 must be because either the gpio input was damaged or the header on the dac isn't soldered very well.
Removing the dac narrows it down i reckon. -
@boz said in What am i doing wrong with my hd44780 16x2 lcd?:
So i just swap pin 4 for pin 1?
Yes this will not overvoltage SDL/SDA ... If the red LED is on then the backpack could work and may be detected. With much much luck your display will also run!
With this config my I2S device results this
pi@raspberrypi:~ $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
-
Ha ha we'll see!
-
Tried with 3.3v pin, backpack gets power but still no address. Will try this again over the weekend but connected directly to the pi.
-
@Boz Maybe you remove your I2S devices, too and look to the posting @future-child gave you. This is a nice instruction as well
-
Thanks, I'll spend some time fault finding/process of elimination. I'll try all the things you guy's have suggested and see how i get on.
-
Success!!
I dug out an old rpi2 and tried the display on that using i2c (3.3v). I got an address from i2cdetect -y 1.... (3f) and changed a few test scripts to suit all of which worked.
I want on to change the script I was going to use in my build (retropie_clcd.py) and then altered all the text to what I wanted.
Tried everything that I'd just done exactly the same on my rpi3 with dac etc and still no address. So it has to be the dac for whatever reason, I'll connect the lcd directly to the rpi3 with no dac attached see if that works.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.