Go Down

Topic: Problem in hd44780 I2C diagnostics library (Read 395 times) previous topic - next topic

tigger

Hello Bill, again
I had been struggling with getting an I2C LCD going using the many of the libraries that support the backpacks etc.

To date, direct pinning (no backpack) to a 16 x 2 brand new Midas (from Farnell) standard LCD panel worked fine.

I had tried a backpack some years ago from a vendor who used a PIC rather than a port expander. It worked for a while then failed. The vendor basically didn't want to know, so rather than get fingers burnt twice, I decide to start again at chip level, so got some DIP-16 and DIP-18 PCF8574's and MCP23008's. I started just getting used to the PCF and some LED's and was using Nick Gammon's I2C scanner to confirm the addresses.

Most of my prototype wiring is done with wire-wrapping which I have done for many years, so a photo of a birds nest of wires probably won't help a lot. I do check end to end for continuity as well as use the serial decoder output of a scope to see what is going on.

To start with, I got into a pickle with newLiquidCrystal I2C libraryand moved the original related libraries out. Next I tried the MCP chip using Adafruit's I2C library, and that worked fine.

Then I found your comprehensive hd44780 library and started working through the examples - a bit of a learning curve as my experience of these backpacks is limited, but most of the examples worked out of the box.

That's when I decided to try the diagnostics. The first attempt failed at the pullup resistor stage which passed one and failed the other - thanks - an unclean resistor leg was the cause. Next run through went through all the checks and showed LCD device found as I included in the first post. From then on, the serial monitor showed every read/write line with the read/write values different in each case and both summary lines were showing FAILED, NO WORKING LCD, though patently, it was. The output on the LCD during the run was also coming up with random characters, mostly not recognisable apart from a short line of lower case alphabetical characters.

What hasn't helped so far, is that though there are many tutorials on the subject, a lot are light on the pinning information front and apart from Adafruit and Sparkfun, a lot of the commercial vendors a understandably coy with schematics. My take on this is that I'm not going to buy another commercial unit until I've given the chips a shot.

It took me a while to find out what the pinning numbers all meant, until in one example that referred to pin 0 (zero), did I assume that it referred to output P0 on the PCF8574 and not the physical pin.

If you tell me what you want to look at, I'll do my best to provide. The hardware is Nano board (328P but with CH340 instead of FTDI - i.e. a decent clone), PCF8574A DIP-16 and Midas 16 x 2 panel  with full set of 16 pins (soldered by me), contrast pot (10k, working), 4k7 pullups on SDA and SCL to A4 and A5 respectively. All wiring is wire-wrap and checked end-to-end, but were're not infallible!

bperrybap

#1
Jun 10, 2018, 06:20 pm Last Edit: Jun 10, 2018, 06:21 pm by bperrybap
To start with, I got into a pickle with newLiquidCrystal I2C libraryand moved the original related libraries out.
Yeah, that library is a bit tricky to get installed correctly and it can require manual tweaks to get it to work depending on which version of the IDE you are using.
hd44780 is easier to install since it can be installed from the Arduino IDE GUI.

Quote
Next I tried the MCP chip using Adafruit's I2C library, and that worked fine.
That library works with their backpack but is very SLOW....

Quote
Then I found your comprehensive hd44780 library and started working through the examples - a bit of a learning curve as my experience of these backpacks is limited, but most of the examples worked out of the box.
If you found some examples that are not working, then I would really like to know which ones and more details on what is not working.


