Hello David-2018,
The voltage on the NANO pins, between VIN to GND was 4.4V and 4.8V on the pins between 5V to GND.
BillRT
Hello David-2018,
The voltage on the NANO pins, between VIN to GND was 4.4V and 4.8V on the pins between 5V to GND.
BillRT
Hello David_2018,
The voltage is 4.4V (VIN pin) or 4.8V(5V pin).
The top line is ATMEL.
Below that is MEGA 328P.
Below that is U-TH.
Below that is 35473D.
Below that is 2204T3W.
BillRT
I simulated your code in Wokwi and as expected it doesn't accept the way you define lcd (as if it's parallel instead of I2C), otherwise it works perfect.
From experience I know that you shouldn't have any problem with the display but...
There is a difference between the LCD connections with the UNO and the Nano, the cables.
On the UNO you use M/F cables and on the Nano you use F/F.
Are the terminals in good condition?
Do they make good contact?
I ask because the cables I have, particularly the F/F ones, are not of the best quality and after a couple of uses they no longer fit well and start to cause problems.
Hello MaximaEsfuerzo,
I tried a second cable. It worked just like the first one-gibberish.
I tried a third cable - gibberish just like the first and second ones.
The third cable was brand new, never used before.
I used âBlinkâ and it worked OK so I think the connections might be OK.
Thanks,
BillRT
That is not a given particularly with the newLiquidCrystal library.
The newLiquidCrystal library does some internal delays that are board/core and CPU frequency specific.
These internal delays don't use the Arduino APIs and the code does some tricky things "knowing" how long certain Arduino calls take to try to utilize that timing as part of the instruction delay timing.
It's been quite a while since I have looked at the code so I don't know off the top of my head if there is an issue between these two boards with the timing.
The hd44780 library sticks to the most portable way of doing things using nothing but Arduino API functions so it can work on all platforms and boards.
--- bill
Guys,
@billrt is using newLiquidCrytal LiquidCrystal_I2C i/o class.
He is NOT using the LiquidCrystal_I2C library.
The two libraries are VERY different and work differently.
Several of you keep making suggestions and even doing simulations using the LiquidCrystal_I2C library and that is not what @billrt is using so it doesn't apply.
See my comments about the libraries in post #14
Again, my suggestion is to switch to the hd44780 library and you get a library that is maintained (neither newLiquidCrystal nor LiquidCrystal_I2C are being maintained)
hd44780 has several additional capabilities and includes a diagnostic sketch which will test the i2c signals, and the LCD internals as well.
--- bill
Which cable are you referring to, the USB cable or the jumper cables to the display? The jumper cables to the display are the ones in question, and there are more than three of those.
The Nano and UNO should both be running at 16MHz, and both use an atmega328, is the compiler going to be generating different code under those conditions? I realize the bootloader is different, and the crystal/resonator may vary a bit between boards, but if serial communications is working to upload the sketch then the frequency can't be off by too much.
LiquidCrystal_I2C library is very different from the LIquidCrystal_I2C i/o class in the newLiquidCrystal library.
@billrt has shown that he is using the newLiquidCrystal library not LiquidCrystal_I2C library.
The newLiquidCrystal library code was written more than 10 years ago.
I worked on it quite a bit back then and authored several of the i/o classes so I am very familiar with it.
A potential issue is the way the newLiquidCrystal code handles timing.
It makes assumptions about the overhead in certain cores/platforms and subtracts that from the needed delays to the instruction and signal timing.
What it does varies depending on the i/o class and processor.
I haven't looked to see if this timing stuff is an issue for Nano vs UNO.
This is why I said it is a "potential" issue.
Again, my suggestion is to install and use the hd44780 library as it is a maintained library and also includes a diagnostic sketch that can test things for various issues.
It is very little effort to install and the diagnostic tool, I2CexpDiag, could quickly offer some answers.
--- bill
Why do you insist with NewLiquidCrystal if the PO doesn't use it?
And if I'm wrong, please indicate in the code of which post uses it, because I can't find it.
I only see this
// Include NewLiquidCrystal Library for I2C
#include <LiquidCrystal_I2C.h>
The original code the OP posted does use the NewLiquidCrystal library, and is one of many that has the file LiquidCrystal_I2C.h, which leads to great confusion over the declaration of the lcd and the begin statement requiring different arguments.
Ok, I don't know if the library that the OP has installed is the one from the repository or one installed "by hand" but it seems that you are sure which one is installed.
However, it should work on Nano just as well as on UNO.
Getting the correct library for a sketch that includes LiquidCrystal_I2C.h is usually a guessing game based on the way the lcd is declared and the arguments to begin(). I've got three or four different libraries on this computer, and still have to go looking for another occasionally in order to get a sketch to compile. I have resorted to adding an empty file, such as LiquidCrystal_I2C_begin_null.h, to a library so I can get the compiler to choose the specific one that I need (in this case, one that uses no arguments to begin() ).
One of the great things about the hd44780 library, other than it works so well, is that the name is unique.
You are not looking hard enough and clearly you are not reading my posts as I explained this multiple times.
There are multiple libraries that have a header file named "LiquidCrystal_I2C.h"
A header file name does not specify a library.
As for as the clues:
First it is in the comments.
// Include NewLiquidCrystal Library for I2C
Then it uses the newLiquidCrystal library LiquidCrystal_I2C i/o class constructor:
LiquidCrystal_I2C lcd(i2c_addr, en, rw, rs, d4, d5, d6, d7, bl, POSITIVE);
Then as I mentioned, it uses header files that only come with newLiquidCrystal
#include <FastIO.h>
#include <I2CIO.h>
#include <LCD.h>
#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidCrystal_I2C_ByVac.h>
#include <LiquidCrystal_SI2C.h>
#include <LiquidCrystal_SR.h>
#include <LiquidCrystal_SR1W.h>
#include <LiquidCrystal_SR2W.h>
#include <LiquidCrystal_SR3W.h>
#include <SI2CIO.h>
//#include <SoftI2CMaster.h>
And as I mentioned, I was involved with the newLIquidCrystal library years ago.
I was also involved with the LiquidCrystal_I2C library.
So I am VERY familiar with these libraries.
Both of these libraries were written long before the IDE library manager existed.
Things were very different back then.
And while there is now a LiquidCrystal_I2C library available in the IDE library manager, it is no longer maintained. It has some issues and they are likely never going to be fixed given what happened with the github repository involving John Rickman.
Also keep in mind that there are multiple "LiquidCrystal_I2C" libraries floating around out there. So while one is in the IDE library manager there are others out there. This is in additional to the NewLiquidCrystal library.
All of these library have a "LiquidCrystal_I2C.h" header file.
I wrote the hd44780 library to create a easy to install and easy to use library.
For LCDs with i2c backpacks, it can offer a plug and play capability that is not offered by any other library.
It also includes a diagnostic tool to help diagnose any issues, should it not "just work".
--- bill
Ok, and you don't understand me.
What I am asking is how do you know that the OP has the library installed that you suppose if, just as you say (and you are right), there are several.
Based on the header, you assume that it uses a library (probably used by the person who wrote the code used by the PO) and based on the header, I say that it is not correct how it initializes it.
In any case, we are both wrong because we are based on assumptions and we do not ask the PO exactly which library is installed.
I explain?
Regards
Hello bperrybap,
I tool a long time because I didnât understood your email and I still donât get it because I donât have enough knowledge.
I do understand that different libraries work differently. I had tried over five different libraries but none work with the NANO.
I used the newLiquidCrystal library because it was from the DroneBot Workshop video from YouTube. As I said, it worked OK with the UNO board but not with the NANO board.
I tried as many LiquidCrystal_IC libraries from the Arduino - Manage Libraries, and as many I could find in GitHub. Most didnât work for the DroneBot Workshop code even for the UNO board.
Unfortunately, I donât know what pin mapping means. I went to the internet but I couldnât figure it out.
The cables might be a problem but three different cables produced the same results. The three cables were less than one foot. My guess tis hat the cables were OK.
I had tried the hd44780 library but the code from the DroneBot Workshop did not work. Is there a simple code for the IC display using the hd44780? Maybe I can just adapt it.
I am going to read about hd44780_I2Cexp I/o wiki.
Thanks for your help.
BillRT
Hello bperrybap,
I went to your code, HelloWorld.ino. The code compiled and uploaded OK but there was no information on the display!
I used the VIN pin, not the 5V.
I turned the potentiometer CW and CCW but the display was just plain blue - zero information.
You say, âSketch prints âHello World!â On the lcd it is for the PCF8574 or MCP23008 chip based backpacks.â I donât know what chip based backpacks in my NANO.
Thanks,
BillRT
Hello bperrybap,
I used your I2CexpDiag on tGitHub and run it. The NANO board compiled and uploaded. In the serial monitor, the last said,
FAILED
Memory test failures are usually due to poor solder connections
Most common cause is poor solder joints on pins soldiered to the LCD.
I will change several other I2Cs and check it again.
Thanks again,
Bill RT
I understand what you are saying but you are wrong about the libraries.
You have leaped to the conclusion that the LiquidCrystal_I2C library is being used because you saw a headerfile named "LiquidCrystal_I2C.h" being included.
I am not making assumptions.
I can't be any clearer about how it can be known which library is being used.
I have 10+ years dealing with these libraries.
I know for several reasons:
These things clearly indicate that the code was written for the newLiquidCrystal library and it won't even compile if the LiquidCrystal_I2C library were being used.
--- bill
When the initialization fails the code should blink and error code on the LED.
The i2c backpack you have uses a PCF8574 chip.
Most backpacks use that.
The newLiquidCrstal_I2C LiquidCrystal_I2C i/o class and the LiquidCrystal_I2C library are both written for PCF8574 based backpacks.
"Pin mappings" means how the PCF8574 chip i/o pins are wired to the hd44780 LCD module. Not all backpacks wire the connections the same.
While one way is the most common and the LiquidCrystal_I2C is hard coded for that wiring, there are other designs. newLiquidCrystal LiquidCrystal_I2C allows configuring for the pin mapping, and hd44780 hd44780_I2Cexp figures it out by probing the device.
Post the I2CexpDiag output as it is helpful to help determine what the issue is.
i.e. the output can be used to narrow down the issue, potentially even to the specific cause like a bad connection on a particular pin.
--- bill