I2C LCD display library compatible with M0 pro

Hi

I'm trying to use my M0pro connected to an I2C LCD display (I2C/TWI LCD1602 Module based).

I do not find out the correct library based on SDA and SCL pins of my M0 pro ?

Even using pins A4 & A5 with relevant library does not work.

Could you help me please ?

Best Regards

DR

This board : https://www.arduino.cc/en/Main/ArduinoBoardZero
is almost the same this board : Arduino M0 Pro - 32 bit Cortex M0 with Debug Interface : ID 2417 : $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits
and this is the M0 Pro at arduino.org : Arduino - Home
(you are now at Arduino.cc)

The SDA and SCL are the pins near the reset button. Did you try the standard Arduino Wire library ?

Yes I did it and it's not working.
I read somewhere that the I2C library is not yet available for the M0pro.
Is that thrue ?

As far as I know, that is not true, but I don't have a Zero or Zero Pro, I even don't have a Due.

Are you using the newest Arduino IDE 1.6.7 from Arduino.cc ?
Did you install the Zero from the Boards Manager ?
If you enable the verbose output for compiling in settings, then you can see that the Wire library of the downloaded packages is used.
(I click in the output window part, then I do Ctrl+a and Ctrl+c and paste it in a text editor)
.arduino15/packages/arduino/hardware/samd/1.6.4/libraries/Wire/Wire.cpp

I think it is this one : ArduinoCore-samd/Wire.cpp at master · arduino/ArduinoCore-samd · GitHub.

You could try the software from Arduino.org.

Could there be a problem with the display, or the ground, or the voltage levels, or your wires of the I2C bus ?
Is the display a 5V device ? How did you connect it to an 3.3V Arduino board ?

I have a M0, and it was helpful to use the Arduino IDE 1.7.8 from Arduino.org.

And your Display work with 3,3 V ?

Hi

So I have loaded the lcd library from : Arduino - Home

As indicated by Arduino.org Support Team in previous exchanges.

Nothing happened even after a correct compilation without errors !

Note that my LCD is supplied under 3.3 V which I brougth it from the M0pro 3.3V pin, I checked Vcc at lcd level , and it's correct.

Does somebody alredy used an LCD with the M0pro such as this one : http://www.elecfreaks.com/estore/i2c-spi-lcd1602-module-white-on-blue-iic-lcd02.html ?

If yes, thanks to give me some advise or library.

Best Regards

Daniel

Hi

So I summarise the situation :

The M0pro is 3.3 V pin level
My LCD display is 5V. I tried under 3.3V but nothing works !
I read that I should bye a 3.3V LCD one or use a shifter 5V - 3.3 V
On the other end I am not sure about the correct library I need to use to control the LCD display via I2C bus with the M0pro ?

What do you recommend to me ?

Many thanks

Daniel

The very common cheap LCD 16x2 displays need 5V. They are 1.40 dollars for the LCD plus 1 dollar for the I2C add-on.
Most OLED displays and other displays can handle a larger voltage range.

The link to elecfreaks.com is a LCD display for 3.3V. That is something special and is 15 dollars.

Some possibilities:

  • Use the ZERO 5V pin to the LCD, and use a level converter for the I2C. You are going to need a I2C level converter anyway for a project, so you might as well buy a few. After that, you still have to check if the library will work.
  • Get rid of the LCD, try a 3.3V OLED. Is there a OLED library that is compatible with the ZERO ?
  • Buy a special 3.3V LCD display.

When you want to test the I2C, run the i2c_scanner : Arduino Playground - I2cScanner
Maybe the LCD is broken. Do you have a Arduino Uno for a quick test ?

If there is a problem with the Wire library for the ZERO, it will be fixed soon. At this moment some have less trouble with the Arduino.org software. But I'm a Arduino.cc fan, so please stay with us :wink:

Adafruit is going towards the M0 processor with their "Feather" line : Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0 : ID 2772 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits
I don't know which core they use and which Wire library.

Thanks Koepel

I am ordering shifters to follow your first suggestion.

Thanks,

I come back to you when I get it

Daniel

They are between 30 dollarcents and 1 dollar on AliExpress or Ebay.

Now I'm wondering which sketch can I use to display a word or sentence on the i2c lcd from my m0pro.
You provided me with the wire library for zero but I would like if possible a complete sketch for display as well.
Could you give me advise for it ?
Thanks
DR

That specific Wire library should be automatically installed and be used when the Zero is selected.
If the Wire library is working, then the normal I2C LCD library should work.

Now I put the 3.3 V - 5V bi directional shifters in place. All voltages being measured are fine.

I also ran the I2C scanner : result is surprising since I got 2 adresses for a single LCD_I2C module, connected to my M0PRO :

0x20 and 0x28 ??

Then I tried the following sketch which I found related to the I2C component MCP23008 used on my device. Two times with respectively 0x20 and 0x28 addresses, The back light is going HIGH using 0x20 address !! YES !!

, but the "HELLO WORLD" text is displayed as "<-<- Strange caracter <-<- strange caracter<-<-" !

Could you help ?

Thanks,

// MCP23008 (Adafruit LCD Backpack)
#include <Wire.h>
#include <LiquidTWI2.h>
LiquidTWI2 lcd(0x20);
void setup() {
lcd.setMCPType(LTI_TYPE_MCP23008); // must be called before begin()
lcd.begin(16,2);
lcd.setBacklight(HIGH); // only supports HIGH or LOW
}
void loop() {
lcd.print("Hello World!");
delay(1500);
lcd.clear();
delay(500);
}

Hi

I arrive to a possible conclusion that my project is stuck due to a library problem.

I switch to another post in the "project guidance"