Go Down

Topic: SOLVED: How to wire an mjkdz I2C board to a 20 x 4 LCD (Read 24 times) previous topic - next topic

tack

As far as the LCD spin out goes, I only put that there as I've not used a 20x4 display so wasn't 100% sure they were all identical. I'd guessed they were as the backpacks work on those two, but safer to have the OP make sure. ;-)

Hopefully he'll report back if it's worked for him. I know some people can get tremely frustrated when things don't work and get the 'it's no good, I'm fed up, it's rubbish' red mist. I have a couple of mates with low patience levels like that. :P

farkuino

Thank you to everyone for your suggestions.

I have been celebrating my birthday early :smiley-mr-green: , but will try them out tomorrow and report. 

I was looking at the photo and it seemed that the pins just lined up, but when I did that (using both an old floppy cable, and standard jumper wires), I got no backlight when I applied power to the arduino.  I assumed that the pot would be a single turn jobber, not a 22 turn.....I gave it a 60 degree twist left and right (because that's all it took on the ones I bought from my local chip shop), and got nothing.

And I saw the other posts about changing the constructor, and asked wtf they would do that and not just keep one standard way of doing it.  But that would take all the fun out of it, right?

And yes, sometimes I get that "it's no good, eff it, and chuck it into my toy box" attitude.  But before I do that, I check with the experts.

I finally got an answer back from the seller.  They sent me the docs.  Too bad I don't speak Chinese.... :smiley-eek:  They promised to send me the English ones asap.  I'm betting that I will have it running long before then.

Again, thanks to all, and I will report back.


bperrybap


And I saw the other posts about changing the constructor, and asked wtf they would do that and not just keep one standard way of doing it. 


For this type of board there is no standard.
The standard interfaces are i2c and hd44780. What is in the middle on the PCB
to connect between the two is left up to the implementor and could be done
in many different ways.

I'm curious what is in the docs they sent you.

But you really won't need it.
It should be possible to figure out everything other than the i2c address
from carefully looking at the PCB.
It uses a PCF8574 which you can tell because it has 16 pins.
The MCP23008 (another popular i2c chip used has 18 or 20 pins depending on package)
The 8574 has a known pinout.
The PCB connects to a hd44780 LCD 16 pin interface. Also a known pinout.
You can find datasheets for the pin definitions of each of those interfaces.
The PCB is a simple two layer board which allows seeing nearly all the traces
(There may be some that dip under the PCF8574).
Usually you can see enough of the traces to figure which
pins on the PCF8574 are hooked up to which LCD pins.
If you can't, sometimes you may have to use an ohm meter to test continuity.
From that you can tell which PCF8574 output port bits are attached to the various LCD pins.

Its a good exercise into learning how to read datasheets
and examining hardware to get a true understanding of
how the board is wired up and works.

When using low cost hardware, which often comes with little to no
support or documentation, this kind of exercise is often necessary.

No better time to jump in feet first....

Here is a link to a PCF8574 datasheet:
http://www.nxp.com/documents/data_sheet/PCF8574.pdf
The pinout you are looking for is on page 5.
You need to figure out what P0 to P7 are hooked to.
That is PCF8574 pins 4,5,6,7,9,10,11,12
Those are the output port bits. How they are connected
to the hd44780 pins determines what goes in the constructor.
If P0 is connected to LCD D4 then 0 is the bit number for D4 in the
constructor.
The constructor uses output port bit numbers not PCF8574 pin numbers.
P0 is 0, P1 is 1, etc...

--- bill

farkuino


As far as the LCD spin out goes, I only put that there as I've not used a 20x4 display so wasn't 100% sure they were all identical. I'd guessed they were as the backpacks work on those two, but safer to have the OP make sure. ;-)

Hopefully he'll report back if it's worked for him. I know some people can get tremely frustrated when things don't work and get the 'it's no good, I'm fed up, it's rubbish' red mist. I have a couple of mates with low patience levels like that. :P


OMG (as the kids would say)!

I wanted to do things by the book (i have seen many posts about non-soldered LCDs, wink wink), so I ran the I2C scanner.

x20, and not x27! 

I wire it up using my old floppy cable, and the frickin' backlight comes on! 

I download the new I2C files and copy it to my library, copy tack's code, and  :smiley-eek:

tack wanted to make sure I knew how to fix code......ahahahahaha.  A few ; here and there and it was ready to upload.

Mama Pajama!  I could see some stirring in the LCD, so I gave the pot a few twists, and MONEY!  We have a working mjkdz LCD I2C backpack!

I am now troubleshooting the fact that my "R" in "FORUM" looks like this:

****
*
*
****
* * 
*  *
*

instead of this:


****
*    *
*    *
****
* *
*  *
*   *


I will mark it solved, since I can see clearly now the LCD.

Again, many thanks to all of your for your tips, expertise, and encouragement.

tack

Glad it's sorted, but the character issue does seem odd and not right.

I think there were three missing ; for you. Had to make you do a little work to get the satisfaction....;-)

Go Up