Our project group has been having trouble with accessing the full 40x4 LCD. The standard library for LCD I2C is designed for 16x4. We have tried to modify the library with some help but are uncertain. It's important that we don't send conflicting signals to the input buses as we have already damaged a LCD that way. The edited .cpp and .h files are attached. Thank you very much!
(Sorry, this is my first post in the forum, not sure how to ask properly)
Our project group has been having trouble with accessing the full 40x4 LCD. The standard library for LCD I2C is designed for 16x4. We have tried to modify the library with some help but are uncertain. It's important that we don't send conflicting signals to the input buses as we have already damaged a LCD that way. The edited .cpp and .h files are attached. Thank you very much!
(Sorry, this is my first post in the forum, not sure how to ask properly)
Instead of modifying / building a new class why don't you modify original begin(rows. columns) method only to return a value to make sure that works? ( Unless your assignment was to build a new class).
begin(40,4) should work.
Just for test purposes I would try begin(16,4) or begin(20,4) - they both work in my setup.
You can put more than 40 characters on one line using single print, they will overflow to next line.
( At least that is the way it works on 20x4 LCD ).
And for my record only - how did you determine you have damaged the LCD by wrong code to input (whose input LCD ?) buses.
Highly unlikely.
Are you sure your I2C interface has pull-ups?
I would suggest to check your contrast setting. Just power the LCD without any code to do that. You should see lines of 5x7 "characters" then.
nicoverduin:
Maybe they used the Arduino 5V as power supply. No way that can produce enough juice for the LCD
FYI
I run my 20x4 directly from Due +5V.
But I do not have a spec for 40X4. At best it MAY need twice of current at full display and the regulator will shut down instead of getting smoked anyway. I believe the backlight LED takes more current then the actual display, but did not measure it and at this point don't need to.
However, he said they "damaged" it by code.
Actually the LCD and the backlight are controlled separately, on I2C, and at this point we do not know what got "damaged".
It is indeed the backlight that consumes most of the juice. I use the 20x4 on the Arduino on the 5V directly. But it barely manages. Probably because my USB is not delivering more. Point I am trying to make is that I (like yourself) find it questionable that an LCD breaks down. My gut feeling is that their backlight is not getting enough juice and is not defective at all. But I agree with you. Let's wait and see their feedback.
Looking at a couple of sites indicate that a 40x4 LCD is really two 40x2 displays, that is they have two controllers and two enable pins.
Knowing for sure the model of LCD and backpack being used would be helpful, e.g. does the backpack support two enable pins, or would that need to be done by the arduino itself.
nicoverduin:
Hi
Welcome and for starters, which LCD are you using? link?
Regards
Nico
Hi, it's the NHD-0440WH-ATFH-JT#
Vaclav:
Instead of modifying / building a new class why don't you modify original begin(rows. columns) method only to return a value to make sure that works? ( Unless your assignment was to build a new class).
begin(40,4) should work.
Just for test purposes I would try begin(16,4) or begin(20,4) - they both work in my setup.
You can put more than 40 characters on one line using single print, they will overflow to next line.
( At least that is the way it works on 20x4 LCD ).
And for my record only - how did you determine you have damaged the LCD by wrong code to input (whose input LCD ?) buses.
Highly unlikely.
Are you sure your I2C interface has pull-ups?
I would suggest to check your contrast setting. Just power the LCD without any code to do that. You should see lines of 5x7 "characters" then.
Hi, we cannot simply do that b/c this LCD has 2 drivers and the 2 sets of rows are to be accessed separately and they are assigned the same addresses(see data sheet.) It's not definite that the conflicting signals were the only cause of damage.
I do not think there's anything wrong with the voltage or current supplied. it seems to be a software problem.
We just tested our library and it works the way it is!!!!!
Thank you very much!
Nice, but...
Since this was your first post you are probably not aware that some of us participate here to learn.
Unfortunately it is common to "fix the problem" and not sharing WHAT exactly was the problem FOR FUTURE reference.
In theory / essence it SHOULD work this way - the group spent their time helping you , so you COULD spent your time telling the group what was wrong.
In general, it is called "provide feedback" and is appreciated.
At this point we can just guess you just forgot to connect the ground! ( Sarcasm!)
Vaclav:
Nice, but...
Since this was your first post you are probably not aware that some of us participate here to learn.
Unfortunately it is common to "fix the problem" and not sharing WHAT exactly was the problem FOR FUTURE reference.
In theory / essence it SHOULD work this way - the group spent their time helping you , so you COULD spent your time telling the group what was wrong.
In general, it is called "provide feedback" and is appreciated.
At this point we can just guess you just forgot to connect the ground! ( Sarcasm!)
Cheers
Oh sorry about that. We are on a very tight schedule and I wasn't aware.
Basically the edited libraries that are uploaded were done properly (with help of our TA, we cannot not claim full credit):
defined 2 enables instead of 1 in the .h file
in the setCursor function, take out the latter 2 addresses for row_offsets; this is due to the addresses assigned by the LCD manufacturer (both sets of lines begin with 0x00 and 0x40, just select different lcd in your code)
in the pulseEnable function, set an else if to account for 2 enables
add a function for passing the selected lcd from the code to the library.
lastly, change the file names to Liquid_Crystal_I2C b/c we didn't change the names in the files and they use those names. I believe that's all. We have not had previous experience with C++ so please pardon the incorrect term usage. Please provide feedback if my explanation doesn't suffice! Thank you!
Thanks,
so basically you have two LCD's on the I2C bus, cool.
I hope your TA grades you on "paperwork" also, I recommend A+ for extra nice effort.
Cheers
Can anyone help me to wiring this project?
Explain it or any idea?
I had try it so many times, but there is nothing on my 40x4 lcd.
My Arduino version is 1.6.6.
Best regards & thanks a lot for any answer
HOORMAN:
Can anyone help me to wiring this project?
Explain it or any idea?
I had try it so many times, but there is nothing on my 40x4 lcd.
Nothing? You did not even get 2 lines of the LCD working?
Typically a HD44780 display controller can drive up to 80 characters on an LCD, so maximum is a 4x20 or 2x40 display.
If a display is for more than 80 characters, it might have two HD44780 drivers that need to be driven by your Arduino hardware. If it is a I2C display, you should have two devices on the I2C bus.
Is it a I2C display? Or a display for 4-bit parallel mode? Which?
Do you have a Link to the data sheed? Link to the manual?
reiaya:
The standard library for LCD I2C is designed for 16x4.
Hello,
I know I am replying to a very old topic, and probably no one will see this, but I'll try my luck.
My dear friend,
Unfortunately there is no such thing called "Standart library or LDC I2C" in my experience. There are at least 3 totally different libraries that are called "LiquidCrystal_I2C" that I know of. So, unless you specify which library you edited (ie github link etc.) your post will be of no use for a lot of people, except for the ones that have the correct library installed by chance. If you see this, please do post the library link and include a sample code for those of us that are new to Arduino coding.
I am not sure if this thread is still being monitored but I was wondering if this works with a TM404A LCD Display.
It has 2 rows of 8 pinouts (16 total )