RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    What am i doing wrong with my hd44780 16x2 lcd?

    Scheduled Pinned Locked Moved Help and Support
    hd44780 16x2 lc
    52 Posts 3 Posters 14.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • future.childF
      future.child @Boz
      last edited by

      @boz The lcd backpack you have would be for TTL (5V) and would require a level shifter see step 1.
      As i2cdetect -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 contains i2c-bcm2708 and i2c-dev.
      • /etc/modprobe.d/raspi-blacklist.conf(if a all present) has blacklist spi-bcm2708 and blacklist i2c-bcm2708commented out with a # or not present at all.
      • /boot/config.txt contains dtparam=i2c1=on and dtparam=i2c_arm=on
      • reboot to make sure the i2c interface is enabled.
      1 Reply Last reply Reply Quote 0
      • BozB
        Boz
        last edited by

        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).
        0_1500656188295_backpack.JPG

        1 Reply Last reply Reply Quote 0
        • BozB
          Boz
          last edited by

          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=on

          I think I might have added dtparam=i2s=on while trying things.

          1 Reply Last reply Reply Quote 0
          • cyperghostC
            cyperghost
            last edited by

            @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.

            BozB 2 Replies Last reply Reply Quote 0
            • BozB
              Boz @cyperghost
              last edited by

              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 5

              I followed this diagram:
              0_1500658168505_68747470733a2f2f692e696d6775722e636f6d2f575450487a73662e706e67.png

              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.

              1 Reply Last reply Reply Quote 0
              • BozB
                Boz @cyperghost
                last edited by

                @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.

                future.childF 1 Reply Last reply Reply Quote 0
                • future.childF
                  future.child @Boz
                  last edited by

                  @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.

                  cyperghostC 1 Reply Last reply Reply Quote 1
                  • BozB
                    Boz
                    last edited by Boz

                    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

                    future.childF 1 Reply Last reply Reply Quote 0
                    • future.childF
                      future.child @Boz
                      last edited by

                      @boz Yes that one would do fine.

                      1 Reply Last reply Reply Quote 0
                      • cyperghostC
                        cyperghost
                        last edited by cyperghost

                        @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

                        BozB 1 Reply Last reply Reply Quote 0
                        • cyperghostC
                          cyperghost @future.child
                          last edited by

                          @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!

                          1 Reply Last reply Reply Quote 0
                          • BozB
                            Boz @cyperghost
                            last edited by

                            @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!

                            1 Reply Last reply Reply Quote 0
                            • cyperghostC
                              cyperghost
                              last edited by cyperghost

                              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 with i2cdetect -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!
                              img

                              1 Reply Last reply Reply Quote 0
                              • BozB
                                Boz
                                last edited by

                                So i just swap pin 4 for pin 1?

                                cyperghostC 1 Reply Last reply Reply Quote 0
                                • BozB
                                  Boz
                                  last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • cyperghostC
                                    cyperghost @Boz
                                    last edited by cyperghost

                                    @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: -- -- -- -- -- -- -- --
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • BozB
                                      Boz
                                      last edited by

                                      Ha ha we'll see!

                                      1 Reply Last reply Reply Quote 0
                                      • BozB
                                        Boz
                                        last edited by

                                        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.

                                        1 Reply Last reply Reply Quote 0
                                        • cyperghostC
                                          cyperghost
                                          last edited by

                                          @Boz Maybe you remove your I2S devices, too and look to the posting @future-child gave you. This is a nice instruction as well

                                          1 Reply Last reply Reply Quote 0
                                          • BozB
                                            Boz
                                            last edited by

                                            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.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.