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

Nokia 5100 LCD - Controlling Contrast


  • Please log in to reply
3 replies to this topic

#1 attachgenerator

attachgenerator

    New Member

  • Members
  • Pip
  • 2 posts

Posted 17 June 2012 - 01:22 AM

Issue: Fix Contrast in LCD display

I have a Nokia 5110 84x48 pixels monochrome LCD (http://www.sparkfun.com/products/10168) attached to a Netduino Plus, as indicated in this Wiki post: Nokia 5100 LCD
I am using the Driver available there (thanks Omar!), and I can successfully display text and bitmaps, and control the backlight.

The problem that I am having is with readability of the display: The "off" pixels are too dark, specially when looking directly straight to the screen. In order to be able to read, you have to look at the screen at a 30-60 degree angle. I assume it must be a contrast issue, but I have no idea how to tweak the contrast in this device. Any pointers are appreciated.

Attached is a screenshot of the issue.

Attached Files



#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 17 June 2012 - 02:19 PM

Contrast is controlled by the VOP value, it is the second byte sent during the initialization sequence (0xBF), the formula and range is described in the controller datasheet (p. 16).

#3 attachgenerator

attachgenerator

    New Member

  • Members
  • Pip
  • 2 posts

Posted 17 June 2012 - 05:32 PM

Indeed, last night I spent some time researching and found this information in the datasheet, and also got some references from the code samples found in Sparkfun, and on this thread (LCD help needed).

This is a snippet of the edited Nokia.LCDScreens.Nokia_5110 class, with each byte's meaning explained:
private void Initialize()
        {
            reset.Write(false);
            reset.Write(true);

            dataMode.Write(false);
            spi.Write(new byte[] 
              { 0x21, // LCD Extended Commands.
                0xB1, // Set LCD Vop (Contrast). //0xB0 for 5V, 0XB1 for 3.3v, 0XBF if screen too dark
                0x04, // Set Temp coefficient. //0x04
                0x14, // LCD bias mode 1:48. //0x13 or 0X14
                0x0C, // LCD in normal mode. 0x0d for inverse
                0x20, // We must send 0x20 before modifying the display control mode
                0x0C // Set display control, normal mode. 0x0D for inverse, 0x0C for normal
            });
            dataMode.Write(true);

            Clear();
            Refresh();
        }

The provided code in the wiki has LCD Vop = 0xBF, which was too dark for me, so I tried 0xB1 and the contrast is great.

#4 hunter0720

hunter0720

    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 September 2014 - 11:41 PM

Hi guys!!! I know its been a long while ago since last post, but im wondering if someone still sees this...

 

Im having troubles writing with the library given by Omar (btw, thanks dude!!!) I can draw points, lines, and rectangles...

 

Right now i have a square moving around the lcd.

 

The only thing i cannot do is write :(...

 

How am i suppossed to do this? im using lcd.writetext("string"), and nothing appears :/

 

Ive fixed already the contrast using the recommendation by attachgenerator (thx dude!)

 

Cya guys!!!






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.