Quote
What hasn't helped so far, is that though there are many tutorials on the subject, a lot are light on the pinning information front and apart from Adafruit and Sparkfun, a lot of the commercial vendors a understandably coy with schematics. My take on this is that I'm not going to buy another commercial unit until I've given the chips a shot.
I agree, there is lots and lots of junk advice out there and sometimes from people that have no idea what they are talking about.
I don't think it is so much about being coy with the schematics as much as many of the vendors are lazy and are simply tossing out products that are sometimes just copied from some other board.
But these backpacks are extremely simple designs and boards. They are simple two sided boards.
With these i2c to hd44780 backpacks it shouldn't take more than about 5 minutes to examine the board and figure out how the i2c i/o expander is wired up to the LCD. Sometimes it may require using an ohm meter but it isn't that difficult.
Once you know how the i/o expander port pins are connected to the LCD and to the backlight circuit you then know what values to stick into a constructor to make it work.
But with my hd44780 library, the library should be able to figure it out by itself.

The goal of the hd44780_I2Cexp i/o class in the hd44780 library is to provide a "it just works" out of the box experience when using the cheap i2c backpacks available from places like ebay.
I've tried to test it on every type of backpack I could find from many vendors- so far about 12 different designs.
I have seen some issues with some of the backpacks where the PCF8574 has some legs that are not properly soldered, but other than that, the library should "just work" with nearly all the low cost PCF8574 backpacks.
There are a few that have a broken backlight circuit that causes the auto detection to fail, but those are not very common.


Quote
If you tell me what you want to look at, I'll do my best to provide. The hardware is Nano board (328P but with CH340 instead of FTDI - i.e. a decent clone), PCF8574A DIP-16 and Midas 16 x 2 panel  with full set of 16 pins (soldered by me), contrast pot (10k, working), 4k7 pullups on SDA and SCL to A4 and A5 respectively. All wiring is wire-wrap and checked end-to-end, but were're not infallible!
Ok, for some reason I thought you were using an esp8266 board which is why I recommended starting another thread.
It was because you mentioned removing the SP8266 specific pin decoding which is only used on esp8266 boards.
Oh, well, But I still think your issue is likely to be different. We will continue here.

I haven't done any wire-wrap in quite some time. (like a few decades) These days for simple stuff like this I use a breadboard.

While I have seen cases of a bad PCF8574 or a bad LCD, that is extremely rare - I think I've only ever seen that less than a handful of times. And in those cases it was typically due to previous incorrect wiring that fried a component
When there are memory errors and junk on the screen it almost always come down to a wiring/connection issue.
While it could be a library s/w issue, the library has been tested quite extensively on many on many different backpacks and LCDs by many people, including cases where I have intentionally shorted wires or disconnected wires.
Typically, what I've seen is that there is a h/w issue and that there are wires or pins shorting that should not be, broken wires, bad solder connections, or wires connected incorrectly.
It can sometimes be difficult to figure out and locate the issue.


I'd like to see the output of the diagnostics. That provides lots of useful information.
I'd also like to see photos of your setup to be able to see the wiring and solder connections.
Also, can you provide a schematic or at least pin description of how things are intended to be wired up?

--- bill



tigger

Hello Bill
As it's getting close to cocktail hour, I'll get back tomorrow with the serial monitor output.
I must admit, that the more I look into it, the more confusing it is/was becoming. It wasn't until I got one of yours working, that I got the confidence to carry on - by the way, the only one or two examples of yours that didn't work as expected, were those associated with newLiquidCrystal examples.
I went back to the Arduino Playground item on LCDs and found https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!i2c-connection.
Somewhere along the line, I recently added a new library called Arduino-LiquidCrystal-I2C-library (how confusing is this) and tried the "Hello World" example. It didn't work. However, there is a configuration line (address, pins etc.) in an example in the link above from mjkdz Courtesy of PeterSek which I substituted and that worked straightaway.
Anyhow, I don't want to muddy the waters any more, but I would like to get some sense out of the original diagnostics sketch which I'll send tomorrow.
At one point, I was thinking of just using one of the Nano's as a backpack (I can recommend the Elegoo offerings at a few quid each).
On the dodgy components point, I generally get all my components from RS/Farnell/Digikey like the PCF's, MCP23008 and Midas displays. More expensive yes, but it just takes one doubt about quality out of the equation especially at the prototyping stage. As you say, most of these backpacks apart from the PIC versions, are just a chip and some headers. What could possibly go wrong?
PS IDE is 1.8.5

