Go Down

Topic: Serial I2c interface LCD use wih arduino UNO (Read 331 times) previous topic - next topic

T-rex166

I am thinking about getting this LCD for me project but I worried that I won't know how to code it for it's may be diffrent of nrmal LCD but I really can use more free pins.

THnks in advance

Paul__B


That backpack is "bog standard".

Can't guarantee you will have no troubles, but if you follow the standard process of using the "guesser" to determine the correct constructor using the proper fmalpartida library and then copy the initialisation section and descriptor from the guesser code, it should work just fine. :smiley-roll:

jack wp

Second openion: If you get a serial 16X2 display, there is no need to guess what address, what pins, etc, but it is a bit more costly.

I have used I2C, but I now like serial.



Paul__B

I have used I2C, but I now like serial.
I notice your recent enthusiasm on threads here.

There is a major problem with serial.  To wit, the ATmegaxx8 has only one hardware serial interface, and it tends to be needed for more important functions (even if you allow that your display will not interfere with programming - as such - if paralleled).

I2C on the other hand, shares very nicely (as long as the libraries co-operate - there have been some concerns about that).

And I suspect I2C occupies less time.  Properly written, the code should even be interruptible.

jack wp

#4
Sep 09, 2015, 07:25 pm Last Edit: Sep 09, 2015, 07:32 pm by jack wp
@Paul__B, Thanks for your input. You describe why you like I2C over serial, so I will present the opposite position if you don't mind.

I2C disadvantages:
1. The address and pin definition for a LCD (backpack) will vary from one  device to another.
2. The library's for the I2C LCD display are numerous, and they often work differently on a specific display.
3. If you have actually found a library, that fits your display, that's great. Now if you happen to want to use two (both displays) on the arduino, you have some hardware to contend with.
4. I2C sends a wake up to one of the slaves, and then waits for an ACK. This wait can last for a few ms, or may hang up, still waiting if there is no ACK.
5. I2C wire distance is limited (around 2 meters I think), serial can run about 10 times that.

I use SoftwareSerial rather than messing with the hardware serial interface.
Most of my time is spent prototyping, breadboarding and testing. If I were to do any mass production, I would surely use I2C.

Thanks for your notice!


floresta

#5
Sep 09, 2015, 07:43 pm Last Edit: Sep 09, 2015, 07:46 pm by floresta
In my opinion number 5 is valid, the rest are not.

#1  The addresses and pin definitions don't vary once you have determined them.  This is a one time deal.

#2  I don't think we have come across any I2C adapters that don't work with the currently recommended library.

#3  You don't have any extra hardware to contend with, you just have to make sure that the displays have different addresses.

#4  You should not be worried about an additional wait of several mS when most of the time is already spent in delay loops.  A timeout for missing ACKs is easily implemented if that concerns you.

Don

david_prentice

Yes,   I quite agree that there are some "older" <I2C_LiquidCrystal.h> libraries that are a bit flaky.
However the Fmalpartida version is the definitive library nowadays.

All the backpacks that I have ever seen can use different hardware Slave addresses.    So you should be able to have multiple LCDs on the same I2C bus.

Regarding efficiency.    A UART-backpack will contain a whole MCU e.g. PIC or AVR.   Yes,   it will take less time to control than the unintelligent I2C backpack.    It also costs more.

You can use whichever style you prefer.    Most Arduino users will find the I2C backpack very convenient.

David.

Paul__B

In my opinion number 5 is valid, the rest are not.
...
And thank you for saving me the time! :smiley-lol:

jack wp

In my opinion number 5 is valid, the rest are not.
  This is a one time deal.

#2  I don't think we have come across any I2C adapters that don't work with the currently recommended library.

#3  You don't have any extra hardware to contend with, you just have to make sure that the displays have different addresses.

#4  You should not be worried about an additional wait of several mS when most of the time is already spent in delay loops.  A timeout for missing ACKs is easily implemented if that concerns you.

Don
Great, now explain:
#1  The addresses and pin definitions don't vary once you have determined them. What's an easy way to "determine them"? That's about a half dozen numbers as I recall. I have found no documentation with any I2C LCD units I bought .

#2. How many libraries are floating around out there. You say this one is the one you recommend currently?

#3 You say no hardware to change the I2C address? Well please explain to me how do you change the address of an I2C slave, if not by hardware (I don't think it can be done in software).

#4 "A timeout for missing ACKs is easily implemented if that concerns you.". It may not concern some that the I2C can lockup the processing, but I think most would be concerned.

floresta

#1  Use the search box at the upper right with the terms LCD I2C and stand back.

#2  There are several, many with the same name.  Yes.

#3  I didn't think of the supplied jumpers as 'extra hardware'.

#4  Perhaps the library already has the timeout built in.  I don't know since I haven't used it much.

Don

jack wp

#10
Sep 10, 2015, 03:38 am Last Edit: Sep 10, 2015, 03:38 am by jack wp
Thanks for your input Don.
We should get back to the topic of this thread now, and try to help the OP.
Maybe you can tell the OP what address,and pins should be defined in his code for the device he is looking at.

Thanks

Paul__B

Maybe you can tell the OP what address,and pins should be defined in his code for the device he is looking at.
Actually, we can, though on my part it would involve ferreting through my stuff at home and I am presently not home and have other tasks requiring priority.  I considered the process I suggested to be more appropriate.

I do have good intentions of writing up descriptions with photos for most of the available "backpacks".  Some day. :smiley-roll:




Hang on!  Here it is!

jack wp

Great info Paul__B. The OP should find that really helpful. It almost makes me want to give it another try.
Thanks.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy