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

LCD Library


  • Please log in to reply
41 replies to this topic

#21 Spike

Spike

    Member

  • Members
  • PipPip
  • 24 posts

Posted 13 October 2010 - 02:38 PM

Ok I rewired it completely, so it is exactly as it is in the blog post.

So from the LCD -

1 - GND
2 - 5v
3- 10k pot centre pin
4 - 1 on the SR (shift register)
5- 2 on the SR
6- 3 SR
7- n/a
8- n/a
9- n/a
10- n/a
11- 4 on the SR
12 - 5 on the SR
13 - 6 on the SR
14 - 7 on the SR

On the shift register -

16 - 5v
15 - PNP transistor
14 - 11 on NetD
13 - GND
12 - 10 on NetD
11 - 13 on NetD
10 - 5v
9 - n/a

And I am currently using this code:

public static void Main()
        {
            // create the transfer provider
            var lcdProvider = new Shifter74Hc595LcdTransferProvider(SPI_Devices.SPI1,
                SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D10, Shifter74Hc595LcdTransferProvider.BitOrder.MSBFirst);

            // create the LCD interface
            var lcd = new Lcd(lcdProvider);

            // set up the LCD's number of columns and rows: 
            lcd.Begin(16, 2);

            // Print a message to the LCD.
            lcd.Write("hello, world!");

            while (true)
            {
                // set the cursor to column 0, line 1
                lcd.SetCursorPosition(0, 1);

                // print the number of seconds since reset:
                lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());

                Thread.Sleep(100);
            }
        }

I have attached the datasheets.

Thanks again.

Attached Files



#22 Szymon

Szymon

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts
  • LocationPoland, Krakow

Posted 13 October 2010 - 03:02 PM

Edit: The strange things appearing seems to be intermittent, it happened when I first turned it on this morning. Here is a picture...


Spike,
Looking at the photo I can't see exactly how you connected wires to the LCD. Did you solder them directly or added header pins?

In any case make sure they are connected firmly. If any of the wires gets disconnected the LCD can't interpret the commands and thus you might get the garbage flickering on screen as you are seeing now.

#23 Spike

Spike

    Member

  • Members
  • PipPip
  • 24 posts

Posted 13 October 2010 - 03:19 PM

As far as I can tell they are all secure. I will try and attach them more securely. Is there any other explanation?

#24 Spike

Spike

    Member

  • Members
  • PipPip
  • 24 posts

Posted 13 October 2010 - 03:31 PM

As far as I can tell they are all secure. I will try and attach them more securely. Is there any other explanation?


All the connections seem good....

#25 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 16 November 2010 - 06:32 PM

Szymon, thank you for this library. Just wired up my 7€ LCD as GPIO and it worked right from the spot. Now i am waiting for my Shiftregisters from Thailand because here in Germany they are much too expensive. Just one question from a Visual Studio Noob (worked with Java and Eclipse till now), where do i have to put your files so i can use the MicroLiquidCrystal Library via the "using" Argument on the Top of my app?

#26 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 16 November 2010 - 08:14 PM

Just one question from a Visual Studio Noob (worked with Java and Eclipse till now), where do i have to put your files so i can use the MicroLiquidCrystal Library via the "using" Argument on the Top of my app?


Assuming you have a compiled library in an 'assembly' (i.e. the .dll), the next thing you should do is choose "Add Reference..." and select the .dll. (You may have to use the 'Browse' tab and navigate to it on your hardrive.)

From there, you will have access to the namespace defined in the .dll and you can use the functionality in the library.

#27 Szymon

Szymon

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts
  • LocationPoland, Krakow

Posted 24 November 2010 - 06:27 PM

