Pages: 1 2 [3] 4   Go Down
Author Topic: [SOLVED] MJKDZ brand I2C Controller working with 1602 LCD  (Read 24031 times)
0 Members and 2 Guests are viewing this topic.
Málaga, Spain
Offline Offline
Edison Member
*
Karma: 41
Posts: 2182
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have any traces of other i2c LCD libraries or I2C lcd libraries in your environment other than this one?
Logged

   

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

No. not that I'm aware of. I'm on a Mac and I tracked down LiquidCrystal and LiquidCrystalFast libraries and zipped them up and deleted the directories. I then restarted the Arduino IDE. It's very frustrating not knowing if there is something else interfering.

Is there any way to actually see what files are being included when you try to build? If there is something that is interfering, I haven't found it.

For what it's worth here is a list of all the libraries I have available. If any of them could be the problem then let me know and I will zip them up.

Code:
hackintosh:~ michal$ cd /Users/michal/Applications/Arduino.app/Contents/Resources/Java/libraries
hackintosh:libraries michal$ ls -1
AccelStepper
AltSoftSerial
Bounce
CapacitiveSensor
DS1307RTC
DmxSimple
DogLcd
EEPROM
Encoder
Entropy
Esplora
Ethernet
FastSPI_LED
Firmata
FlexiTimer2
FreqCount
FreqMeasure
FrequencyTimer2
GSM
IRremote
Keypad
LedControl
LedDisplay
LiquidCrystal.zip
LiquidCrystalFast.zip
LowPower
MIDI
Metro
MsTimer2
NewSoftSerial
OSC
OctoWS2811
OneWire
PS2Keyboard
PWMServo
Ping
Robot_Control
Robot_Motor
SD
SPI
ST7565
Servo
ShiftPWM
SoftPWM
SoftwareSerial
Stepper
TFT
Time
TimeAlarms
TimerOne
TimerThree
TinyGPS
Tlc5940
VirtualWire
WiFi
Wire
XBee
ks0108
x10
hackintosh:libraries michal$ cd ~/Documents/Arduino/libraries/
hackintosh:libraries michal$ ls -1
EmonLib
EmonLibPro
NewLiquidCrystal
NewPing
RF24
SevSeg
i2c_t3
jeelib
rbuf
readme.txt
hackintosh:libraries michal$

Or perhaps this is more definitive?

Code:
hackintosh:libraries michal$ cd /Users/michal/Applications/Arduino.app/Contents/Resources/Java/libraries
hackintosh:libraries michal$ find . -iname LiquidCrystal_I2C*
hackintosh:libraries michal$ cd ~/Documents/Arduino/libraries/
hackintosh:libraries michal$ find . -iname LiquidCrystal_I2C*
./NewLiquidCrystal/LiquidCrystal_I2C.cpp
./NewLiquidCrystal/LiquidCrystal_I2C.h
hackintosh:libraries michal$
« Last Edit: July 25, 2013, 05:42:17 am by mihalski » Logged

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

In you code, include "LCD.h"

That is where it is defined but it should be included in the sub-classes.
Logged

   

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

I assumed it was being included and I had tried it previously, and again now with the same result.

And I tried both:

#include <LCD.h"

and

#include "LCD.h"

I find this baffling :/
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2766
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

(This latest discussion really should be a new thread as
it is an issue unrelated to the original post)

A quick response  though.
My suspicion is that you have some other library that is being included.

To tell for sure,  turn on the verbose output in the IDE:
[File]->[Preferences]
Then check the "Show verbose output during compilation".
You can then look at the compiler command line include paths included on the -I options
and see where the header files are coming from.

--- bill
Logged

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

In hindsight I think you're right Bill. Not only that but it's marked as [SOLVED]. Next time I'll start a new topic if I have a problem.

I followed your suggestion but it has just made it all the more mysterious since there appears to be nothing wrong :/

Code:
/Users/michal/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -I/Users/michal/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Users/michal/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/standard -I/Users/michal/Documents/Arduino/libraries/NewLiquidCrystal -I/Users/michal/Applications/Arduino.app/Contents/Resources/Java/libraries/Wire /var/folders/vw/z8j2vz3j4r7376s46r6zs_3c0000gn/T/build5384796287676286130.tmp/HelloWorld_i2c.cpp -o /var/folders/vw/z8j2vz3j4r7376s46r6zs_3c0000gn/T/build5384796287676286130.tmp/HelloWorld_i2c.cpp.o
HelloWorld_i2c:6: error: 'NEGATIVE' was not declared in this scope

It looks this way whether or not I include LCD.h
Logged

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

Can you see the examples in the arduino IDE?
What version of the IDE are you using?
If it is version 1.0.5, move the documentation directory else where and reload the IDE.
Logged

   

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

