Hey guys, I found in the word wide web the following article to print text to a standard HD44780 (16x2) display via I2C with a PCF8574 chip: http://garagelab.com/profiles/blogs/tutorial-lcd-using-only-2-arduino-pins-with-pcf8574-and-i2c
I connected the circuit displayed and uploaded the example sketch, but there are a few problems.
In the attached picture you can see, that the first line is filled with black boxes. I'm confusing why only the first line is filled with them.
I'm not able to print text on the display.
Are there any ideas?!
PS:
I found a similiar thread in this forum, but the solution wasn't "helpful" for me.
So either the tutorial is wrong, or you have wired it up wrong or your LCD or I2C device is broken
I am not sure what other answer you expect given the ammount of detail you have given us.
Have you got the pull up resistors fittel on the I2C lines?
Check the data lines are in the right order.
What do you see on a scope at the LCD's input pins?
As to only the first 16 showing up, that is normal when it is working because the two lines do not occupy contiguous memory locations.
I have had this when writing my own code for the display.
It is probably wrong initialization.
Sometimes the LCD is in a certain state. The initialization code should try the get the LCD out of that state. The Arduino LiquidCrystal library does that.
If your code is not doing that, you can try to power down, and then power up and run your sketch. After power up the LCD is in a default state.
Some days ago a spend some time with PCF8574.I bought some small board to atached directly in the back of the LCD.When I seend the code it wont show the text.
Debuging the problem I discover that the pins are changed on the chinese board!!
There are in fact 2 versions on the web and just one works with the chinese boards, because perhaps they had change the pins to the pcb could be more simple to design.
They change some control lines. ]
Using that library works.
If you look inside the original Library HD44780 I2C the original autor left there some instrutions about the wirings.
See if they match to your design
If your wiring is correct, it is possible that you might have the contrast set too high. Back down the variable resistor until you see characters.
The single line of black boxes signifies an LCD controller that is not properly initialized to match the display that is connected to that controller. No amount of adjustment of the contrast will cure this problem.
As to only the first 16 showing up, that is normal when it is working because the two lines do not occupy contiguous memory locations.
That would be applicable if the first line contained characters. It is not likely to be the problem here.
The problem could very well be as simple as an improper I2C address.
Are you sure you are using a PCF8574 and not an PCF8574A?
Also - did you add the required pull-up resistors mentioned by Mike in reply #1 and in the first 'comment' on that garagelab page?
floresta:
Are you sure you are using a PCF8574 and not an PCF8574A?
I looked it up and recognized that the I2C Port Expander is a PCF8574AP. Are the differences so big? That might be the solution !(?)
I think i have to check the datasheet! Or can anyone imagine what i have to change in my wiring circiut
HugoPT:
There are in fact 2 versions on the web and just one works with the chinese boards, because perhaps they had change the pins to the pcb could be more simple to design.
They change some control lines. ]
I don't know if my display is an chinese board, bought it via amazon. Isn't everything made in China XD
Grumpy_Mike:
What do you see on a scope at the LCD's input pins?
Sadly, I don't have an oscilloscope.
And about the pull-up resistors: Nope, there aren't circuited, yet. But I will try it now!
Greetings from Germany 8)
Mike
Edit:
Can't figure out what's the difference between PCF5874AP, A, AT or others...
The pull-up resistors weren't the solution, same state: Black boxes, no text.
I think, slowly I'm getting crazy ^^
And about the pull-up resistors: Nope, there aren't circuited, yet. But I will try it now!
They are not optional but they usually are not included on the pc board because you don't want more than one set connected. In other words no matter how many I2C devices you have connected you
only want one set of pull-up resistors. If they were mounted on the pc board and you connected two devices you would have two sets of resistors.
The pull-up resistors weren't the solution, same state:
Yes. Not working because of the lack of pull-up resistors looks the same as not working because of the wrong I2C address. BUT it also looks the same as not working because of both problems at the same time. In other words if you have two problems and you fix one of them it still won't work.
Can't figure out what's the difference between PCF5874AP, A, AT
The P and the T designate the package (I think).
The regular 5874 has an address range of 0x20 - 0x27.
The A version is identical to the non-A version except that the address range is 0x38 - 0x3F.
The board may or may not have jumpers to vary the address within the above ranges.
Your best bet might be to set up an I2C scanner sketch (Arduino Playground - HomePage) and find out what address your device has.
(1) The data sheet is wrong.
(2) The part is labeled incorrectly.
(3) The part is counterfeit.
(4) You misread the part number.
(5) Something is wrong with the implementation of the I2C scanner sketch.
What is the logic state of A0 A1 and A2 in your circuit?
That's is really irrelevant here*. It is the upper 4 (out of 7) bits, the ones that are determined by the silicon, that are at issue here (as far as I am concerned).
In other words an address of 2x vs 3x.
Don
In terms of your I2C scanner results for a device with an 'A' suffix.
Well you hijacked the original thread. The original poster got his device working so now you should go back and reread the entire thread and see if you can get your device to work by following all the advice we gave him.