bperrybap

by the way, the only one or two examples of yours that didn't work as expected, were those associated with newLiquidCrystal examples.
There are several potential issues the newLiquidCrystal library.
- installation (may people struggle with that)
- configuration parameters with the LiquidCrystal_I2C class
There isn't a way to make something that "just works" with that library since there are 16 different possible i2c addresses, and 6 different possible PCF8574 to LCD pin wirings/mappings.

I'm considering just removing those newLiquidCrystal examples as I really no longer use or support that library anymore and it just creates extra support work for me with no benefit.

Quote
Somewhere along the line, I recently added a new library called Arduino-LiquidCrystal-I2C-library (how confusing is this) and tried the "Hello World" example. It didn't work. However, there is a configuration line (address, pins etc.) in an example in the link above from mjkdz Courtesy of PeterSek which I substituted and that worked straightaway.
If you look around you will find more than a dozen libraries with "LiquidCrystal_I2C' classes in them.
Making matters worse, lots of vendors and individuals have squirreled away versions of fm's newLiquidCrystal library as well as other versions of libraries called "LiquidCrystal_I2C" and they don't have revision information in them so it is very difficult to tell what library you have or what version it is.

This was another reason that drove me to create hd44780.
My recommendation at this point is to use only 2 libraries for a PCF8574 / LCD library
Both available in the library manager and have version information.
- LiquidCrystal_I2C - in the IDE library manager
- hd44780 with the hd44780_I2Cexp i/o class

LiquidCrystal_I2C will not work with all backpacks as the pin wiring is hard coded to one of the more common backpacks.


While fm's newLiquidCrystal library using the LiquidCrystal_I2C class does work on any PCF8574 backpack, I don't recommend it for a few reasons
- It is difficult to install
- Many users struggle with correctly configuring it
- It has several copyright and licensing issues/violations
(fm is in the process of cleaning this up and the resulting library will be gpl v3.0 - this has been dragging out for too long - more than a year)

There are lots of other "LiquidCrystal_I2C" libraries out there but most of them are just copies of the LiquidCrystal_I2C library, or fm's library.
And many of them have licensing and copyright issues as the authors often change the licensing in the files from LGPL 2.1+ to BSD which is not allowed.

I would recommend sticking to the two libraries I mentioned above which can be installed using the library manager.

-- bill

tigger

