Page 2 of 2

Re: Driver for LCD display Nokia 5110

Posted: Sat Aug 12, 2017 4:33 pm
by krzysiu
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

Re: Driver for LCD display Nokia 5110

Posted: Sun Aug 13, 2017 6:12 am
by krzysiu
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.... :)

Re: Driver for LCD display Nokia 5110

Posted: Sun Aug 13, 2017 10:23 am
by deshipu
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?

Re: Driver for LCD display Nokia 5110

Posted: Mon Aug 14, 2017 2:29 am
by mcauser
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.

Re: Driver for LCD display Nokia 5110

Posted: Mon Aug 14, 2017 2:22 pm
by krzysiu
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

Re: Driver for LCD display Nokia 5110

Posted: Tue Aug 15, 2017 5:29 am
by pythoncoder
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.

Re: Driver for LCD display Nokia 5110

Posted: Tue Aug 15, 2017 4:01 pm
by krzysiu
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 ...

Re: Driver for LCD display Nokia 5110

Posted: Tue Aug 15, 2017 9:07 pm
by mcauser
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().

Re: Driver for LCD display Nokia 5110

Posted: Wed Aug 16, 2017 1:08 pm
by krzysiu
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()