PCD8544 driver module (Nokia 5110 lcds)

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
mbirth
Posts: 25
Joined: Mon Oct 20, 2014 1:00 pm
Location: Berlin, Germany
Contact:

PCD8544 driver module (Nokia 5110 lcds)

Post by mbirth » Sun Nov 15, 2015 2:15 pm

In a thread in the Hardware Projects group there was a non-working module for PCD8544 lcd modules. The PCD8544 controller is used in e.g. Nokia 5110 LCDs. Since I also ordered these type of lcds for my WiPy, I wrote a module myself. Basic functionality works fine. I'll spice it up in the near future.

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

It's only tested with the WiPy, but I tried to make the code pyBoard-compatible. So if you like to test it, please tell me if it worked.

nb: It seems some LCDs have the backlight LEDs connected to GND, so you have to apply Vcc on the LIGHT pin and other LCDs have it the other way around so you have to apply GND to the LIGHT pin. Just so you don't wonder why it doesn't light up. My module currently only handles the latter variant.
pyBoard v1.0 + LCD32MKv1.0 | WiPy + Expansion Board | GitHub

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by pfalcon » Mon Nov 16, 2015 11:22 am

In a thread in the Hardware Projects group there
That thread is probably for a reason in that group, and we'd like to reach more users, the best idea is to continue it, not post another thread elsewhere (especially in the subforum not related to hardware).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

dalex
Posts: 11
Joined: Wed Aug 06, 2014 6:18 pm

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by dalex » Fri Jun 24, 2016 8:03 pm

Anyone got this working?
I'm trying on the ESP8266-12e.
At this point in the code:
spi.init(spi.MASTER, baudrate=328125, bits=8, polarity=0, phase=1, firstbit=spi.MSB)
I get the message
AttributeError: type object 'SPI' has no attribute 'MASTER'
Similarly for 'MSB'. It also doesn't seem to recognize the 'bits' keyword.
If I omit all three, it doesn't complain, just hangs at the point of initializing the main class.

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

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by deshipu » Sat Jun 25, 2016 3:09 pm

That's why the drivers shouldn't try to create their own spi objects, but instead take one as a parameter. Different platforms have different ways of initializing spi and different parameters allowed.

User avatar
mbirth
Posts: 25
Joined: Mon Oct 20, 2014 1:00 pm
Location: Berlin, Germany
Contact:

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by mbirth » Sat Jun 25, 2016 9:31 pm

deshipu wrote:That's why the drivers shouldn't try to create their own spi objects, but instead take one as a parameter. Different platforms have different ways of initializing spi and different parameters allowed.
Oh, it takes an SPI object as parameter. But for some reason, different platforms have completely different constants and parameters for the same thing. And things like the serial protocol setup are device-specific and belong into the driver IMHO.
pyBoard v1.0 + LCD32MKv1.0 | WiPy + Expansion Board | GitHub

dalex
Posts: 11
Joined: Wed Aug 06, 2014 6:18 pm

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by dalex » Sun Jun 26, 2016 8:44 am

I've been looking for the correct syntax on the ESP8266 to write this spi initialization, but no success.
How does one indicate the master status, endian and bits in this case?
I guess it can worked out with some pain by digging around in the code-base, but perhaps there is a place with use examples?

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

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by deshipu » Sun Jun 26, 2016 9:18 am

dalex wrote:How does one indicate the master status, endian and bits in this case?
One does not. The esp8266 bit-banged SPI is very simple and doesn't support changing those parameters.

mflmartin
Posts: 43
Joined: Sat Jul 23, 2016 7:30 pm

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by mflmartin » Tue Aug 02, 2016 6:06 pm

Is there any update in this ? Would be nice to interface with Nokia LCD's :)

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

Re: PCD8544 driver module (Nokia 5110 lcds)

Post by mcauser » Mon Aug 29, 2016 12:17 pm


Post Reply