What am i doing wrong with my hd44780 16x2 lcd?
-
@future-child Yes I have i2c enabled,
I'm not sure if the backpack is 3v compatible or not but i'll have a look.
The software I'm using is a scrolling game title script/package called RetroPie-ClcdThanks for the reply and i'll test lcdi2c.py see what happens.
-
I ran lcdi2c.py and I get: IOError: [Errno 121] Remote I/O error
I'll double check all my connections. -
@boz The lcd backpack you have would be for TTL (5V) and would require a level shifter see step 1.
Asi2cdetect -y 1
returns no error it is safe to assume the /dev/i2c device exists (and therefore i2c is enabled).
Possibly you may have already damaged the i2c pins by connecting a TTL device (albeit a very small chance).to make sure all is correct on the pi side (software wise) check the following :
/etc/modules
containsi2c-bcm2708
andi2c-dev
./etc/modprobe.d/raspi-blacklist.conf
(if a all present) hasblacklist spi-bcm2708
andblacklist i2c-bcm2708
commented out with a # or not present at all./boot/config.txt
containsdtparam=i2c1=on
anddtparam=i2c_arm=on
- reboot to make sure the i2c interface is enabled.
-
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.
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.