Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
1,253 Views

Galileo Gen 2 and Serial LCD help

Hello All - Has anyone been able to get a serial LCD to work with the Galileo Gen 2 using either the OS or Python?

I am using a Galileo Gen 2 built with the EGLIBC image: http://downloadmirror.intel.com/25384/eng/iot-devkit-201510010757-mmcblkp0-galileo.direct.xz http://downloadmirror.intel.com/25384/eng/iot-devkit-201510010757-mmcblkp0-galileo.direct.xz

root@galileo:~# uname -a

Linux galileo 3.8.7-yocto-standard # 1 Tue Sep 29 22:16:33 GMT 2015 i586 GNU/Linux

The LCD is a Serial enabled LCD from Sparkfun https://www.sparkfun.com/products/9393 https://www.sparkfun.com/products/9393

I have it connected to GND, 5V and Digital Pin 1 (TX) .

On power on I get the Sparkfun splash screen then it fills with a character like extended ascii 186 or || . I have tried a second LCD just to make sure it was not a LCD hardware issue.

I have tried using PySerial to write to it, and using echo to /dev/ttyS0. But no changes. If you have any ideas I would appreciate it.

Cheers,

-Joe

Tags (1)
10 Replies
Highlighted
Community Manager
6 Views

I followed a few examples and tried setting GPIO values on 28,32 & 45.

os.system('echo -n "28" > /sys/class/gpio/export')

os.system('echo -n "out" > /sys/class/gpio/gpio28/direction')

os.system('echo -n "0" > /sys/class/gpio/gpio28/value')

os.system('echo -n "32" > /sys/class/gpio/export')

os.system('echo -n "out" > /sys/class/gpio/gpio32/direction')

os.system('echo -n "1" > /sys/class/gpio/gpio32/value')

os.system('echo -n "45" > /sys/class/gpio/export')

os.system('echo -n "out" > /sys/class/gpio/gpio45/direction')

os.system('echo -n "1" > /sys/class/gpio/gpio45/value')

 

Then set baud rate to 9600

 

os.system('stty -F /dev/ttyS0 9600')

lcd=serial.Serial('/dev/ttyS0', 9600)

 

And writing to it does not yield any results.

lcd.write(b"HelloWorld")

 

I'm sure it is something simple I am missing.

 

Cheers,

-Joe

 

0 Kudos
Highlighted
Honored Contributor I
6 Views

Hi Joe,

I know nothing about electronics, but I think there is some problem on

"Communication with SerLCD requires 5V TTL serial at a default baud rate of 9600bps (8-N-1)."

(copied from the URL you posted)

more specifically, I'm not sure an Arduino-Galileo pin has "TTL electronic"... but i'll ask an engineer in a few days hopefully.

Fernando.

0 Kudos
Highlighted
Honored Contributor I
6 Views

FGT wrote:

Hi Joe,

I know nothing about electronics, but I think there is some problem on

"Communication with SerLCD requires 5V TTL serial at a default baud rate of 9600bps (8-N-1)."

(copied from the URL you posted)

more specifically, I'm not sure an Arduino-Galileo pin has "TTL electronic"... but i'll ask an engineer in a few days hopefully.

Fernando.

Reply to myself just to rectify:

"Galileo provides UART TTL (5V/3.3V) serial communication, which is available on digital pin 0 (RX) and 1 (TX)."

from http://www.intel.com/newsroom/kits/quark/galileo/pdfs/Intel_Galileo_Datasheet.pdf http://www.intel.com/newsroom/kits/quark/galileo/pdfs/Intel_Galileo_Datasheet.pdf

I think the default is 5V according to several statements in the same document.

Fernando.

0 Kudos
Highlighted
Community Manager
6 Views

Hey Fernando - Thanks for the reply and digging out the data sheet. I attached the comm pin from the LCD to digital Pin 1 since it is one way communication to the LCD.

I tried a few different baud rates as a test with no luck so far.

Cheers,

-Joe

0 Kudos
Highlighted
Honored Contributor I
6 Views

Hi Joe,

I'm rather far from the eglibc image, but I'm curious enough...:

a) what are the examples you are following?

b) I know that it would be a huge work if you are only working with an IDE other than the Arduino one, but: is there any chance you can test the LCD with the example provided by Sparkfun at https://www.sparkfun.com/tutorials/246 Serial LCD quickstart - SparkFun Electronics?

Fernando.

0 Kudos
Highlighted
Community Manager
6 Views

Hey Fernando - It works when using an arduino sketch. But that is not my use case with the Galileo, the Galileo is way to expensive for me to use as an Arduino . I am using python and no IDE (just vi).

I found a few examples on the forum here:

Although this looks helpful, I just found it and have not tried it:

-Joe

0 Kudos
Highlighted
Community Manager
6 Views

That last link held the trick, I was missing GPIO33. To get this to work you need to set GPIO up on 28,32,33, & 45. Next you would hook up pin D1 to the input on your serial LCD.

You can download an example from here: https://github.com/joemcmanus/lcd GitHub - joemcmanus/lcd: Sample program to control a serial LCD on the Intel Galileo Gen 2

The newest version is available on git hub, fixed a few bugs today.

Cheers,

-Joe

0 Kudos
Highlighted
Honored Contributor I
6 Views

Hi Joe,

Great, thanks for sharing.

I do not completely understand the setPins(...) 28, 32, 33, 45, but I think I'll understand once I read your suggested URLs.

Thanks again,

Fernando.

0 Kudos
Highlighted
Community Manager
6 Views

Updated the sample code and included an image in the event someone has the same question.

Including a few examples like display the temperature and date on the lcd.

https://github.com/joemcmanus/lcd GitHub - joemcmanus/lcd: Sample program to control a serial LCD on the Intel Galileo Gen 2

Cheers,

-Joe

Highlighted
Honored Contributor I
6 Views

Great, thank you

Fernando.

0 Kudos