Nokia 5110 display with Arduino Pro Micro

Hello,

I've been making some tests with de Nokia LCD display using the Nokia_5110_LCD library and Arduino Uno. Everything worked fine but for this project I need to use Arduino Pro micro. I wired the board with the display and it compiles but nothing shows. The library says it should be compatible with all Arduino boards.

RST- pin 5
CE- pin 6
DC- pin 7
DIN- pin 16
CLK- pin 15
VCC- vcc
GND- gnd

Here is the code:

#include <Nokia_LCD.h>

// https://platis.solutions logo with vertically oriented bytes.
// The bitmap was generated via the `LCD Assistant` utility.
const unsigned char platis_solutions_logo[504] PROGMEM = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
  0xC0, 0xE0, 0xE0, 0xF0, 0xF8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE,
  0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE,
  0xFE, 0xFC, 0xFC, 0xFC, 0xF8, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0,
  0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03, 0x06,
  0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x7F, 0x3F, 0x0F, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x3F, 0x7F, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC0, 0xC0,
  0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xF0, 0xF0,
  0x78, 0x1C, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
  0x03, 0x07, 0x0F, 0x1F, 0x1F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0xFF, 0xFF,
  0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F,
  0x7F, 0x7F, 0x7F, 0x3F, 0x3F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x01, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

//Nokia_LCD lcd(15 /* CLK */, 16 /* DIN */, 2 /* DC */, 3 /* CE */, 5 /* RST , 9 /* BL */);
 //Or, if you would like to control the backlight on your own, init the lcd without the last argument
 Nokia_LCD lcd(15, 16, 2, 3, 5);


void setup() {

  pinMode (15, OUTPUT);
  pinMode (16, OUTPUT);
  pinMode (2, OUTPUT);
  pinMode (3, OUTPUT);
  pinMode (5, OUTPUT);
  
  // Initialize the screen
  lcd.begin();
  // Turn on the backlight
  lcd.setBacklight(true);
  // Set the contrast
  lcd.setContrast(60);  // Good values are usualy between 40 and 60
  // Clear the screen by filling it with black pixels
  lcd.clear(true);
  delay(2000);
  // Draw the platis.solutions logo on your screen
  lcd.draw(platis_solutions_logo,
           sizeof(platis_solutions_logo) / sizeof(platis_solutions_logo[0]),
           true);
  delay(3000);
  // Clear the screen by filling it with white pixels
  lcd.clear();
  // Turn off the backlight
  lcd.setBacklight(false);
  // Set the cursor on the beginning of the 6th row (the last one)
  lcd.setCursor(0, 5);
  // Write something on the specific row with inverted color
  lcd.setInverted(true);
  lcd.print("Hello world!");
  lcd.setInverted(false);
  // The cursor is still on the 6th row. Newline characters ('\n') move the
  // cursor to the next line. Since we were on the last row, the cursor goes
  // back to the first line. If you check the return value of `println`
  // it will indicate whether an out-of-bounds error occured. In this case it
  // will be `true`.
  lcd.println("\nI am here.");
}

void loop() {
  // put your main code here, to run repeatedly:
}

I don't see what is wrong.

Thanks for taking the time to read.

Pro Micro does use a different chip compared to Uno (atmega32u4 Vs atmega328) so that may be the reason, but it should still work ok. I can't immediately see a problem with the code.

What model of Pro Micro? Is it the 3.3V/8MHz version?

Try gently pushing on the screen with your finger.

You instantiate with 2 DC and 3 CE, yet you state CE- pin 6 and
DC- pin 7 above that?

Steve

It is a 5.V/16MHz version.
:confused:

Oh yes! My bad!

I satated them wrongly because I tried the connection in many pins but I left it on 2 for DC and 3 for CE.
This is because I soldered the board myself and I hope all connections are working so tried with all the digital pins.
Btw, any advice to check that? (I bought a multimiter but I haven't had the time to understand how to implement it in this case. )

Thanx

I'm not sure if this is important, but you are setting the backlight when you did not give the pin for the backlight in the constructor.

Update !

Thanx for all the advices and responses :slight_smile:

Somehow it started working. I pressed the Pro Micro into the breadboard a little harder and I'm sure that did the trick.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.