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 question


  • Please log in to reply
11 replies to this topic

#1 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 08 May 2011 - 02:18 AM

Hi,
Just got this 16x2 HD44780 controller from Hacktronics. After reading for a while, and realizing that using just the specified the Arduino wiring is not enough, I landed on Pete Brown's blog post.

I followed his instructions (almost) to the letter:
  • I soldered the head pins into place (been a while - man, I'm rusty)
  • I checked the continuity of my 16 pins
  • I connected all pins as specified in the post, using a mini breadboard, with the exception of Pin 3.
    I do not have a potentiometer, so I just connected that pin to GND
    Attached File  lcdPins.png   20.82KB   61 downloads
  • I downloaded the library from Codeplex
  • I added the sample code specified in the article
    public static void Main()
    {
        var lcdProvider = new GpioLcdTransferProvider(
            Pins.GPIO_PIN_D12,  // RS
            Pins.GPIO_NONE,     // RW
            Pins.GPIO_PIN_D11,  // enable
            Pins.GPIO_PIN_D9,   // d0
            Pins.GPIO_PIN_D8,   // d1
            Pins.GPIO_PIN_D7,   // d2
            Pins.GPIO_PIN_D6,   // d3
            Pins.GPIO_PIN_D5,   // d4
            Pins.GPIO_PIN_D4,   // d5
            Pins.GPIO_PIN_D3,   // d6
            Pins.GPIO_PIN_D2);  // d7
     
        // create the LCD interface
        var lcd = new Lcd(lcdProvider);
     
        // set up the 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);
        }
    }
    

What I got is an LCD in the "on" state showing one line of blocks and nothing I try get it to show anything.
Attached File  lcd.png   1.65MB   61 downloads
From this I deduce I must have been doing something right, to get the controller powered, but I must be missing something as well.

My only guesses are:
  • I screwed something up while soldering (although then I'd expect this to not work at all)
  • The potentiometer is a must for Pin 3 - skipping it might have done something
  • The list of connections Pete specified is not correct for my board/controller (I have an N+)

Any ideas of what am I doing wrong/missing?

Thanks,
Guy

#2 Veetrik

Veetrik

    Member

  • Members
  • PipPip
  • 12 posts

Posted 08 May 2011 - 03:28 AM

I have use the LCD on a Arduino without a potentiometer. But I used a 330 ohm (Orange, Orange Brown) on pin 3 connected to ground.

#3 Veetrik

Veetrik

    Member

  • Members
  • PipPip
  • 12 posts

Posted 08 May 2011 - 03:30 AM

You might want to try connecting pin3 to 220 (Red Red, Brown) or 330 ohm resistor (Orange, Orange, Brown) to ground.

#4 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 08 May 2011 - 04:16 AM

It is normal to see black blocks when the brightness regulation (i.e. the pot) is missing. By tying the brightness control to +5V, you won't see anything: it looks as powered off. I don't think just only one resistor would be enough, because you should provide a certain voltage to that pin. I have used two resistors: the first is 680 Ohms to the ground, the second is 10KOhms to the +5V. In this way the voltage on the pin is: 5*680/(10K+680) = 0.32V Cheers
Biggest fault of Netduino? It runs by electricity.

#5 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 08 May 2011 - 03:35 PM

You did say 16x2 so why do you set it to 16x4 in the code ? And I did it using 1K potentiometer for the brightness and it works fine :)
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !

#6 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 08 May 2011 - 04:38 PM

The Hitachi chip was very well designed. It manages always a 40x4 matrix (if I remember well), and the only difference is the LCD itself. If the display is limited to 16x2 chars, is only a problem of visibility area. I used the off-display ram to store extra data. A 1K pot is working good as well, but it makes flowing a current 10x uselessly. The ideal is a 50K pot. Cheers
Biggest fault of Netduino? It runs by electricity.

#7 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 08 May 2011 - 07:26 PM

I am having difficulty connecting the LCD through a 74HC595 ... Problem solved ... usb froze and the potentiometer I was using was too strong ... lol cool !
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !

#8 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 08 May 2011 - 08:12 PM

You did say 16x2 so why do you set it to 16x4 in the code ? And I did it using 1K potentiometer for the brightness and it works fine :)


Actually, my code does say (16, 2) - I just copy-pasted from Pete's blog. But thanks for the catch - corrected the original question.

#9 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 08 May 2011 - 08:14 PM

Thanks for all the replies, and I'll go out and get a 10k pot + a bunch of resistors later today.
But I still do have a question: if this has something to do with the brightness (lack of resistance on Pin 3), shouldn't I be seeing 2 lines of blocks rather than one? Will adding resistance solve the problem, or just move me to the next one? :)

#10 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 09 May 2011 - 03:32 AM

My circuit using a 16x2 display is still working on my breadboard. I used the 74HC595 and the SPI because it took only three ports. Anyway, the only "problem" I had was just the brightness: at the very first the circuit seems not working, then by adjusting the pot magically the "Hello world" appeared! I wouldn't worried about the one-line-of-blocks: just add the pot, then we will talk about. Cheers
Biggest fault of Netduino? It runs by electricity.

#11 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 13 May 2011 - 08:54 PM

Update 5/13: Just received my 10K potentiometer, and wired it as follows:
LCD Pin 3 to Pot Leg 2
Pot Leg 1 to GND
Pot Leg 3 to 5V

Turning the Pot does change the LCD brightness, however, I'm still seeing just one row of blocks.
I stepped through the program in VS - nada.

What am I missing here? What's my next step?

Thanks,
Guy

#12 Traveling Tech Guy

Traveling Tech Guy

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

Posted 13 May 2011 - 11:05 PM

SOLVED!
Well, what do you know? It was my $#itty soldering after all!

After racking my brain, re-wiring the LCD, checking each line of code and visiting tons of blogs (thank you all),
I finally went back to basics: I bought a real soldering station and got rid of the Fry
s $10 house burner. I also got a nice solder sucker.

I de-soldered all my connections, re-soldered them at 700F, re-wired one last time, and presto! It works. Attached image proof :)

Attached File  lcd.png   469.93KB   41 downloads

Thank you all for your suggestions, and for getting me to get a potentiometer. Now to wire in some sensors :)

Guy




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.