EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: anishkgt on August 31, 2018, 06:32:47 pm

Title: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on August 31, 2018, 06:32:47 pm
Hi All,

i am trying to troubleshoot my PCB which has 16x2 LCD on an i2c bus. Not very good at it.


Any help would be appreciated.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on August 31, 2018, 06:34:14 pm
When powered on the Screen blinks once and goes off. I tested this conectivity using one from ebay and the SDA SCL lines seems to be working.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: HB9EVI on August 31, 2018, 06:48:21 pm
with that little information it's tricky to give you a hint; and btw. didn't we already talk about that recently?

here is a PCF8574 and a PCF8574A, afaik they are not identical; you should check your code, or at least post here

and why do you do a pcb for this purpose on your own. Those I2C-backpacks for LCDs are centarticles to buy, so why homebrew?
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 07:11:33 am
I understand it is in the schematic because as i said all looks good on an LCD from ebay with its backpack. I've tried replacing the PCF IC but that did not help. The LCD goes after 1 second into powering it on.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: Julien3146 on September 01, 2018, 07:27:39 am
Hi,

I don't know this chip and have very low motivation to read the datasheet, but i assume it's an IO expander ?
The only thing that strikes me is that your INT pin is floating, I assume it's internally pulled high ?

Anyway, could you please be more specific, how do you control it, etc... ?
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: bingo600 on September 01, 2018, 07:45:49 am
I just had "No display / Chars seen" with a Blue/White 16x2 chinese disp , SPI not i2c.

But it was the Contrast pot that had to be adjusted.

For starters adjust it until you can see the 5x7 char matrix blocks , then you know you are in the "right ballpark".
When chars are seen (program is right) , adjust so you can't see the 5x7 matrixes

/Bingo
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 08:44:43 am
Tried several turns on the POT. Its is never the POT. The LCD does not stay on for some reason. Attached schematic of Microcontroller.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: HB9EVI on September 01, 2018, 09:30:59 am
I understand it is in the schematic because as i said all looks good on an LCD from ebay with its backpack. I've tried replacing the PCF IC but that did not help. The LCD goes after 1 second into powering it on.

It's not helping to open ever and ever again new threads about the same topic.

Did you verify the different slave addresses for the PCF8574 (0x40) and the PCF8574A (0x70) in your code, like somebody already advised you in the other thread about that issue?
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 09:36:02 am
I understand it is in the schematic because as i said all looks good on an LCD from ebay with its backpack. I've tried replacing the PCF IC but that did not help. The LCD goes after 1 second into powering it on.

It's not helping to open ever and ever again new threads about the same topic.

Did you verify the different slave addresses for the PCF8574 (0x40) and the PCF8574A (0x70) in your code, like somebody already advised you in the other thread about that issue?
I use an arduino and a library used to handle the LCD is the hd44780 (https://www.arduinolibraries.info/libraries/hd44780)

It detects the address automatically and including those pins for sending, receiving and writing. But since it was mentioned I will look at it again. If that is something that has to be done in the code then I am sure I’ve not put anything like that.


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: HB9EVI on September 01, 2018, 10:05:17 am
Did you actually take the work on you tracking down, how the lib really works? How do you know, that it is free of issues? I wouldn't rely on some kind of autodetect functions when it comes to code, I didn't write myself.

You can search endlessly for hardware issues; it's not going to help, if you didn't doublecheck, that your code is doing what it should; but certainly - I'm not going to do that for you.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 10:08:12 am
The code does work when I used a prebuilt one from eBay. Just need to know I’ve missed out anything in my schematic which from what I see, I ’ve not.


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 02:20:39 pm
My expander reads as PCF8547T
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: HB9EVI on September 01, 2018, 03:42:08 pm
there is no PCF8547, only PCF8574 and PCF8574. The 'T' is the case (SOIC)

from the backpacks I have here on stock; the lcd data pins (DB4,DB5,DB6,DB7) are connected with the PCF8574 pin P4, P5, P6 and P7 - and not like in your schematic with pin P0, P1, P2 and P3.
I cannot say, which backpack you have, since there are about 10000 of sources, but it's likely that the all follow the same pin connections - so you are wrong with your project - something what you should long time have double checked between the bought backpack and the selfmade
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: NiHaoMike on September 01, 2018, 04:38:48 pm
One trick I like to do with a PCF I2C expander driving a HD44780 LCD is to pull down the clock line with a 4.7k resistor. That works because the clock line activates on the falling edge and the PCF has a low impedance pullup that is able to override the resistor during the ACK phase of the I2C communications, but the low current pullup is not enough to keep it high. That basically halves the traffic on the I2C bus when driving the LCD, which is useful if you want to do animations or want to finish using the I2C bus quickly so that other devices can be used.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: Nusa on September 01, 2018, 05:05:42 pm
The symptoms you describe are the backlight being turned on briefly and being turned off again. Since you have the backlight set up for software control, that implies the software is turning it off (after defaulting to on when powered up). Which in turn probably means data IS being seen, and you may have nothing wrong with the I2C side of things.

Where in your code have you configured the mapping of the 8574 pins to the LCD pins? If you don't know, then you need to find out. If you think that will be auto-configured, I think you are mistaken.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 01, 2018, 09:06:45 pm
Here is the header file that holds the Auto configure. I don't understand much of it.

In Arduino i include the library and set it to auto configure.
Code: [Select]
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
hd44780_I2Cexp lcd;

There is diagnostic sketch to test the LCD and it displayed it was on 0x27 if i remember.

Edit:
In the attached header file there are a few examples showing how to use the functions.

examples:
// hd44780_I2Cexp lcd; // autolocate/autoconfigure everything
// hd44780_I2Cexp lcd(0x20); // autoconfigure for lcd at i2c address 0x20
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: HB9EVI on September 01, 2018, 09:49:17 pm
Did you verify the wiring between the expander and the LCD?
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: Nusa on September 01, 2018, 11:42:22 pm
Here is the header file that holds the Auto configure. I don't understand much of it.

In Arduino i include the library and set it to auto configure.
Code: [Select]
#include <hd44780.h>
#include <hd44780ioClass/hd44780_I2Cexp.h>
hd44780_I2Cexp lcd;

There is diagnostic sketch to test the LCD and it displayed it was on 0x27 if i remember.

Edit:
In the attached header file there are a few examples showing how to use the functions.

examples:
// hd44780_I2Cexp lcd; // autolocate/autoconfigure everything
// hd44780_I2Cexp lcd(0x20); // autoconfigure for lcd at i2c address 0x20

Everything you need looks pretty well documented in that header. In your case, one of the canned backpacks seems to match your schematic. Try:
hd44780_I2Cexp lcd(I2Cexp_BOARD_LCDXIOnBL); // Electrofun & PNP transistor for BL
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on September 02, 2018, 12:07:58 am
I've removed the I/O expander and soldered it back and now the LCD light stays ON. I don't have my USB interface done because i am out of Solder paste. Order them few weeks back but they are yet to arrive. So i will try your suggestion once i have the usb soldered.

Strange to know it was working on my previous PCB and now its not.
Title: Re: Troubleshooting an i2c 16x2 LCD - no data seen
Post by: anishkgt on October 10, 2018, 06:59:13 am
So i've replaced the I/O expander, the transistor and checked SDA and SCL for continuity, all looks good but still nothing seems to be working. The back light just blinks and goes OFF and the first row in the LCD just shows thick blocks leaving the second row blank.