I have updated the LCD library to support I2C port expanders. In particular this enables to use the library with the Adafruit's i2c/spi LCD backpack: http://www.adafruit....products_id=292 http://www.ladyada.n...spilcdbackpack/ Of course it already supported the SPI mode but now you can choose I2C as well (however I found that I2C is 2-3 times slower than SPI). Please see new example project HelloWorld_I2C for demonstration on how to use the new provider. This release also incorporates the ShifterSetup as sugested by sweetlilmre in this thread. This enables anyone to configure mapping of the shifter outputs to LCD pins. You can pass your setup via optional parameter to shifter constructors.

#28 Spike

Spike

    Member

  • Members
  • PipPip
  • 24 posts

Posted 08 December 2010 - 01:06 PM

I thought I would have another go at it, so I soldered all the connections to the LCD this time, and it worked fine thanks for your help :)

#29 sweetlilmre

sweetlilmre

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 08 December 2010 - 08:54 PM

I thought I would have another go at it, so I soldered all the connections to the LCD this time, and it worked fine thanks for your help :)


Hi I'm really glad to see you got it going :)
-(e)

#30 GDSever

GDSever

    Advanced Member

  • Members
  • PipPipPip
  • 81 posts
  • LocationNewark, DE

Posted 16 December 2010 - 04:53 PM

Of course it already supported the SPI mode but now you can choose I2C as well (however I found that I2C is 2-3 times slower than SPI). Please see new example project HelloWorld_I2C for demonstration on how to use the new provider.

I ordered one of the Adafruit I2C/SPI backpacks anticipating that my current ones that use a SerialPort would not work very well with the Netduino Mini (since I already want to use COM1 for XBee comms)... I anticipated heavy use of I2C in my circuit designs, so this fit right in with that plan.

Your code looks like it has the I2CBus speed set at 100KHz - have you tried upping it to 400KHz? I imagine it would still be slower than SPI, however it might help. I also wonder how well those would perform vs. my 19200 baud serial backpacks... I guess I'll have to wait until the Adafruit order is delivered and do some testing.

#31 Daniel J

Daniel J

    New Member

  • Members
  • Pip
  • 2 posts

Posted 08 July 2011 - 09:26 PM

Hi!

I've been trying to get this example to work, but have so far drawn a blank.

I have followed the blog post here and have the LCD wired up following the wiring in the article, I haven't put the backlight on the transistor, instead simply connecting it to the 5v on the netduino. - I can adjust the contrast on the LCD, so I can see blocks or nothing at all.

The LCD I have is a 5v one, will this work with the netduino / shift register example? or do I need to do some logic level conversion as well? (I am using the 5v supply pin on the netduino for the +ve).

Thanks

Daniel

#32 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 08 July 2011 - 09:30 PM

Hi and welcome to the Netduino Community!

I haven't put the backlight on the transistor, instead simply connecting it to the 5v on the netduino.

Try to put it to the ground.

The LCD I have is a 5v one, will this work with the netduino / shift register example?

Should be no problem at all, I have two 5V LCD's, 20x4 and 16x2, and both work fine :)
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#33 Daniel J

Daniel J

    New Member

  • Members
  • Pip
  • 2 posts

Posted 09 July 2011 - 05:52 PM

Hi and welcome to the Netduino Community!

Try to put it to the ground.

Should be no problem at all, I have two 5V LCD's, 20x4 and 16x2, and both work fine :)

Hi

Thanks for coming back to me so quickly!

I've just moved my circuit from a breadboard to vero board, just in case it was a wiring issue..

I've attached to this post the wiring I have used, taken from your blog post, and the code I'm using is this:
// Micro Liquid Crystal Library
// http://microliquidcrystal.codeplex.com
// Appache License Version 2.0 

