Troubleshooting an i2c 16x2 LCD - no data seen - Page 1
Forum section: electronics / projects

author: anishkgt
author_rank: Frequent Contributor
timestamp: August 31, 2018, 06:32:47 pm
content: 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.

author: anishkgt
author_rank: Frequent Contributor
timestamp: August 31, 2018, 06:34:14 pm
content: 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.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: August 31, 2018, 06:48:21 pm
content: 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 hereand why do you do a pcb for this purpose on your own. Those I2C-backpacks for LCDs are centarticles to buy, so why homebrew?

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 07:11:33 am
content: 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.

author: Julien3146
author_rank: Contributor
timestamp: September 01, 2018, 07:27:39 am
content: 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... ?

author: bingo600
author_rank: Super Contributor
timestamp: September 01, 2018, 07:45:49 am
content: 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

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 08:44:43 am
content: Tried several turns on the POT. Its is never the POT. The LCD does not stay on for some reason. Attached schematic of Microcontroller.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: September 01, 2018, 09:30:59 am
content: Quote from: anishkgt on September 01, 2018, 07:11:33 amIt'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?

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 09:36:02 am
content: Quote from: HB9EVI on September 01, 2018, 09:30:59 amI 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.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: HB9EVI
author_rank: Frequent Contributor
timestamp: September 01, 2018, 10:05:17 am
content: 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.

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 10:08:12 am
content: 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.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 02:20:39 pm
content: My expander reads as PCF8547T

author: HB9EVI
author_rank: Frequent Contributor
timestamp: September 01, 2018, 03:42:08 pm
content: 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

author: NiHaoMike
author_rank: Super Contributor
timestamp: September 01, 2018, 04:38:48 pm
content: 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.

author: Nusa
author_rank: Super Contributor
timestamp: September 01, 2018, 05:05:42 pm
content: 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.

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 01, 2018, 09:06:45 pm
content: 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:#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

author: HB9EVI
author_rank: Frequent Contributor
timestamp: September 01, 2018, 09:49:17 pm
content: Did you verify the wiring between the expander and the LCD?

author: Nusa
author_rank: Super Contributor
timestamp: September 01, 2018, 11:42:22 pm
content: Quote from: anishkgt on September 01, 2018, 09:06:45 pmEverything 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

author: anishkgt
author_rank: Frequent Contributor
timestamp: September 02, 2018, 12:07:58 am
content: 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.

author: anishkgt
author_rank: Frequent Contributor
timestamp: October 10, 2018, 06:59:13 am
content: 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.