i2c LCD...

Do you have pullups on the i2c bus lines?
It sounds like you don't have them.
Add them and see if things start to work correctly.

Pullups are needed to make the i2 bus work.
If they are not there or are too large,
then all bets are off as to anything working properly.
Yes, I know that it "usually" work just fine without them when
connected to the AVR and it is the only device on the bus;
however, without them the i2c bus signals are WAY out of spec
and in some situations the bus signals fail bad enough to not work
correctly.

--- bill

crossbreak:
hi I'm the one who gave smithy the blue i2c adapter... Got 4, gave one to smithy. I tested another blue module with the guesser tool (thx for that!))

my blue adapter works with setting 0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE

Yep. That's what I said.

bperrybap:
Paul,
Does the top/front of your PCB look like smithy's with no way to set the i2c address and all the Address pins hard coded to ground?

Yep. In every detail including the fact that some moron ground off the surface of the chip. And I can visually confirm that pins 1, 2 and 3 are connected to ground. I am suffering at the moment from a rain of Chinese envelopes cascading from the stack on my work-table - I really must address that problem but having no intention of de-soldering the backpack from my example board, I realised that I had soldered it in the first place and that I had more than one of the backpacks, so went and found another. There's at least a third here somewhere too.

bperrybap:
So the proper constructor will use the same LCD bits as the constructor that Paul provided
which is also what I use on the mjkdz board that I have as well.