using System.Threading;
using MicroLiquidCrystal;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace HelloWorld
{
    public class Program
    {
        public static void Main()
        {
            // create the transfer provider
            /* 
                        // Option 1: Use direct GPIO provider
                        // Initialize the library with the numbers of the interface pins
                        // Use wiring shown here http://arduino.cc/en/uploads/Tutorial/lcd_schem.png
                        var lcdProvider = new GPIO_LCD_TransferProvider(Pins.GPIO_PIN_D12, Pins.GPIO_PIN_D11, //Pins.GPIO_PIN_D10, 
                            //Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D6, 
                            Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D2);
            */

            // Option 2: Use shift register provider
            
            var lcdProvider = new Shifter74Hc595LcdTransferProvider(SPI_Devices.SPI1, Pins.GPIO_PIN_D10,
                Shifter74Hc595LcdTransferProvider.BitOrder.LSBFirst);

            // create the LCD interface
            var lcd = new Lcd(lcdProvider);

            // set up the LCD's number of columns and rows: 
            lcd.Begin(16, 2);

            // Print a message to the LCD.
            lcd.Write("hello, world!");

            while (true)
            {
                // set the cursor to column 0, line 1
                lcd.SetCursorPosition(0, 1);

                // print the number of seconds since reset:
                //lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());
                //Thread.Sleep(100);
            }
        }
    }
}

The LCD is lighting up, and if I adjust the contrast the first line of the LCD moves from either solid blocks to blank screen.

Any ideas gratefully received!

Thanks

Daniel

Attached Files



#34 pater

pater

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationWarsaw

Posted 15 July 2011 - 08:18 AM

Hello,
I have one problem, after connecting all like in tutorial. With full contrast i have only visible second line of white block. Does someone know why first line of blocks didn't appear ?

Regards,
Pater

Edit:
LCD has T6963C LSI controller with 8 bit parallel data bus instead of HD44780.


#35 pater

pater

    Member

  • Members
  • PipPip
  • 11 posts
  • LocationWarsaw

Posted 29 July 2011 - 04:16 PM

Hello, I wrote a simple extension of Szymon's library adding some effect for displaying words, maybe someone finds it interesting. pater Attached File  MFExtendedLCD.zip   82.31KB   49 downloads Attached File  DemoLCD.zip   93.83KB   52 downloads

#36 AJB2K3

AJB2K3

    Advanced Member

  • Members
  • PipPipPip
  • 46 posts

Posted 29 July 2011 - 08:00 PM

Screen shots or any-more information?

"Maybe it's because you're a crap programmer"


#37 Pablo

Pablo

    New Member

  • Members
  • Pip
  • 7 posts

Posted 07 August 2012 - 10:50 PM

Hi, I´m trying to make to work the Adafrut I2C/SPI backpack with OLED display, using SPI. I can see the same garbage in the display, every time. This OLED display work good with GPIO wiring. What I am doing wrong? Regards, Pablo.

Attached Files



#38 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 08 August 2012 - 12:44 AM

Pablo,

I just assembled an Adafruit I2C Negative RGB LCD shield, but didn't get a chance to play with it.

It seemed fairly easy to connect. Try checking out Stefan's Toolbox I am sure that he has some great sample code included with it. Adafruit RGB LCD Display

It is always good to include pictures but I could not see enough to help.

If you can provide information on the OLed display or a link. The code would help if you can list or attach it.

Chuck

#39 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 08 August 2012 - 01:38 AM

Hi,

I´m trying to make to work the Adafrut I2C/SPI backpack with OLED display, using SPI.
I can see the same garbage in the display, every time.
This OLED display work good with GPIO wiring.
What I am doing wrong?
Regards, Pablo.


Can you share some of your code so we can help debug the issue. I've used the backpack with several displays using both I2C and SPI and it worked fine.

#40 Pablo

Pablo

    New Member

  • Members
  • Pip
  • 7 posts

Posted 08 August 2012 - 03:27 AM

Pablo,

I just assembled an Adafruit I2C Negative RGB LCD shield, but didn't get a chance to play with it.

It seemed fairly easy to connect. Try checking out Stefan's Toolbox I am sure that he has some great sample code included with it. Adafruit RGB LCD Display

It is always good to include pictures but I could not see enough to help.

If you can provide information on the OLed display or a link. The code would help if you can list or attach it.

Chuck


Hi,

This is the display http://www.adafruit.com/products/823
Regards, Pablo




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.