GLCD Library Support for PIC24H with ST7565R / ST7565P / PCD8544 (Nokia 3310 5510) LCDs

My graphic LCD library (glcd on GitHub) now supports PIC24H with the ST7565R, ST7565P and PCD8544 LCD controllers.

The code has been tested with the Newhaven display NHD-C12864A1Z-FSW-FBW-HTT and NHD-C12832A1Z-FSW-FBW-3V3. I used a Microstick II development board to test these, with demo code available below. I don’t have any PIC24F chips so I wasn’t able to test it with those chips as well (I think I have lost the chip from the Microstick II package). I would think only minor changes would be needed to make it work with PIC24F.

Sample code

Sample code for use with MPLAB X IDE.

Here are some sample projects:

Note that the glcd libraries included with the demos above are not kept up to date as further updates are made to the official glcd library. You can update the library by copying the latest glcd distribution into the existing project files. (take note of custom pin configurations, more details below)

Pin configuration

With the projects above, the pin connections to the LCD’s SPI interface are as follows:

  • SDA (serial data input) => RB14
  • SCK (serial clock) => RB15
  • SS / CS (chip select) => RB2
  • A0 (command / data write selection) => RB3
  • RESET => RA2

To add your own custom pin configuration, you can edit the file ‘devices/PIC24H.h’. You can also make a custom configuration file by creating a `glcd_user_config.h’ file outside of the glcd directory and defining a new compiler symbol ‘GLCD_USER_CONFIG’. Copy the contents of ‘PIC24H.h’ into it. This way, if you need to  update the library, you can simply overwrite the contents of the existing glcd directory without losing your custom pin configuration. Otherwise, you can just keep track yourself of custom changes made to the *.h files in the ‘devices/’ directory.

Videos

Footage of Newhaven Display NHD-C12864A1Z-FSW-FBW-HTT in action, running the sample code:

Footage of Newhaven Display NHD-C12832A1Z-FSW-FBW-3V3 in action, running the sample code:

3 thoughts to “GLCD Library Support for PIC24H with ST7565R / ST7565P / PCD8544 (Nokia 3310 5510) LCDs”

  1. Hi,

    This is a very impressive work!

    I am wandering if I could get your opinion if you think this library could work with a pic18 controller?

    Our project would run on a PIC18F46k22 with a NHD-C12864A1Z-FSW-FBW-HTT.

    Thanks,
    Pierre-Luc

    1. Hi Pierre,

      Thanks. I don’t see why this library could be made to work with a PIC18 MCU and that what I am guessing is a ST7565 based LCD. There would be modifications required to make it work. Unfortunately I don’t have the chip + LCD dev combo to actually test and get it running!

      Andy

  2. There is a Python library for the ST7565P-based device. Is it going to work for the ST7565R-based device too? Both devices have the same size, 128 x 64. If not, what is necessary to adapt ST7565P library for ST7565R?

Leave a Reply

Your email address will not be published. Required fields are marked *