Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Sparkfun LCD


  • Please log in to reply
19 replies to this topic

#1 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 21 August 2010 - 10:32 PM

So I purchased the Electronic Brick Start Kit (http://www.seeedstud...tml?cPath=48_69 ) along with my netduino. Manual here: http://www.seeedstud...icks Vol1.1.pdf There seems to be a library for controlling this display for the arduino, is there an equivalent for the netduino?

Attached Files



#2 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 21 August 2010 - 11:26 PM

So I purchased the Electronic Brick Start Kit (http://www.seeedstud...tml?cPath=48_69 ) along with my netduino.

Manual here: http://www.seeedstud...icks Vol1.1.pdf

There seems to be a library for controlling this display for the arduino, is there an equivalent for the netduino?


If it's a 3.3V LCD it's no problem - I have one as well but haven't fought with it yet since I also have a SparkFun LCD which works like a charm.

#3 EdO

EdO

    New Member

  • Members
  • Pip
  • 5 posts

Posted 22 August 2010 - 05:59 PM

See my "HD44780 LCD display in 4-bit mode using 4 data wires" post under the "General" section for solution.

#4 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 23 August 2010 - 01:01 AM

Ok, I matched the code from the link EdO referenced to the bus connections shown in the Electronic Bricks Bus documentation. I ended up with this: LCD_RS = new OutputPort(Pins.GPIO_PIN_D10,false); LCD_E = new OutputPort(Pins.GPIO_PIN_D12,false); LCD_D4 = new OutputPort(Pins.GPIO_PIN_D13, false); LCD_D5 = new OutputPort(Pins.GPIO_PIN_A0, false); LCD_D6 = new OutputPort(Pins.GPIO_PIN_A1, false); LCD_D7 = new OutputPort(Pins.GPIO_PIN_A2, false); When I try the following code: LCD.Initialize(); while (true) { LCD.Print("Hello World"); Thread.Sleep(2000); LCD.SetCursor(1, 0); LCD.Print("Hello Netduino"); Thread.Sleep(2000); LCD.Clear(); Thread.Sleep(2000); } I get no response from the LCD. The first row of characters on the LCD is filled with solid blocks, as in the pic attached to the original posting. Any ideas on how to debug?

Attached Files

  • Attached File  bus2.png   27.22KB   44 downloads


#5 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 23 August 2010 - 02:40 AM

I am trying to send commands directly to the LCD taking queues from the Liquid Crystal.cpp/LiquidCrystal.h drivers found on the sparkfun page for this LCD. Assign IO Pins matching the seeduino brick chasis specs: LCD_RS = new OutputPort(Pins.GPIO_PIN_D10,false); LCD_E = new OutputPort(Pins.GPIO_PIN_D12,false); LCD_D4 = new OutputPort(Pins.GPIO_PIN_D13, false); LCD_D5 = new OutputPort(Pins.GPIO_PIN_A0, false); LCD_D6 = new OutputPort(Pins.GPIO_PIN_A1, false); LCD_D7 = new OutputPort(Pins.GPIO_PIN_A2, false); LCD_RS.Write(false); Send 0x28, function set: 4 bits, 1 line, 5x8 dots LCD_D7.Write(false); // 0 LCD_D6.Write(false); // 0 LCD_D5.Write(true); // 1 LCD_D4.Write(false); // 0 LCD_E.Write(true); LCD_E.Write(false); Thread.Sleep(50); LCD_D7.Write(true); // 1 LCD_D6.Write(false); // 0 LCD_D5.Write(false); // 0 LCD_D4.Write(false); // 0 LCD_E.Write(true); LCD_E.Write(false); Send 0x0C 0000 1100// display control: turn display on, cursor off, no blinking Thread.Sleep(50); LCD_D7.Write(false); //0 LCD_D6.Write(false); //0 LCD_D5.Write(false); //0 LCD_D4.Write(false); //0 LCD_E.Write(true); LCD_E.Write(false); Thread.Sleep(50); LCD_D7.Write(true); //1 LCD_D6.Write(true); //1 LCD_D5.Write(false); //0 LCD_D4.Write(false); //0 LCD_E.Write(true); LCD_E.Write(false); Then send CMD DISP_ON = 0x01 then send CMD CLR_DSP = 0x02. No cigar. Still shows the top row of LCD chars as solid blocks. Even when I blank out the Netduino code, the LCD displays these blocks on the first row. Is it possible that I have a bad LCD?

#6 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 24 August 2010 - 12:24 AM

I went as far as continuity testing each pin on the LCD and matching it to its Netduino IO. Turns out the documentation was right, the pin mappings are correct. No go on the confounded LCD though. I understand my level of noobishness at this point is obscene but I would definitely appreciate any tips at this point.

#7 EdO

EdO

    New Member

  • Members
  • Pip
  • 5 posts

Posted 24 August 2010 - 01:56 AM

I think that your issue might be with the "other" pins. Pins such as R/W needs to be grounded and Vo needs to be on a pot.

Check out this diagram at http://arduino.cc/en...l/lcd_schem.png, for details. Just watch out the Digital pins are mapped differently than todotani's example from GHIElectronics library.

I also noticed that some of the sample posts in this thread, included mismatched pin types:


LCD_D4 = new OutputPort(Pins.GPIO_PIN_D13, false);
LCD_D5 = new OutputPort(Pins.GPIO_PIN_A0, false); << Wrong this is an analog pin, A for "analog", should be a digital pin
LCD_D6 = new OutputPort(Pins.GPIO_PIN_A1, false); << Wrong, same issue
LCD_D7 = new OutputPort(Pins.GPIO_PIN_A2, false); < Wrong, same issue.

Hope this helps
Ed

#8 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 24 August 2010 - 02:22 PM

Thanks EdO! I was under the impression that the analog pins were "general purpose", as far as them being able to act as digital? Was I mistaken? The "brick shield" im using makes it pretty obvious that mapping the LCD pins to the analog ports pretty obvious. I'll check the "other" pins and try going all digital for the next round of testing.

#9 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 24 August 2010 - 04:07 PM

Thanks EdO!

I was under the impression that the analog pins were "general purpose", as far as them being able to act as digital? Was I mistaken?

The "brick shield" im using makes it pretty obvious that mapping the LCD pins to the analog ports pretty obvious. I'll check the "other" pins and try going all digital for the next round of testing.


I don't know with netduino, but on arduino you can use a analogue pin as a digital pin,
I often use it when no free digital pins,

Pascal

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 August 2010 - 04:37 PM

I don't know with netduino, but on arduino you can use a analogue pin as a digital pin,
I often use it when no free digital pins,


The six "analog inputs" on the Netduino are also digital pins. The only caveat is that A0-A3 can only put out about 2mA of power (vs the 8mA to 16mA of the other digital pins).

Chris

#11 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 27 August 2010 - 01:11 AM

The only pot I have on hand is a 5k ohm...What happens if no pot?

#12 todotani

todotani

    New Member

  • Members
  • Pip
  • 3 posts
  • LocationYokohama, JAPAN

Posted 28 August 2010 - 11:40 AM

Ok,

I matched the code from the link EdO referenced to the bus connections shown in the Electronic Bricks Bus documentation. I ended up with this:

LCD_RS = new OutputPort(Pins.GPIO_PIN_D10,false);
LCD_E = new OutputPort(Pins.GPIO_PIN_D12,false);
LCD_D4 = new OutputPort(Pins.GPIO_PIN_D13, false);
LCD_D5 = new OutputPort(Pins.GPIO_PIN_A0, false);
LCD_D6 = new OutputPort(Pins.GPIO_PIN_A1, false);
LCD_D7 = new OutputPort(Pins.GPIO_PIN_A2, false);

When I try the following code:


LCD.Initialize();

while (true)
{
LCD.Print("Hello World");
Thread.Sleep(2000);
LCD.SetCursor(1, 0);
LCD.Print("Hello Netduino");
Thread.Sleep(2000);
LCD.Clear();
Thread.Sleep(2000);
}

I get no response from the LCD. The first row of characters on the LCD is filled with solid blocks, as in the pic attached to the original posting.

Any ideas on how to debug?


As EdO mentioned, R/W pin should be grounded. To do this, try to add the following code;
LCD_RW = new OutputPort(Pins.GPIO_PIN_D11,false);

This feed LCD R/W (pin 11) Low.

#13 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 04 September 2010 - 09:21 PM

I have the same LCD as mentioned by Derek... anyone had any luck getting this to work yet?

If I connect to the 2nd bus on the shield, and use the following code... I get the LCD to blank... but that's it.

//Setup the ports
      OutputPort LCD_RS = new OutputPort(Pins.GPIO_PIN_D10, false);
      OutputPort LCD_RW = new OutputPort(Pins.GPIO_PIN_D11, false);
      OutputPort LCD_E = new OutputPort(Pins.GPIO_PIN_D12, false);    //enable

      OutputPort LCD_D4 = new OutputPort(Pins.GPIO_PIN_D13, false);
      OutputPort LCD_D5 = new OutputPort(Pins.GPIO_PIN_A0, false);
      OutputPort LCD_D6 = new OutputPort(Pins.GPIO_PIN_A1, false);
      OutputPort LCD_D7 = new OutputPort(Pins.GPIO_PIN_A2, false);


      LCD_RS.Write(false);
      //Send 0x28, function set: 4 bits, 1 line, 5x8 dots
      LCD_D7.Write(false); // 0
      LCD_D6.Write(false); // 0
      LCD_D5.Write(true); // 1
      LCD_D4.Write(false); // 0


      LCD_E.Write(true);
      LCD_E.Write(false);


      Thread.Sleep(50);
      LCD_D7.Write(true); // 1
      LCD_D6.Write(false); // 0
      LCD_D5.Write(false); // 0
      LCD_D4.Write(false); // 0

      LCD_E.Write(true);
      LCD_E.Write(false);

      //Send 0x0C 0000 1100// display control: turn display on, cursor off, no blinking
      Thread.Sleep(50);
      LCD_D7.Write(false); //0
      LCD_D6.Write(false); //0
      LCD_D5.Write(false); //0
      LCD_D4.Write(false); //0

      LCD_E.Write(true);
      LCD_E.Write(false);

      Thread.Sleep(50);
      LCD_D7.Write(true); //1
      LCD_D6.Write(true); //1
      LCD_D5.Write(false); //0
      LCD_D4.Write(false); //0

      LCD_E.Write(true);
      LCD_E.Write(false);

~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#14 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 04 September 2010 - 09:26 PM

Derek, in that code you posted... What do you declare LCD as?
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#15 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 06 September 2010 - 05:57 PM

So I purchased the Electronic Brick Start Kit (http://www.seeedstud...tml?cPath=48_69 ) along with my netduino.

Manual here: http://www.seeedstud...icks Vol1.1.pdf

There seems to be a library for controlling this display for the arduino, is there an equivalent for the netduino?


HURRAH! I finally got a version working.

First, go here, and download the MicroLiquidCrystal_20100905.zip file. You can find it at the bottom of this post (from a forum member here... Thanks!)

http://geekswithblog...id_crystal.aspx


Then, load up your project. Use the GpioLiquidCrystalTransferProvider as your provider.

Finally, setup your provider code as follows:

GpioLiquidCrystalTransferProvider lcdProvider = new GpioLiquidCrystalTransferProvider(Pins.GPIO_PIN_D10,
                                Pins.GPIO_PIN_D11,
                                Pins.GPIO_PIN_D12,
                                Pins.GPIO_PIN_D13,
                                Pins.GPIO_PIN_A0,
                                Pins.GPIO_PIN_A1,
                                Pins.GPIO_PIN_A2
               );

      LiquidCrystal lcd = new LiquidCrystal(lcdProvider);

And, you'll end up with a screen like this...

Posted Image

Enjoy!
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 September 2010 - 06:06 PM

And, you'll end up with a screen like this...

Posted Image

Enjoy!


You may want to post a link to this in the "Project Showcase" forum, Eric (and including it in the "compatible shields and accessories" sticky post. Congrats on getting it up and running!

Chris

#17 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 06 September 2010 - 08:11 PM

You may want to post a link to this in the "Project Showcase" forum, Eric (and including it in the "compatible shields and accessories" sticky post. Congrats on getting it up and running!

Chris


Thanks Chris... I posted it in the Project Showcase. I think it's already in the Compatible Shield thread... if not, I'll post it there...
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#18 Derek

Derek

    Member

  • Members
  • PipPip
  • 10 posts

Posted 05 October 2010 - 11:53 PM

Hmmmm. I took a longish break from Netduino'ing as work got extremely busy but: My LCD still does nothing, this is my code: using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino; using MicroLiquidCrystal; namespace LCD_Works { public class Program { public static void Main() { // write your code here MicroLiquidCrystal.GpioLcdTransferProvider lcdProvider = new GpioLcdTransferProvider(Pins.GPIO_PIN_D10, Pins.GPIO_PIN_D11, Pins.GPIO_PIN_D12, Pins.GPIO_PIN_D13, Pins.GPIO_PIN_A0, Pins.GPIO_PIN_A1, Pins.GPIO_PIN_A2 ); Lcd lcd = new Lcd(lcdProvider); } } } Can anyone perhaps ID what I might be doing wrong?

#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 October 2010 - 12:00 AM

Derek, have you tried Eric Burdo's 's code (2-3 posts up from here in this thread?)

#20 HappyDK

HappyDK

    New Member

  • Members
  • Pip
  • 3 posts

Posted 11 May 2012 - 09:08 PM

Hello everybody.

I am curious to know if anybody actually got this to work - I haven't.

I am using

- NetDuino Plus
- Electronic Brick LCD (from the Starters Kit)
- I downloaded the MicroLiquidCrystal from http://microliquidcr...l.codeplex.com/ and took the latest version 6668
- I rewrote Eric Burdo's code to match the new version (method names have changed) to look like this:
            GpioLcdTransferProvider lcdProvider = new GpioLcdTransferProvider(Pins.GPIO_PIN_D10,
                                           Pins.GPIO_PIN_D11,
                                           Pins.GPIO_PIN_D12,
                                           Pins.GPIO_PIN_D13,
                                           Pins.GPIO_PIN_A0,
                                           Pins.GPIO_PIN_A1,
                                           Pins.GPIO_PIN_A2
                          );
            Lcd lcd = new Lcd(lcdProvider);
When run I get an exception in the library (Line 71).

Anyone has a fix for that?

Any help would be appreciated!

Kind regards
Per Butschkow




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.