Main Site Documentation

Problem Fez Panda 2 with Liquid Crystal Display 2x16 (Arduino)


#1

hello

Can you help me ?

I need the code to run my 2x16 LCD (Arduino) to a microcontroller Fez Panda 2 with shema of connections.

Sorry for my bad english, I’m French

Here are my no-functional code :

using System;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
using System.Threading;
namespace lcd
{
public class Program
{
public static void Main()
{
SerialLCDDisplay lcd = new SerialLCDDisplay(
FEZ_Pin.Digital.Di21, // RS
FEZ_Pin.Digital.Di23, // ENABLE
FEZ_Pin.Digital.Di25, // DB4
FEZ_Pin.Digital.Di27, // DB5
FEZ_Pin.Digital.Di29, // DB6
FEZ_Pin.Digital.Di31); // DB7
lcd.Clear();
int i = 0;
while (true)
{
lcd.CursorHome();
lcd.Print("Counter " + i++);
Thread.Sleep(100);
}
}

Thank you in advance


#2

Welcome to the forum!

You can use the Code tags to wrap your code so it looks more readable.
Do you have a link to the information about the display you are using?


#3

Not sure, but I think you are referring to this http://blog.hekkers.net/2012/05/17/fez-panda-ii-with-hd44780-controlled-lcd/ or the codeshare program http://www.ghielectronics.com/community/codeshare/entry/455 .
The codeshare program should give you the code you need.


#4

Hi Charles.Wey, welcome to the forum.

The other thing I would do is change your 100ms delay to be 10,000 (10sec) so you get to see a real displayed value and know it’s working - all that change in your current program may not be visible.

What do you actually see on the display? Have you adjusted the contrast correctly, have you got all the other pins wired correctly ?


#5

Hello world, thank you for your help !

Here are pictures , code and electric wiring:

What should i change on my electrical wiring?

My code is it good?

Thank you in advance,



using System;
using Microsoft.SPOT;
using GHIElectronics.NETMF.FEZ;
using System.Threading;
namespace lcd
{
    public class Program
    {
        public static void Main()
        {
             FEZ_Components.LCD2x16 lcd = new FEZ_Components.LCD2x16
            (FEZ_Pin.Digital.Di21, FEZ_Pin.Digital.Di23, FEZ_Pin.Digital.Di25,
              FEZ_Pin.Digital.Di27, FEZ_Pin.Digital.Di29, FEZ_Pin.Digital.Di31);

            lcd.Clear();
            int i = 0;
            while (true)
            {
                lcd.CursorHome();
                lcd.Print("Counter " + i++);
                Thread.Sleep(10000);
            }
        }

    }
}


Lurch,it is this reference !


#6

@ charles.wey - Have you included a contrast resistor?


#7

Sorry ,i am beginner

I do not understand?a contrast resistor?

I have included a resistance because I read the electrical diagram in a book Arduino.

Can you provide me with a schematic connection on a map fez panda 2 because I think the connections are bad.

Thanks for your help


#8

You really need a variable resistor to control the contrast on these types of displays. There’s a good chance that the display is working but you just can’t see the output.

http://en.wikipedia.org/wiki/HD44780_Character_LCD has the information on this type of display. Pin 3 is the one you need to connect your contrast control resistor to. You then need to adjust it to get the cells visible. Also make sure you use 5v as your power source, since I’ve seen many LCDs that don’t work reliably on 3v3 (I can’t tell from your picture if you have used 3v3 or 5v).

Connecting it to a Panda is no different to connecting it to an arduino. In your code, you have defined what connections you have used in the constructor of the LCD object, you need to match the pin’s function there with the physical wiring. Make sure you match them up because if you get them wrong they won’t work properly :wink: If you take more detailed shots of your wiring we might be able to guide you there if you need.


#9

You can also connect Analog Out pin on your Panda to the contrast pin on LCD and use AnalogOut class to control contrast.

Or

Use OutputCompare class and any digital pin for the same purpose.


#10

Thank you for the information, I’m working…


#11

[title]Problem solved[/title]

Code:

FEZ_Components.LCD2x16 lcd = new FEZ_Components.LCD2x16(FEZ_Pin.Digital.Di6, FEZ_Pin.Digital.Di8, FEZ_Pin.Digital.Di0, FEZ_Pin.Digital.Di1, FEZ_Pin.Digital.Di5, FEZ_Pin.Digital.Di4);

lcd.Clear();

while (true){
lcd.CursorHome();
lcd.Print(val.ToString()); // Put here the value displayed!!!
}

Thanks all !

Here is a picture of my new wiring diagram: [line] [line] [line] [line] [line] [line] [line] [line] [line]


#12

beauty - what was the issue ?