(Although my mjkdz board is a very different design than smithy's)

I can't really imagine that - or why - the same original designer would produce alternate configurations.

bperrybap:
From the more recent photos, you can make out the transistor. It is a 2TY (same as what is on mjkdz board) and that is PNP transistor. Given how it is wired, the backlight polarity will be NEGATIVE.

It is. 2TY Inverting drive to the high side.

bperrybap:
For a final constructor of:

                     // addr, EN,RW,RS,D4,D5,D6,D7,BL, POLARITY

LiquidCrystal_I2C lcd(i2cAddr, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE);




This constructor is in the guess list of the guesser sketch so it should have been found.

And it is for me - though I have serious problems with the "guesser" script, which I was about to mention earlier, but not relevant to this present matter.

bperrybap:
One thing that does concern me is the overall design, in that there appears to be no way to set the address for the chip. From looking at the photo, it appears that all 3 address pins are connected together and then connected to ground.

Clearly not useful for multiple displays then.

bperrybap:
There are also no bypass/decoupling caps on the board along with no i2c pullups which could also cause issues particularly if there are no i2c pullups on the i2c bus somewhere else.

Hasn't troubled me at all so far. I'm betting that pull-ups will be a dead end but absolutely no harm in fitting a bypass cap across the supply lines. According to the posts here, it has fixed some people's problems before. I do believe there are a cap or caps on the LCD itself which should be close enough when the backpack is soldered (or pinned) on directly, and unless you use long wires, the internal pull-ups work just fine.

Clearly, there is some serious hardware problem with smithy's setup. I would like to see his actual output from the "guesser" and I hope he is using the correct I2C interface pins just to see that there is not some strange "phantom" response happening.

Am looking at chasing some "pogo pins" to use as a test adapter for this backpack, though it may be more appropriate to fit socket headers to all LCD displays.


Now ...

On Linux (Fedora 13), if I reset the Pro Micro via the CP2102 adapter while the Serial Monitor is open, it re-allocates the CP2102 to a different USB port until I un-plug it and plug it in again. This prevents me from using the serial monitor and I had to remove the "wait for CR" in order to run the guesser.

I also automatically added the missing

LiquidCrystal_I2C lcd(lcdAddr, 6, 5, 4, 0, 1, 2, 3, 7, POSITIVE);

permutation - not that it got me anywhere. Or that I needed to use the guesser in the first place, but I was just curious.

This is not construed as a complaint, but a curiosity of running with (this version of) Linux which will no doubt impact on all programs using the Serial Monitor which I have not attempted before. When I sort out the rubble here, I am swapping to an upgraded machine with Mint.

I use no pullups for the test, worked without. My shield has the pullups.

the blue board obviously have no decoupling caps...the black boards doesnt have have any as well. Guess this is not needed, since there is no high voltage this circuit could could conduct to Arduino. Guess these caps are only needed on higher voltage devices that work with >5V,.

the one cap on the black boards hangs on VCC and GND, guess for smoe sort of high frequency noise damping. It's a 0.1nF SMD cap.

crossbreak:
I use no pullups for the test, worked without. My shield has the pullups.

I'm curious which shield you have?
The sensor shield I have does not have i2c bus pullups.
(see attached photo)
When casually looking at the board, it would appear that it does
but the two resistor next to the i2c connector are not i2c pullups.
1 is for the power LED, and the other is an additional pullup on the RESET line.

Decoupling caps are not for high voltage.

Pullups are required to make the i2c bus work, so if no pullups are used or
improper pullups are used and it "worked" for a test,
doesn't mean that it really works.
It just luckily happend to work for that set of conditions during the test.

--- bill

IMG_6654.JPG

Well, I am not using a "shield", but the pull-ups should by rights, be on the "master" end, in order not to duplicate them with each successive slave device.

In the (cursory) sorting process this morning, I came across two other versions of the backpack, and propose to document them more fully. This should really be in the "playground" or somewhere similar so that they can be readily identified when we need to sort out these problems - I don't think it is so far.

My other blue backpack actually has a power indicator LED as well as the address selectors in the form of a three point solder jumper with a default track bridge and 10k pull-ups to SDA and SCL. It has a teeny-tiny potentiometer but since this need not be adjusted after initial setup, this is adequate. And it does have a bypass capacitor, mounted across the ends of the potentiometer.

The black one has the unfortunate design of having the potentiometer on the "pin" side of the board so that it is inaccessible with the backpack soldered in place!

(Whoops! Got the black and blue mixed. :D)

Make sure its just not a case of the pot being "folded" over. Several boards I have came with the pot positioned over the chip but the pot leads are long enough you can carefully bend the pot over so it protrudes from under the board.

PCGuru,
I believe that paul is refering to this board.
As you can see the pot is unaccessable once the board in place.

I swapped out the pot for a round pot.
It allows the pot to still be turned since the round top
of the pot extends just beyond the edge of the board.

--- bill

I2C-LCD-mjkdz1.png

I2C-LCD-mjkdz.png

IMG_6655.JPG

That's the one.

Another approach is - if you are going to de-solder the pot anyway - put it back on the other side of the board. The polarity is not critical. XD

The black one (which has some flux goo on it which I mean to clean off) has pull-ups for the jumper positions - as on the photos above.

Hi All,
Today I received another set of LCD (serperate purchases, same supplier) and an i2c module from China and I've been very lucky and got an almost identical i2c module, so identical that it it still has the same address at 0x27 and the same contructor settings.

Here's a couple of pictures, the i2clcdguesser only took 5 tries to get it right, also note that NEGATIVE (Guess No4) turns my backlight off!! But I can still see the display, but no backlight.

Hope it helps!
Regards
Mel.

Hoi Mel,
looks good, but as we see again: again a board with some "malfunctions", here the backlight :roll_eyes:

I am still waiting for my ready-build-one 4x20 - leasts very long from that (new) supplier, nearly 4 weeks :cold_sweat:

So, should we extend the parts in the LCDguesser-Sketch to collect all new informations ?

Until now the depending part in the sketch looks like this:

i2cdata i2cparam[] = {
// EN, RW, RS, D4, D5, D6, D7, BL, POL
  { 6,  5,  4,  0,  1,  2,  3,  7, NEGATIVE }, // I2CIO board modded for backlight
  { 4,  5,  6,  0,  1,  2,  3,  7, NEGATIVE }, // MJKDZ board
  { 4,  5,  6,  0,  1,  2,  3,  7, POSITIVE }, 
  { 2,  1,  0,  4,  5,  6,  7,  3, NEGATIVE },
  { 2,  1,  0,  4,  5,  6,  7,  3, POSITIVE },

  {0xff} // end of guess table
};

Or is there an existing "database" for the different config-parameters ?

Cactusface:
Here's a couple of pictures, the i2clcdguesser only took 5 tries to get it right, also note that NEGATIVE (Guess No4) turns my backlight off!! But I can still see the display, but no backlight.

There is no issue/malfunction here.
You must understand two things:

  • The backlight circuit and control is independent of the LCD communication interface
  • The polarity parameter is to indicate what output signal level turns on the backlight
    vs what turns it off.

The polarity parameter of POSITIVE tells the library that a HIGH output signal turns on the backlight
and a LOW output signal turns off the backlght.
The polarity parameter of NEGATIVE tells the library that a LOW output signal turns on the backlight
and a HIGH output signal turns off the backlight.

If you tell the library that a NEGATIVE output signal turns on the backlight
the library will obedientaly obey and set the output signal to low when it
trys to turn on the backlight.

So if you set the parameter to NEGATIVE and the actual circuit is
wired to need a logic HIGH to turn on the backlight,
What do you think happens to the backlight when the library sets the signal to LOW
in an attempt to turn on the backlight?

--- bill

A.R.Ty:
So, should we extend the parts in the LCDguesser-Sketch to collect all new informations ?
Or is there an existing "database" for the different config-parameters ?

So far I have only seen 4 different combinations of wiring and they are all in the guess table.
If there is a new one that somebody needs to be added I will be happy to update
the table.

BTW,
the code has been updated a bit.
I updated the atttachement in the previously thread:
http://forum.arduino.cc/index.php?topic=157817.msg1235230#msg1235230
It now verifies that no more than one i2c device is on the bus and that
the one found appears to be a 8574.

--- bill

ok got it, there is a "decoupling" cap on the black adapter boards. In my diction a decoupling cap is for bus isolation, not just a filter cap.

My shield is DIY... I just added these pullups close to arduino. With the black adapter boards, I now have double pullup resistors, which is no good either. I'll get some bare PCF8574 in Dip, a rPNP and pot and solder it all to my "shield". Now that smithy documented the traces this seems to be quite easy

So far I have only seen 4 different combinations of wiring and they are all in the guess table.

SEEN, too - but at least 4 guys (inlcuding me) here has different boards which cant be get to work
But: was only a suggestion. :sleeping:

crossbreak:
My shield is DIY... I just added these pullups close to arduino. With the black adapter boards, I now have double pullup resistors, which is no good either.

The actual needed minimum pullup varies depending on the voltage, i2c clock speed, and capacitance of the circuit.
Having multiple pullups is not a problem as long as the combined pullup value does not
cause the maximum current on the bus to be exceeded.
So if you are using say 4.7k pullups or so, having 4 of them on the bus would not exceed the maximum current allowed.

--- bill

A.R.Ty:

So far I have only seen 4 different combinations of wiring and they are all in the guess table.

SEEN, too - but at least 4 guys (inlcuding me) here has different boards which cant be get to work
But: was only a suggestion. :sleeping:

So are you saying that you or some else has a backpack that the guesser is unable to show
the needed constructor?
If so, I am very interested in seeing how it is wired, because so far I have not seen
a backpack that uses a wiring not in the guess table.

In almost every case I've seen so far (and I have seen many) when there has been an i2c issue,
the user played a roll in the issue.
Many times the user has been guessing at solutions and ended up trying
multiple libraries in a "trial and error" fashion.
In many cases the library "guessing" is from a result of getting poor
"try this library and see if it works" advice from other forum members.
In some cases the user ends up stumbling across a library that happens
to be hardcoded to the wiring used on his i2c backpack.
Then when he reports the "magic" library that works back to the forum,
I go off and verify the pin wiring that is hard coded in the library that they used
and so far the pinout has always been one that I have already put into the guess table.


Part of what creates a frustration for the user with respect to these i2c bapackpacks
that use the PCF8574 is that there is no single way of wiring them up to
the HD44780 interface and backlight circuit.
Many Arduino users have an expectation of "plug and play" with no required understanding of how
the hardware is wired up or how it works.
For these backpacks, this is not the case and the user must either get a library
that is hardcoded to match his backpack or fill in a constructor into fm's library
with bit numbers for which he may not have the information.

This is the reason I wrote the guesser sketch. To try an help out those
less technical users get the backpack up and running using fm's library.

If you have or know of a backpack or can point to a thread where you know that
the constructor was not reported by the guesser sketch, please show me and I'll
work with the person to get their backpack working and update
the guesser to include that pin wiring - if it ends up being one not
already in the table.

--- bill

Hoi,
yes, i have one of these "miracles":

Funny, because i bought a second one from the same vendor, and it looks absolut similar - but dont get it work.
Its not damaged, 'cause the seller tested it before.
So, one works - one not.

What do you mean by "not working"?
Is that a photo of your actual board?
What does the latest guesser sketch report on the "non working" one?
(make sure to run the latest one, as I've updated it recently)

--- bill

Yes, actual photo and actual guesser script.

i2cLCDguesser - Guesses i2c constructor for i2c LCD backpack
----------------------------------------------------------------
NOTE/WARNING: Guessing the i2c constructor is not really a
good thing since it could damage the hardware. Use with caution!
Do not leave things with an incorrect guess for too long.
i.e. advance to the next guess as soon as possible.
when the guess in incorrect.
If the guess is correct, the constructor will show up
on the LCD.
----------------------------------------------------------------

<Press a Key to Continue>
Scanning i2c addresses for pcf8574 chip...
i2c device found at address 0x27
Trying: lcd(0x27, 6, 5, 4, 0, 1, 2, 3, 7, NEGATIVE)
<Press a Key to Continue>
Trying: lcd(0x27, 6, 5, 4, 0, 1, 2, 3, 7, POSITIVE)
<Press a Key to Continue>
Trying: lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE)
<Press a Key to Continue>
Trying: lcd(0x27, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE)
<Press a Key to Continue>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE)
<Press a Key to Continue>
Trying: lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE)
<Press a Key to Continue>
Scanning i2c addresses for pcf8574 chip...

Nothing other - nothing happend.
NOW the guesser script hangs on the second run.

Hi A.R.Ty.
That's the same as mine, I received the other day, but it works just the same as my last one, so perhaps I've been very lucky. It works with the last guess shown in your post.

Here's a couple of pictures.
Hope it helps.
Regards
Mel.