Sunday, February 17, 2013

Nokia 5110 LCD


Nokia 5110 LCD https://www.sparkfun.com/products/10168

Introduction

I started tinkering with sound the other day and one thing that I lack is some easy way to visualize the input from the microphone. Sure, I use processing but that implies serial communication that I believe takes a little time from the sampling. So I ordered myself an LCD screen the cheapest I could get my hands on. The Nokia 5110 Monochrome LCD display.

The datasheet says that:
"The PCD8544 is a low power CMOS LCD controller/driver,designed to drive a graphic display of 48 rows and84 columns. All necessary functions for the display areprovided in a single chip, including on-chip generation ofLCD supply and bias voltages, resulting in a minimum ofexternal components and low power consumption." - datasheet
Sounds great!

Implementation

I followed this Adafruit tutorial to wire things up. The only problem with this tutorial is that I got a LCD from Sparkfun and the tutorial show the Adafruit LCD and they differ slightly in pinout.
Adafruit pinout.
Sparkfun pinout
If you look closely you can see that they also use slightly different names. If you check the datasheet there are another set of names. So here is the conversion table:

Adafruit - Sparkfun -    Datasheet -                           (Pin on 4050)
1 GND -   2 GND -         VSS - Negative Power supply - (GND)
2 VCC -    1 VCC -          VDD - Positive Power Supply - (3.3V)
3 CLK -    7 SCLK-         SCLK: Serial Clock Line -          (12)
4 DIN -    6 DN(MOSI) - SDIN: Serial Data Line -           (15)
5 D/C -     5 D/C -           D/C: Mode Select -                   (6)
6 CS -      3 SCE -           SCE: Chip Enable -                   (4)
7 RST -    4 RST -           RES: Reset -                            (2)
8 LED -    8 LED -           VLCD1 LCD Power Supply      (3.3V)

In this tutorial Adafruit uses a "4050" chip as "level shifter". I bought the CD4050B from electrokit to use as level converters.


"The CD4049UB and CD4050B devices are inverting andnon-inverting hex buffers, respectively, and feature logiclevelconversion using only one supply voltage (VCC). Theinput-signal high level (VIH) can exceed the VCC supplyvoltage when these devices are used for logic-levelconversions." - cd4050b datasheet



CD4050B pinout from datasheet
CD4050B  from the datasheet



Code

https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library
https://github.com/adafruit/Adafruit-GFX-Library

I tested the same sketch as in the tutorial, and behold, it worked flawlessly

Running the Adafruit example demo
Next step is to connect this one to the circuit that measure sound and do some coding to visualize the sampling! But now it is time for breakfast!


No comments:

Post a Comment