Yes, I can see the examples and I am using Arduino IDE version 1.0.5. Are you referring to the NewLiquidCrystal library docs directory? I tried moving that to the Desktop and restarting the IDE, but I still get the same error.

The NewLiquidCrystal examples remain.

EDIT: For what it's worth, in the comments section of this page it seems that people had a similar problem, though I don't know which libraries are linked. But that's the only place on the internet I've found anyone with a similar problem as I have :/

http://magnusglad.wordpress.com/2013/03/16/arduino-lcd/
« Last Edit: July 25, 2013, 06:41:57 pm by mihalski » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2766
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

mihalski,
Please start a new thread, this cluttering up the thread.
I have an idea as to what is going on and I'll answer in the new thread.
--- bill
Logged

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

mihalski,
Please start a new thread, this cluttering up the thread.
I have an idea as to what is going on and I'll answer in the new thread.
--- bill


Done. New thread at http://forum.arduino.cc/index.php?topic=179411.0
Logged

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

Hello

I have this MJKDZ i2c adapter and a 1602 LCD. I've tried everything you stated in this tutorial and I'v tried pretty much everything I could find on google...
Unfortunately my LCD is stubborn and the best result I've had so far is lighting up the backlight and getting the rectangles to blink in the first line..

Could you guys give me some help please?

Grettings from Portugal

PS here is a picture of what I've accomplished so far..

http://postimg.org/image/jt2vk3gbp/
Logged

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

First of all this post has been marked as SOLVED and should be used to continue with the thread. Second, the backpack is connected back to front. It shouldn't be a big deal as if you flick it round the pins should be aligned and be the same.

You must check what is the pin out of the backpack and then open a new thread explaining what library you are using, a datasheet of the backpack or where you got it, how have you connected it...
Logged

   

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2766
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with fm, that new posts with additional requests for help shouldn't be posted
to a a "SOLVED" thread since they are essentially hijacking the thread.
However, in this case there is something of value to learn for all those that read this
thread from the photo in Aero2011's post.

There are 4 ways a lcd backpack can be connected/soldered to the hd44780 pins
and two of them result in all the pins being connected backwards.

If you look at the previous responses in this thread:
#21 and then my response #22 right below it.
There is some question as to how the backpack board is to be hooked up to a LCD.
http://forum.arduino.cc/index.php?topic=157817.msg1260780#msg1260780

There are several different PCB layouts for boards call calling themselves
"mjkdz" and the component layout and wiring to the hd44780 interface are
different.

So far while there are different layouts, all the mjdkz boards I've seen
use a similar component placement as shown in response #21 and #22
which means the board has to be attached to the LCD with the 4 pin connector closer
to the center of the LCD not facing out along the edge and the backpack chips facing away from
the LCD module.
And the pot will is on the same side of the backpack as pin 1 on the LCD.

The best way to ensure proper orientation of the backpack
rather than just guess - (Guessing is ALWAYS bad)  is to check
a known signal for location.
A simple signal to trace down is the contrast input signal.
The center connection of the pot will connect to pin 3 of the hd44780 interface.

If you look at Aero2011's  photo, you can see pin 1 on the LCD.
It is on the left of the LCD or the side closest to the edge of the LCD module.
Pin 1 on a hd44780 interface is gnd for the controller.
Pin 16 is gnd for the backlight and is in the center of the lcd module.

If you look at Aero2011's photo, while it is blurry, it appears that the center
pot connection is connected to  LCD pin 14 or 13 (it's probably pin 14)
rather than pin 3.

This backpack appears to to have been soldered on backwards. (upside down)
again, see my response to #21 for the details on the mjkdz boards I've seen:
http://forum.arduino.cc/index.php?topic=157817.msg1261045#msg1261045

#1 thing to remember to get the backpack mounted correctly is
to trace down where the pot center lead goes. It must connect to
pin 3 of the LCD. If it isn't, it means the backpack is backwards,
flip the backpack over an it should now connect to pin 3.

-- bill
Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3727
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The best way to ensure proper orientation of the backpack
rather than just guess - (Guessing is ALWAYS bad)  is to check
a known signal for location.

It's not a bad idea to simply look at the backpack and see which pin is labelled as pin 1.

In this case and by convention, the label consists of a square "land" on the PCB corresponding to pin 1 where all the others are circular.

I rather like this particular backpack as when properly fitted to the LCD unit, the serial header faces inward behind the LCD so that the connections (with a "Dupont" connector) are not projecting outside the LCD outline.  I can on this account see why he got it wrong as most of the pictures (on eBay) showing a backpack fitted, illustrate the other type.

You need to fold the multi-turn pot so that it points outward, flat against the backpack board and can be easily adjusted once the backpack is soldered behind the LCD - though you only ever need to do this once.
« Last Edit: September 15, 2013, 06:05:09 pm by Paul__B » Logged

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

This is perfect!  I had exactly the same problem and you just solved it for me in 5 minutes.
Logged

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