Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

How to make an LCD shield work on the galileo board using arduino sketch

ELabs
Novice
1,929 Views

I tried a basic 16*2 LCD https://www.sparkfun.com/products/709 https://www.sparkfun.com/products/709 . The LCD would just not work but the same setup works perfectly with the an arduino Duemilanove/UNO.

Also I tried the I2C LCD shield http://www.adafruit.com/products/715 http://www.adafruit.com/products/715 but had no luck with that too.

I2C

0 Kudos
12 Replies
ADRIAN_B_Intel
Employee
275 Views

hi,

what libraries are you using? is it a compile issue or does the sketch run?

please add snippets of code that are failing or attach compile errors

The LiquidCrystal libraries in the IDE should work so if your LCD uses them then they will work but if its using other libraries that have atmega specific register calls in them then they will not compile...Intel and the shield manufacturers are going to work on that for the next IDE release.

-adrian

IPorr1
New Contributor I
275 Views

Hi

same issue here. Trying to use i2c to control a small LCD display.

Product and ref code is here

http://international.switch-science.com/catalog/1407/ SWITCH-SCIENCE - I2C small LCD board

on Arduino uno it works OK but of course you have to use exactly SDA on pin A4 and SCL on pin A5, see "schematic" here: http://www.gammon.com.au/forum/?id=11473 Electronics : Microprocessors : Arduino Uno Rev3 pinouts photo

So, missing i2c on A4 and A5?

Edit: I don't think so! I have the same issue trying to use SDA/SCL on pins 16,17 A more general issue with Wire.h?

Thanks

ivan

ADRIAN_B_Intel
Employee
275 Views

hi Ivan,

did it compile ok and didnt run ok?

I2C is available on A4/A5 and 16/17 just like Uno so this should just work, i have contacted the developer that works on the Wire library. He will check this out and get back to you.

thanks for your investigation on this

-a

IPorr1
New Contributor I
275 Views

Hi ado

thank you.

Yes it works, it compiles and code is sent to Galileo correctly but I2C only does not work.

I'm pretty sure about that. Some incomplete transfer heppens sometimes so I double check every time the log and I've added a small "led blink" code in the setup part of the sketch just to be sure the code landed correctly and run.

I'm testing against an UNO R3 so I'm sure about soldering / pinouts / code not being part of the issue

thank you very much, this is just an hobby for me, so no urgency! But since I've been given the opportunity to "work" on the board I am happy to help

ivan

ADRIAN_B_Intel
Employee
275 Views

Hi Ivan,

our Galileo i2c expert is back tomorrow or the next day.

So this shield not working still? http://www.adafruit.com/products/715 http://www.adafruit.com/products/715

We will try and get one and test it.

Please let us know the latest status so that when our I2C expert gets here we have all the info?

thanks again,

-a

BStar1
New Contributor I
275 Views

Since Galileo has ethernet built in you can also consider eliminating the LCD altogether and use a quick prototyping GUI for smart phones or tablets. I am in the process of testing Arduino Manager (iPhone) on Galileo, I will report on a separate post when I get it to work.

ELabs
Novice
275 Views

I think the reason why a basic LCD shield using LiquidCrystal library does not work on Galileo because all that library does is some fast I/O operations with delays. But since I/O on Galileo boards is very slow. It cannot use Liquid crystal library and thus cannot access the LCD using that library.

In theory 12C should work. I removed all the AVR stuff from the Adafruit library and got the code to compile. But still cant make the shield work properly. I'll post the code if I have any success with the other shield.

Erik_N_Intel
Employee
275 Views

eselabs@penn-

The basic LCD screens do work- we tested them before release, and they were working (albeit a bit slowly).

The reason they don't work now is because a bug crept in somewhere between that testing and the release. Sit tight, and this will be fixed in an upcoming release.

I'll try out the adafruit i2c screen and get back to you.

Erik.

Erik_N_Intel
Employee
275 Views

eselabs@penn, I tried out the Adafruit I2C 16x2 LCD shield (sorry it took so long- I had to assemble it and didn't get around to it until yesterday)

it doesn't work for me either. Compile-time errors comlain about missing avr/pgmspace.h, so I tried simply removing this reference from the two files Adafruit_MCP23017.cpp and Adafruit_RGBLCDShield.cpp

Surprisingly, this compiled without any compile-time errors but 'HelloWorld' sketchdid not produce desired results (screen lit up and flickered for a bit).

Even more surprisingly, the same library with avr/pgmspace.h removed DID compile and 'HelloWorld' worked as expected on an UNO.

Looks like there's a bug there. We'll add it to our list for upcoming releases!

Thanks for helping us find it

Erik.

ELabs
Novice
275 Views
Eiichi_K_Intel
Employee
275 Views

I checked http://www.adafruit.com/products/715 Adafruit I2C Controlled + Keypad Shield Kit for 16x2 LCD ID: 715 - $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits shield which eselabs@penn reported as not working. It does not work in my environment, either. It looks like handling of Wire.h on Galileo IDE is incorrect, somehow. I will describe code I used to show how problem can be replicated.

The code is attached below. It works as expected on UNO; "Red" LED blinks. On Galileo, "Green" LED is always on. It's weird. If I remove initialization of Green LED, Galileo works just like UNO. I hope it give another clue of what's going wrong.

# include

// Adafruit_MCP23017.h is modified a little bit to make it work under Galileo environment.

# include "Adafruit_MCP23017.h"

# define LED_PIN_RED 6 // GPA6# 27. On when LOW

# define LED_PIN_GREEN 7 // GPA7# 28. On when LOW

Adafruit_MCP23017 mcp;

void setup() {

mcp.begin(); // use default address 0

// initialization of Red LED to Off.

mcp.pinMode(LED_PIN_RED, OUTPUT);

mcp.digitalWrite(LED_PIN_RED, HIGH);

// initialization of Green LED to Off. This should not interfere anything.

mcp.pinMode(LED_PIN_GREEN, OUTPUT);

mcp.digitalWrite(LED_PIN_GREEN, HIGH);

}

void loop() {

mcp.digitalWrite(LED_PIN_RED, LOW);

delay(200);

mcp.digitalWrite(LED_PIN_RED, HIGH);

delay(200);

}

Original code on Adafruit is here: https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/examples/toggle/toggle.pde https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library/blob/master/examples/toggle/toggle.pde

BTW, when can we expect to see next IDE release?

Eiichi_K_Intel
Employee
275 Views

okay. _i2c.digitalWrite() is not working properly.

For example,

_i2c.digitalWrite(6, 1);

_i2c.digitalWrite(7, 1);

and

_i2c.digitalWrite(7, 1);

_i2c.digitalWrite(6, 1);

work differently on Galileo; only the second statement is valid.

_i2c.digitalWrite(7, 1);

_i2c.digitalWrite(8, 1);

and

_i2c.digitalWrite(7, 1);

_i2c.digitalWrite(8, 1);

work the same; both statements are valid.

It seems that bit handling (within byte boundary) of the library is incorrect.

Due to above error, RGB backlight on Adafruit LCD lit strange. It could be a clue to fix the library.

Reply