Page 1 of 1

PCD8544 driver module (Nokia 5110 lcds)

Posted: Sun Nov 15, 2015 2:15 pm
by mbirth
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.

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Mon Nov 16, 2015 11:22 am
by pfalcon
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).

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Fri Jun 24, 2016 8:03 pm
by dalex
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.

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Sat Jun 25, 2016 3:09 pm
by deshipu
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.

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Sat Jun 25, 2016 9:31 pm
by mbirth
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.

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Sun Jun 26, 2016 8:44 am
by dalex
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?

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Sun Jun 26, 2016 9:18 am
by deshipu
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.

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Tue Aug 02, 2016 6:06 pm
by mflmartin
Is there any update in this ? Would be nice to interface with Nokia LCD's :)

Re: PCD8544 driver module (Nokia 5110 lcds)

Posted: Mon Aug 29, 2016 12:17 pm
by mcauser