Hello Bill
I've included the Serial Monitor output and some not very good photos.
(I gave up trying to add the photos as I've spent a good chunk of time going through a 6-page forum item describing how difficult it is) - I'm also sorry that the wiring table looks so horrible in the post as there doesn't seem to be any tabbing and spacing it just reformats it) Plus the last sodding Windows 10 feature update has messed the keyboard layout.
Yes the wiring looks like a dog's dinner, but available breadboards and Nano's have been used up.
Pullups are out of picture.
I've tested each line for continuity from pin to pin - not end of wire to end of wire.
After many years of soldering, I'm quite certain that's OK.
I haven't used the backlight facility yet, so the last port (P7) on the PCF isn't connected.
I've taken note of all your comments and been through your item on the LCDs with keypads.
My wiring is as follows, starting with LCD physical pin (LCD-PP), LCD pin function (LCDPF), PCF physical pin (PCF-PP), and PCF pin function (PCF-PF) - I didn't include the Nano SDA and SCL as that works



LCD-PP     LCD-PF     PCF-PP     PCF-PF

14            D7            12           P7
13            D6            11           P6
12            D5            10           P5
11            D4            9             P4
10            N/C   
9              N/C
8              N/C
7              N/C
6              ENABLE     6            P2
5              RW           5             P1
4              RS            4             P0
                                7             P3  (FOR BACKLIGHT CONTROL, NOT USED YET)


I'm reserving judgement on the newLiquidCrystal examples as now that I've found the fmalpartida full item with all the schematics, I'll give them a go with revised wiring at my end. I will agree with the comment on hard coding as in the newLiquidCrystal "Hello World" example which is where most novices start, a few lines of commented LCD to PCF wiring information wouldn't go amiss, but that's not a worthy criticism after all the effort that anyone presenting a new library has put in.

I do agree about the number of libraries on this particular topic and the choice, the naming, the pin and addressing permutations are a headache. I can think of some others in the Real Time Clock department
 






********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 0.9.3
--------------------------------------------------------------------
Reported Arduino Revision: 1.8.5
CPU ARCH: AVR - F_CPU: 16000000
--------------------------------------------------------------------
 A4: digital pin: 18
 A5: digital pin: 19
SDA: digital pin: 18
SCL: digital pin: 19
--------------------------------------------------------------------
Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - YES
--------------------------------------------------------------------
Scanning i2c bus for devices..
 i2c device found at address 0x20
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays
 LCD at address: 0x20 | config: P65401237L | R/W control: Yes
Total LCD devices found: 1
--------------------------------------------------------------------
LCD Display Memory Test
Display: 0
 Walking 1s data test:   
   Compare error: addr: 0 read 0 != wrote 4
   Compare error: addr: 0 read 22 != wrote 8
   Compare error: addr: 0 read 22 != wrote 10
   Compare error: addr: 0 read 22 != wrote 20
   Compare error: addr: 0 read 22 != wrote 40
   Compare error: addr: 0 read 22 != wrote 80

   Compare error: addr: 40 read 22 != wrote 1
   Compare error: addr: 40 read 22 != wrote 2
   Compare error: addr: 40 read 0 != wrote 4
   Compare error: addr: 40 read 20 != wrote 8
   Compare error: addr: 40 read 0 != wrote 10
   Compare error: addr: 40 read 0 != wrote 20
   Compare error: addr: 40 read 0 != wrote 40
   Compare error: addr: 40 read 0 != wrote 80

   Compare error: addr: 10 read 2 != wrote 1
   Compare error: addr: 10 read 22 != wrote 2
   Compare error: addr: 10 read 0 != wrote 4
   Compare error: addr: 10 read 2 != wrote 8
   Compare error: addr: 10 read 22 != wrote 10
   Compare error: addr: 10 read 22 != wrote 20
   Compare error: addr: 10 read 22 != wrote 40
   Compare error: addr: 10 read 22 != wrote 80

   Compare error: addr: 50 read 22 != wrote 1
   Compare error: addr: 50 read 22 != wrote 2
   Compare error: addr: 50 read 0 != wrote 4
   Compare error: addr: 50 read 0 != wrote 8
   Compare error: addr: 50 read 0 != wrote 10
   Compare error: addr: 50 read 0 != wrote 20
   Compare error: addr: 50 read 0 != wrote 40
   Compare error: addr: 50 read 0 != wrote 80
FAILED
 Address line test:   
   Compare error: addr: 0 read FF != wrote 0
   Compare error: addr: 1 read F2 != wrote 1
   Compare error: addr: 2 read 20 != wrote 2
   Compare error: addr: 3 read 2 != wrote 3
   Compare error: addr: 4 read 22 != wrote 4
   Compare error: addr: 5 read 22 != wrote 5
   Compare error: addr: 6 read 22 != wrote 6
   Compare error: addr: 7 read 20 != wrote 7
   Compare error: addr: 8 read F != wrote 8
   Compare error: addr: 9 read F2 != wrote 9
   Compare error: addr: B read 20 != wrote B
   Compare error: addr: C read 2 != wrote C
   Compare error: addr: E read 22 != wrote E
   Compare error: addr: F read 22 != wrote F
   Compare error: addr: 10 read 22 != wrote 10
   Compare error: addr: 11 read 20 != wrote 11
   Compare error: addr: 12 read F != wrote 12
   Compare error: addr: 13 read 20 != wrote 13
   Compare error: addr: 14 read 2 != wrote 14
   Compare error: addr: 15 read 22 != wrote 15
   Compare error: addr: 16 read 22 != wrote 16
   Compare error: addr: 17 read 22 != wrote 17
   Compare error: addr: 18 read 20 != wrote 18
   Compare error: addr: 19 read F != wrote 19
   Compare error: addr: 1A read 20 != wrote 1A
   Compare error: addr: 1B read 2 != wrote 1B
   Compare error: addr: 1C read 22 != wrote 1C
   Compare error: addr: 1D read 22 != wrote 1D
   Compare error: addr: 1E read 22 != wrote 1E
   Compare error: addr: 1F read 20 != wrote 1F
   Compare error: addr: 20 read F != wrote 20
   Compare error: addr: 21 read 2 != wrote 21
   Compare error: addr: 23 read 22 != wrote 23
   Compare error: addr: 24 read 22 != wrote 24
   Compare error: addr: 25 read 20 != wrote 25
   Compare error: addr: 26 read F != wrote 26
   Compare error: addr: 27 read 2 != wrote 27

   Compare error: addr: 40 read BF != wrote 40
   Compare error: addr: 41 read 12 != wrote 41
   Compare error: addr: 42 read 23 != wrote 42
   Compare error: addr: 43 read 34 != wrote 43
   Compare error: addr: 4D read 56 != wrote 4D
   Compare error: addr: 4E read 4F != wrote 4E
   Compare error: addr: 50 read 56 != wrote 50
   Compare error: addr: 51 read 56 != wrote 51
   Compare error: addr: 52 read 5F != wrote 52
   Compare error: addr: 53 read 23 != wrote 53
   Compare error: addr: 54 read 44 != wrote 54
   Compare error: addr: 55 read 45 != wrote 55
   Compare error: addr: 56 read 46 != wrote 56
   Compare error: addr: 57 read 47 != wrote 57
   Compare error: addr: 58 read 48 != wrote 58
   Compare error: addr: 59 read 49 != wrote 59
   Compare error: addr: 5A read 4A != wrote 5A
   Compare error: addr: 5B read 4B != wrote 5B
   Compare error: addr: 5C read 4C != wrote 5C
   Compare error: addr: 5D read 56 != wrote 5D
   Compare error: addr: 5E read 4F != wrote 5E
   Compare error: addr: 5F read 4F != wrote 5F
   Compare error: addr: 60 read 4F != wrote 60
   Compare error: addr: 61 read 4F != wrote 61
   Compare error: addr: 62 read 4F != wrote 62
   Compare error: addr: 63 read 34 != wrote 63
   Compare error: addr: 64 read 4 != wrote 64
   Compare error: addr: 65 read 4 != wrote 65
   Compare error: addr: 66 read 4 != wrote 66
   Compare error: addr: 67 read 4 != wrote 67
FAILED

No working LCD devices


Thanks for the help so far and I hope you can make sense of the above. I've gotta go now, but let me know if you need some more info

Cheers



bperrybap

In reality this stuff isn't that complicated. The library must know the i2c address, pin mappings and backlight control logic.
If the i2c address and pin mappings in the library match the actual h/w, it works.

The LiquidCrystal_I2C library (you should only be using the one in the IDE library manager)
hard codes everything but the i2c address.
It uses a common pin wiring but will not work with all backpacks since not all of them use that wiring.

fm's newLiquidCrystal library LiquidCrystal_I2C class will work with any backpack as long as it is configure properly.
Since the default pin wiring is for the Electro fun board and no other backpack uses that wiring,
it requires manually configuring all the pin wiring information in the constructor.
If the i2c address and pin wiring information in the constructor is correct, it will work.

hd44780 library package hd44780_I2Cexp i/o class will auto detect everything.
If the backlight circuit is incorrectly designed it it will get the backlight active level incorrect.
Backpacks with incorrect backlight circuits not the norm.


I2C backpacks are less that $1USD shipped to your door from ebay.
This is a lot time and energy being spent rather than just buying a pre-made part that "just works".




To get text to line up, you must use a non proportional font. There are two options, either treat it as code or use the Teletype font.
You highlight the text (which will look like crap in the post) and then click on the code </> or Teletype Tt
It will look correct when you preview it or post it as the font used for the selection will be a non proportional font.

The first thing I notice is that if you have it wired up according to your table, the auto configuration came up with a different pin mapping. That will cause all sorts of issues.
Your table used 01245673 and the auto config determined 65401237L (ignore the backlight pin on the end since it isn't hooked up)
The memory tests will obviously fail if the pin mappings are incorrect.
So now the question becomes is there a h/w wiring/connection issue or is there an auto detection issue.


One thing you could do to verify that the h/w is working is to manually set the pin mappings just to see if works correctly.
This is done using a manual configuration constructor:
Code: [Select]
const uint8_t addr = 0;  // zero means auto locate
const uint8_t rs=0, rw=1, en=2, d4=4, d5=5, d6=6, d7=7;
hd44780_I2Cexp lcd(addr, I2Cexp_PCF8574, rs, rw, en, d4, d5, d6, d7);


I haven't done much testing with PCF8574 connected without having a pin connected to a backlight circuit since backpacks have this connected. It is possible that there may be a probing issue there, but the auto detection code is not supposed to care if the pin used for backlight control is connected to anything.

In terms of the preferred way to connect the PCF8574 to the LCD I would recommend against using the wiring used on fm's newLiquidCrystal page for his ElectroFun board. That wiring is not used by any other backpack.
The preferred wiring I would recommend is the wiring that is expected by the LiquidCrystal_I2C library that is available in the IDE library manager. It is one of the more common wirings and it will allow you to use the LiquidCrystal_I2C library that is the library manager as well as hd44780.

The LiquidCrytal_I2C library in the IDE library manager expects:
RS      0
R/W     1
E       2
DB4     4
DB5     5
DB6     6
DB7     7

BL      3
Level   HIGH

which should be the same as what you have shown which means that the LiquidCrystal_I2C library should work with that wiring.



--- bill


tigger

Hello Bill
Thanks again
What a quagmire this is. As you say, it's simple once everything's lined up on the right tracks
I don't know where my pinout came from as there have been too many examples, too many different wirings, but I will get it to work.
I had a look at the Electrofun board schematic and as far as I could see, the only difference was the RS and Enable pins are swapped, but I'm not going down that route. Those two pins are going to cause havoc. The "Hello World" example in NLC appears to be hard-coded for configuration. I did look in the cpp and h files but couldn't see where to change it and life's too short.
I'll rearrange the wiring or the constructor as you have written in the code snippet and I'll also add a backlight transistor.
This might take a day or two, but I will get back with the results.
I'll move the newliquidcrystal library out for now - I can see a lot of hard work has gone into it and your involvement - and install the IDE LiquidCrystal_I2C library from library manager - I'm assuming it's the Frank Brabander one.
Thanks for the Teletype tip. I was wondering what it was. Takes me back decades. Last time I used one was on a university mainframe, IBM punched cards, 24-hr job turnaround, way before PC's. But at least everything worked.  As I said, the last 1803 Win 10 feature update has introduced a bug where if you have say English (UK) keyboard normally selected, frequently and randomly it reverts to English(United States), so hash becomes backslash and the at sign becomes double quotes etc. By some quirk, these forum text boxes make it worse. An apostrophe becomes a hash, but changing the keyboard doesn't fix it
To fix it, you have to go out of the forum, type the apostrophe in a text editor then go back to the forum when it now works. So that's progress and another unwanted feature update from Microsoft to add to the mix.
You have to see this Topic: Guide: How to Insert Uploaded Images in a Post to see what I mean about inserting/attaching photos.

bperrybap

#7
Jun 12, 2018, 01:16 am Last Edit: Jun 12, 2018, 01:20 am by bperrybap
I'm assuming the wiring that you showed in the table in post #4  is the way you have your board currently wired up.
It should match the hd44780_I2Cexp manual config constructor and table I showed in post #5
So there shouldn't need to be any re-wiring other than for optional backlight support.

fm's electroFun board is wired up as:
RS      4
R/W     5
E       6
DB4     0
DB5     1
DB6     2
DB7     3

Which is very different from the pin wiring assumed by the LiquidCrystal_I2C library.
Any pin wiring can work, with newLiquidCrystal LiquidCrystal_I2C and hd44780 hd44780_I2Cecp but only the one I showed in post #4 will work with the IDE LiquidCrystal_I2C library.

But since you said you already have your board wired up as shown in post #4 it should be a quick test to see if it is working with the  LiquidCrystal_I2C library or hd44780.

And if you have it wired up differently, then simply assign the proper Pn numbers to the variables I showed for the hd44780_I2Cexp manual configuration constructor.

fm's newLiquidCrystal LiquidCrystal_I2C constructor uses a different parameter order than hd44780_I2Cexp, so keep that in mind if you are comparing constructor parameters.


One thing to note when wiring up a transistor is that the PCF8574 can't drive any load. It can sync but not source.
When bits in the output port are set to 1 it enables a pullup inside the PCF8574 on the pin; it does not drive the pin high.
So if you use an NPN transistor, you don't need a resistor between the PCF8574 pin and the base and you want the emitter connected directly to ground.

--- bill

tigger

Hello Bill,
Thank you for being so patient.
There's good news and bad news.
First the good news - I've now got the diagnostics and read/write working.
Here's the proof

LCD Display Memory Test
Display: 0
 Walking 1s data test: PASSED
 Address line test: PASSED

The bad news - as a last desparate measure, I swapped out the original brand new Midas LCD, and wired up my second and last available new identical Midas display - that's when it all worked. So one sodding new display from Farnell was doing everything right on the surface, but read/write obviously has a problem.
The data sheet has all the read/write stuff - I was wondering if it supported read/write at all.
So Farnell will be getting a call tomorrow.
Full marks to your library for picking it all up and from now on, any new LCD panels will be getting your diagnostics check first.
I moved the NLQ library out and installed the LiquidCrystal_I2C library from Library Manager.
All the LQ_I2C examples worked.
The only thing that didn't get to work was the little code snippet with the manual configuration.
I popped it into the USER CONFIGURABLE section and commented out hd44780_I2Cexp lcd[16]; // auto locate & configure up to 16 displays as it was coming up with declaration conflict.
Compilation failed at PrintUpTime(lcd[n], secs);
I have to admit all this was getting me going a bit, but in past life, I had to do a lot of problem solving at the sharp end of a large public utility, and giving up wasn't an option.
Faith in PCF8574 in I2C LCD restored so can now look forward to string some displays together. Karma added

bperrybap

Glad it is finally working.

The only thing that didn't get to work was the little code snippet with the manual configuration.
I popped it into the USER CONFIGURABLE section and commented out hd44780_I2Cexp lcd[16]; // auto locate & configure up to 16 displays as it was coming up with declaration conflict.
Sorry,  it seems like I have wasted some of your time.
I forgot to mention that the manual configuration stuff would only work in simpler sketches like "HelloWorld" that use only a single lcd object instance and would not work in the diagnostic sketch.
The diagnostic sketch does things very differently than a normal sketch and the use of an array of lcd object complicates things, particularly if manual configuration was desired on all the possible devices.
An array of lcd objects was used as it allows testing of multiple devices at the same time.

--- bill

Go Up