Pages: 1 [2] 3 4   Go Down
Author Topic: [SOLVED] MJKDZ brand I2C Controller working with 1602 LCD  (Read 15922 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have made it,  but I have the same error.
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 37
Posts: 2172
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you replaced the new library by the old one and installed it in the library directory of the Arduino IDE?
You will need to remove completely the old library and any other LCD library you may have, such as the LiquidCrystal_I2C.
If you are using the IDE version1.5, you will also need to move the documentation in the library somewhere else.
Logged

   

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I have replaced the new library by the old one and I installed it in the library directory of the Arduino IDE. I'm using only this one: LiquidCrystal_V1.2.1 and Arduino IDE version 1.0.
Logged

Málaga, Spain
Offline Offline
Edison Member
*
Karma: 37
Posts: 2172
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you trying to compile any of the examples that come with the library?
Logged

   

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2333
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Uhhh. Sorry guys.
fm's library that I'm working with has been slightly modified.
I corrected the misspelled "t_backlighPol" in my version of the library and didn't test
my test sketch on a stock release.  smiley-red

pulsarus,
I updated the sketch in the earlier post to allow it work no matter how
the backlight type is spelled.
Just re-download the test sketch from my previous post and it should compile now.

Sorry about that.

--- bill
Logged

Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks fm!  smiley
I've solved! ...maybe error full row square can be for reverse pinout  smiley-mr-green (chinese LCD soldered by reverse PCB)  smiley-small
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

greets

I also bought a mjkdz I2C module.



I don't know why, but the pins are not on the back side like most other I2C LCD modules I've seen.

On this one the top right pin is the GND, it goes to the VSS pin on the LCD module, right?
Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2333
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

On this one the top right pin is the GND, it goes to the VSS pin on the LCD module, right?
Incorrect.

On that mjkdz module in the photo,
pin 1 (vss) of the hd44780 interface is the upper left and pin 16 (kathode) is on the upper right.
If you look closely you can see the trace from the pot wiper running over to pin 3 (Vo, contrast in)
over twards the upper left in your photo and you can see the trace from the 2TY transistor going
over to pin 15 (Anode) in the upper right.
This orientation means that when you solder the board to most hd44780 modules the side facing up
in your photo will be down. i.e. the pot will be up against the lcd module.
(See attached photo)

While that orientation is nice to have access to the address jumpers (A B C )
(which are on the back side of the board in the photo)
since they will be facing out, once soldered you will not be able to adjust the
contrast pot.


I have a couple of these.
My recommendation if soldering these directly to the lcd,
is to either change out the pot for one with a thumb wheel,
or a side screw access or unsolder the pot and move it to the other
side of the board. That way when the board is soldered directly to the lcd,
you will still have the ability to adjust the pot.
Depending on your lcd, you may
also want/need to re-solder the i2c header to the other side of the pcb as well since in
its current location it can end up touching the lcd module making it difficult
to connect to the i2c connector/wires.

Alternatively, you could desolder the 16 pin header and flip it around. Then
the pcf8574, pot, and i2c header will be on top. The down side to that is that
you will not be able to get to the address solder jumpers to change the i2c address.


--- bill


* mjkdz.png (200.21 KB, 547x295 - viewed 224 times.)
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks!

ye, the Cathode and VSS are both ground, that's what confused me.

I found some pin-out pictures:





source: http://www.instructables.com/id/How-to-drive-a-character-LCD-displays-using-DIP-sw/?ALLSTEPS


Quote
My recommendation if soldering these directly to the lcd,
is to either change out the pot for one with a thumb wheel,
or a side screw access or unsolder the pot and move it to the other
side of the board.

I soldered some female pins to the LCD module, this way I can remove the I2C module anytime I need to.
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

another question came up:

do I need to insert a resistor between 5V and the back light anode (pin 15)?

The I2C and the LCD modules have some smd resistors on them but since I don't have the schematics I can't tell if any of them is there to limit the current to the back light leds.

---

:solved, there is a 100ohm resistors connected to the anode pin.
« Last Edit: June 02, 2013, 10:15:30 am by naut » Logged

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2333
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

another question came up:

do I need to insert a resistor between 5V and the back light anode (pin 15)?

The I2C and the LCD modules have some smd resistors on them but since I don't have the schematics I can't tell if any of them is there to limit the current to the back light leds.

---

:solved, there is a 100ohm resistors connected to the anode pin.
Not clear what you mean by this.
Did you mean your particular LCD has a built in 100 ohm resistor on its module?
The MJKDZ board has no current limiting resistor for the backlight.

The mjkdz board has a 2TY PNP transistor.
If you look at the board, you will see that pin 12 of the pcf8574 (P7)  is connected
to a part labeled "102" that is a 1k resistor.
That resistor then drops down vertically and connects over to the base of the PNP transistor.
The Emitter is directly connected to hd44780 pin 15 which is the backlight Anode.

There is no current limiting for the backlight being done on the mjkdz board.

Attached is additional information about the mjkdz board and how to use it with fm's library.

--- bill

* LCD-I2C-MJKDZ.zip (299.2 KB - downloaded 105 times.)
« Last Edit: June 02, 2013, 12:42:56 pm by bperrybap » Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Did you mean your particular LCD has a built in 100 ohm resistor on its module?

yep.

I also measured the voltage output of the I2C module (pins 15 and 16), equals 4.7V.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

pulsarus,
If you are out of ideas, and are unable to determine the pin wiring of your i2c chip to the hd44780 interface,
attached is a sketch I wrote that will try to figure it all out by guessing.
It will locate the i2c chip's address then try several of the most common configurations.
I will say that while I've not seen any damage occur using incorrect configurations, it is possible
that using an incorrect configuration could damage the hardware.

It uses the serial port along with the serial monitor in the IDE to
control the "guessing".
See the comments in the sketch for how set things up and how to use it.

Give it a try and let me know if it detects the proper constructor for you.


fm,
I'm working on some updates for the library that are not quite finished yet.
This sketch is one of the updates.

--- bill


Many thanks Bill, this has proven to be extremely useful!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow...thank you very much GordonShumway. All works fine!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have been banging my head against the same problems as others here initially encountered (ie flashing backlight and gibberish on screen), unfortunately it is impossible for me to move on to the next step because of the following error.

HelloWorld_i2c:12: error: 'NEGATIVE' was not declared in this scope

and HelloWorld_i2c:12: error: 'POSITIVE' was not declared in this scope

I know the address is correct, but I'm not sure if the other pins are, though the default doesn't work either. I don't know what the problem is. the Here's my code.

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity
 
void setup()
{
    lcd.begin(16,2);
    lcd.backlight();
    lcd.setCursor(0, 0);
    lcd.print("Hello world!");
    lcd.setCursor(0, 1);
    lcd.print("Row number: ");
    lcd.setCursor(12, 1);
    lcd.print("2");
}
void loop()
{
 
}

P.S. Here's my LCD and i2c modules:

https://www.sparkfun.com/products/255
http://www.ebay.com.au/itm/300922342381?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
Logged

Pages: 1 [2] 3 4   Go Up
Jump to: