Driver for LCD display Nokia 5110

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
krzysiu
Posts: 5
Joined: Sat Aug 12, 2017 3:45 pm

Re: Driver for LCD display Nokia 5110

Post by krzysiu » Sat Aug 12, 2017 4:33 pm

Hi,

I trying to use your exemple but my display not working ?? i find other example but not with micropython board.

sommeone can help me please. ?? :P

krzysiu
Posts: 5
Joined: Sat Aug 12, 2017 3:45 pm

Re: Driver for LCD display Nokia 5110

Post by krzysiu » Sun Aug 13, 2017 6:12 am

sorry my first post are posted so fast :oops:

I connected my micro python to LCD Screen like this :
RST =>Y4
CE => Y5
DC => Y3
LIGHT =>Y2
PWR =>Y1
CLK => Y6
DCIN => Y7

And i use this exemple :

https://github.com/mbirth/wipy-upcd8544

it not work :cry:

can you help me please.... :)

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Driver for LCD display Nokia 5110

Post by deshipu » Sun Aug 13, 2017 10:23 am

Dear krzysiu, how are you trying that example, what are you doing exactly, what are your connection and how it is not working — what results do you get? Also, how do you imagine we can help you here?

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Driver for LCD display Nokia 5110

Post by mcauser » Mon Aug 14, 2017 2:29 am

I wrote a library for the Nokia 5110's PCD8544 lcd driver: https://github.com/mcauser/micropython-pcd8544
I have it working with an ESP8266, but changing it to work with the pyboard should be straight forward.
See the readme for examples.

krzysiu
Posts: 5
Joined: Sat Aug 12, 2017 3:45 pm

Re: Driver for LCD display Nokia 5110

Post by krzysiu » Mon Aug 14, 2017 2:22 pm

Thanks for your responses,

@ deshipu, I think it's just connection probleme, with LCD board and micropython... @mcauser, i see your readme, and your code where your decribe how to connect on micropython (but i'm not very easy in english :oops: :roll: ).

this week i try it another... and tell you my results or not :D

it is not possible to add photos in this forum ?

Best regards
Krzysiu

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Driver for LCD display Nokia 5110

Post by pythoncoder » Tue Aug 15, 2017 5:29 am

krzysiu wrote:...it is not possible to add photos in this forum ?...
Yes, but only after a new user has posted a few times. This is to protect against spambots.
Peter Hinch
Index to my micropython libraries.

krzysiu
Posts: 5
Joined: Sat Aug 12, 2017 3:45 pm

Re: Driver for LCD display Nokia 5110

Post by krzysiu » Tue Aug 15, 2017 4:01 pm

Thanks

I try to explain you exactly my connection:

LCD Nokia <=> Micropython (Y Side)
RST <=> Y4
CE <=> Y5
DC <=> Y3
Din <=> Y7
Clk <=> Y6
Vcc <=> Y1
BL <=> Y2
Gnd <=> Gnd


i think Vcc - Y1 is a mistake ?

Vcc - 3,3volt or 5volt is correct ? ( i try it but not work )

BL = Back Ligth (?), must be connected to 3,3 volt too ?
I am sorry for basic question, but i am just starting use micropython, i am only a developper... :oops:

my code :

Code: Select all

from machine import SPI, Pin
import pcd8544
# WiPy (on Exp board, SD and User-LED jumper have to be removed!)
#SPI    = machine.SPI(0)   # GP14 (CLK) + GP16 (MOSI->DIN), User-LED jumper removed!
#RST    = machine.Pin('GP24')
#CE     = machine.Pin('GP12')
#DC     = machine.Pin('GP22')
#LIGHT  = machine.Pin('GP23')
# PWR    = directly from 3V3 pin of the WiPy

#SPI    = pyb.SPI(1)
#RST    = pyb.Pin('Y4')
#CE     = pyb.Pin('Y5')
#DC     = pyb.Pin('Y3')
#LIGHT  = pyb.Pin('Y2')
#PWR    = pyb.Pin('Y1')
#

spi = pyb.SPI(1)
spi.init(baudrate=8000000, polarity=0, phase=0)
cs = pyb.Pin('Y5')#Pin(2)
dc = pyb.Pin('Y3')#Pin(15)
rst = pyb.Pin('Y4')#Pin(0)

# backlight on
bl = pyb.Pin('Y2',pyb.Pin.OUT, value=1) #Pin(12, Pin.OUT, value=1)

lcd = pcd8544.PCD8544(spi, cs, dc, rst)

# test pattern (50% on)
lcd.data(bytearray([0x55, 0xAA] * 42 * 6))

......

Thanks for your help ...

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Driver for LCD display Nokia 5110

Post by mcauser » Tue Aug 15, 2017 9:07 pm

Change Din <=> Y7 to Din <=> Y8.
Y7 = miso
Y8 = mosi

vcc should be connected to 3v3. This is how you power the display.

BL is the led backlight behind the display. You can either connect it to a GPIO pin and control it with software, or connect it to 3v3 to have it always lit. The display is readable without the backlight, so it's optional.

Try calling lcd.reset() and lcd.init().

krzysiu
Posts: 5
Joined: Sat Aug 12, 2017 3:45 pm

Re: Driver for LCD display Nokia 5110

Post by krzysiu » Wed Aug 16, 2017 1:08 pm

Ok,

i change Din

I look at my code, I think the problem must come from there. This time it seems to work better the BL reacts.
When i test lcd.init () the program stop

Code: Select all

import pyb
from pyb import LED
from pyb import SPI #, Pin
import upcd8544 #pcd8544

##
# WiPy (on Exp board, SD and User-LED jumper have to be removed!)
#SPI    = machine.SPI(0)   # GP14 (CLK) + GP16 (MOSI->DIN), User-LED jumper removed!
#RST    = machine.Pin('GP24')
#CE     = machine.Pin('GP12')
#DC     = machine.Pin('GP22')
#LIGHT  = machine.Pin('GP23')
# PWR    = directly from 3V3 pin of the WiPy

#SPI    = pyb.SPI(1)
RST    = pyb.Pin('Y4')
CE     = pyb.Pin('Y5')
DC     = pyb.Pin('Y3')
LIGHT  = pyb.Pin('Y2')
PWR    = pyb.Pin('Y1')
##

#spi = pyb.SPI(1)
#spi.init(baudrate=8000000, polarity=0, phase=0)
spi = SPI(1,SPI.MASTER,baudrate=8000000, polarity=0, phase=0)

cs = pyb.Pin('Y5')#Pin(2)
dc = pyb.Pin('Y3')#Pin(15)
rst = pyb.Pin('Y4')#Pin(0)

## backlight on
bl = pyb.Pin('Y2',pyb.Pin.OUT, value=1) #Pin(12, Pin.OUT, value=1)

#lcd = upcd8544.PCD8544(spi, cs, dc, rst)
lcd = upcd8544.PCD8544(spi, RST, CE, DC, LIGHT)

lcd.reset()
lcd.init()

# test pattern (50% on)
#lcd.data(bytearray([0x55, 0xAA] * 42 * 6))

led = LED(4) # for testing code
led.on()

Post Reply