chipKIT® Development Platform

Inspired by Arduino™

Nokia 5110 GLCD library and wire library cause program hang

Created Wed, 15 Jun 2016 00:44:33 +0000 by andcvi


Wed, 15 Jun 2016 00:44:33 +0000

I have been playing around with the Nokia 5110 display library from Rinky-Dink Electronics and also I2c devices on my Cmod type board which uses the Cmod bootloader.

The demo programs for the Nokia work without any problems and the I2c devices I have tested LSM303 and I2c LCD display work as well separate to the Nokia 5110 library, but if I combine the libraries then my program hangs, if I delete out the Wire.begin(); and the compass lines then the graphics demo works.

I have also tried an Adafruit PCD8544 library for Chipkit boards, same result.

any solution to this problem would be greatly appreciated.

// LCD5110_Graph_Demo 
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web:
// This program is a demo of most of the functions
// in the library.
// This program requires a Nokia 5110 LCD module and home-made Cmod board
// It is assumed that the LCD module is connected to
// the following pins:
//      SCK  - Pin 19
//      MOSI - Pin 24
//      DC   - Pin 26
//      RST  - Pin 30
//      CS   - Pin 25
#include <LCD5110_Graph.h>
LCD5110 myGLCD(19,24,26,30,25);
extern unsigned char SmallFont[];
extern unsigned char MediumNumbers[];

#include <Wire.h>
#include <LSM303.h>
LSM303 compass;

void setup()

  // Calibration values. Use the Calibrate example program to get the values for
  // your compass.
  compass.m_min.x = -520; compass.m_min.y = -570; compass.m_min.z = -770;
  compass.m_max.x = +540; compass.m_max.y = +500; compass.m_max.z = 180;


void loop()
  int heading = compass.heading((LSM303::vector){0,-1,0});
  myGLCD.print(" Heading ", CENTER, 10);
  myGLCD.printNumI(heading, CENTER, 20);



[attachment=0]Chipkit Nokia 5110[/attachment]


Wed, 15 Jun 2016 08:07:06 +0000

Which version of the ide are you using? This sounds like a double begin problem that existed a while back.

Sent from my One Mini 2 using Tapatalk


Wed, 15 Jun 2016 23:11:45 +0000

hello majenko,

Thanks for the reply.

Doesn't matter which IDE I use, mpide-0150, Arduino 1.6.7 or UECIDE 0.8.8alpha22, same result.

Anyway, I use UECIDE pretty much most of time since I downloaded it.