I'm newbie in Arduino world.
Ordered several models but DUE came first.
First attempt to use LiquidCrystal_I2C library to output some chars on 16x2 blue backlight LCD display
It states using I2C Address: 0x27 (can't be changed!), well "hello word" sketch doesn't work.
Tried I2C scanner but it shows random addresses each time.
Google and this forum shows DUE has broken I2C library, but posts refer to 2013/2014 year, and DUE was released in 2012/2013
So I'm wondering why it is still broken or may be another reason for that (my inability and wrong hands) :o
codlink:
But, just coming here and saying "it doesn't work" isn't going to help you either. Why not specify why it doesn't work?
LCD shows nothing using default address 0x27, I2C scanner output random addresses each run, it seems doesn't work with DUE.
No, I haven't used level converter for the following reasons: there is information DUE has pull-up resistors for 3.3v logic, another reason - the same LCD screen works with Wemos D1 (Arduino like board with 3.3v logic).
But it is a good point, I will try to use level converter, just in case.
Compiling is good but LiquidCrystal_I2C library shows warning I'm using avr architecture instead of sam, so probably it won't work.
RayLivingston:
There is absolutely nothing wrong with the Due I2C library - I've been using it for years with zero problems.
Good to hear! So should be my problems only.
I was inspired by this post
colibri2:
No, I haven't used level converter for the following reasons: there is information DUE has pull-up resistors for 3.3v logic, another reason - the same LCD screen works with Wemos D1 (Arduino like board with 3.3v logic).
But it is a good point, I will try to use level converter, just in case.
I have been using both Due's I2C also, but not specificly for a LCD display.
I'm using many MPC23017 port expanders (use, even all Dué I/o's are not even close to what I need :P)
since those can only be addressed from 0x20 to 0x27, I have connected my 20x4 display directly to Arduino's I/O.
But, for those I2C I did use level converters, since the MPC2017 is 5V logic.
Also, keep in mind that only SDA on pins 20 and 21 have internal pull-up resistors.
SDA1 will need external pull-ups, it has none onboard the Due.
Given your link to your display, it shows it needs 5v logic! So my guess is that the I2C on the back of the display also sends out 5V to your Due.
Why the Wemos D1 works, may be because it has better tolerances on the I/O pins, but I think it won't work very long at 5V input directly and it can be damaged on the long run.
So, still the best solution is using a level converter, you can build a very simple converter using 4 standard BC547B transistors, like this:
(note that you can leave out the 2 3v3 pullups if you use SDA from the Due)
MorganS:
The I2C scanner must work. Fix that first.
Did you connect the grounds? Did you connect to the correct pins on the Due? It's different to the other Arduinos.
MorganS, YES! Thank you mate.
I powered DUE and LCD screen from different power sources, so grounds didn't connect.
Connecting grounds solves the issue!
I'm so stupid...
colibri2:
MorganS, YES! Thank you mate.
I powered DUE and LCD screen from different power sources, so grounds didn't connect.
Connecting grounds solves the issue!
I'm so stupid...
Made that mistake myself also, sending serial data from Due to a Marklin 6051 interface, which could only be powered using Marklins own supply (Vac).
Took me days of frustration to finally realize the grounds were not connected.......
I guess your display functions even on 3v3 power I take it?
Setting up a LCD is not a complex task.
For example, for a little test I took a generic 1602 LCD of out my parts box, connected it to a little I2C backpack expander board bought cheaply online and set the software accordingly. That is, configure the correct I2C address and then write some data to the I2C port to display and to see it.
So, in essence, know and understand the I2C interface board you are using so you can be sure you have the correct I2C address.
Look at the many very simple examples of writing to such little displays and if you have difficulties, try to develop methods to help yourself to find where the issues are.
You will go a long way if you can develop good diagnostic methodologies.
It is of no values you telling us that the code verify was successful and that it was done in 4.807 seconds.
What information do you think that would provide ?