Nokia 5110 LCD not working

Go To Last Post
36 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is my first time trying to use an LCD. I have tried driving this nokia 5110 LCD using various methods but had no results:

 

  1. I used an ATMega328p, AtmelStudio and GLCD Library (https://github.com/andygock/glcd)

  2. I used an Arduino nano clone and tried running various tutorial sketches from YouTube

 

If you are aware of a way to diagnose if it is a bad LCD please tell me. Also if you have some test code for Arduino or ATMega328p that you know is working well, please share it with me so I can test it again. I just need to get it to display anything to make sure it is not broken/bad at this point.

This topic has a solution.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Thu. Oct 1, 2020 - 05:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would expect Adafruit example to work, but I have not tried it: https://github.com/adafruit/Adaf...

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah I tried those .. didn't work. Also checked connectivity between arduino - display. Tried 3.3V then 5V for display. I tried the adafruit examples and a couple examples from youtubers. From 1 to 10 how possible is it that this display could be bad? As far as I know these LCDs are pretty durable. I did order it from China though and it could have had quite a ride during shipment.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

That setup looks vastly over-complicated relative to the Adafruit test setup:

 

https://learn.adafruit.com/nokia-5110-3310-monochrome-lcd/testing

 

Where did you get your display from?

 

A brand-new, genuine Sparkfun one seems to be under $10: https://www.sparkfun.com/product...

 

and a similarly-simple suggested setup:

 

https://learn.sparkfun.com/tutorials/graphic-lcd-hookup-guide

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In #3, tellSlater wrote:
I did order it from China

In #4, I wrote:
Where did you get your display from?

I think our posts must have crossed!

 

For under a tenner, I think it has to be worth getting a genuine Sparkfun one for reference ...

 

EDIT

 

Adafruit is a full tenner, but currently out of stock: https://www.adafruit.com/product... maybe other stockists have them in?

 

Are you sure that your Chinese version is actually compatible ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Sep 25, 2020 - 04:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Pretty sure these displays spark fun sells and on ebay are repurposed old Nokia 5110 displayes (mobile phone screens) and are identical. Local sellers here sell it for 5$ - I am thinking of buying another one after all the heartbreak I ve had. Adafruit has great products but also high prices. 10$ is x3 ebay pricing. (I measure everything in ebay pricing nowadays). The breadboard in the photo I posted had many things on it I am currently working on.. I am all out of breadboards too :/. But my setups is probably identical to the one in the 2nd picture you posted only without the resistors.

 

Edit: I am following the last example you posted to check once more if it will work

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Fri. Sep 25, 2020 - 04:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tellSlater wrote:
Adafruit has great products but also high prices.

But you get a known-working part, and support.

 

With ebay, you get nothing - it's a lottery.

This may be fine when you're experienced, know exactly what you're doing, and can diagnose problems.

 

I guess it all depends on how you value your own time ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tellSlater wrote:

Yeah I tried those .. didn't work. Also checked connectivity between arduino - display. Tried 3.3V then 5V for display. I tried the adafruit examples and a couple examples from youtubers. From 1 to 10 how possible is it that this display could be bad? As far as I know these LCDs are pretty durable. I did order it from China though and it could have had quite a ride during shipment.

Go on.   You have a 3.3V device.  If you connect VCC to 5V you will damage the screen.

You should connect VCC to 3.3V and use level shifters on each logic signal.

 

It is very important to use VCC=3.3V.  In theory the logic pins are not 5V compatible.   In practice they seem to be input voltage tolerant providing the VCC pin is <= 3.3V.

 

All the Arduino libraries should work just fine.  e.g. Adafruit_PCD8544 or U8g2lib

 

The big advantage of Arduino libraries is that they come with examples.

Copy the pinout used in examples.

 

When you have verified that the hardware is working,   you can change wiring and constructor.

And you can experiment with random C projects in AS7.0

 

I would bet that your Chinese display would have arrived in working order.   Only you know whether it was packed safely e.g. with foam / bubblewrap.

Only you know how much smoke you have let in or out.

Hey-ho.  If your display is damaged,  just buy another one.

 

David.

Last Edited: Fri. Sep 25, 2020 - 05:05 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
It is very important to use VCC=3.3V.  In theory the logic pins are not 5V compatible.

Thus the need for the series resistors.

 

Glad is was an inexpensive lesson, hope the next one works for you.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am aware this is a 3.3V display but after many tries I also risked hooking it up to 5V because I read a post about how this can help bring up the contrast more in case this is the problem.

I have been following Arduino examples all day. Didn't see smoke or smell something so far (I know the smell of a chip burning :| ). I received the screen many months ago and only now decided to use it so I don't remember what the packaging was.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

God did I really brick it? I followed videos like this: https://www.youtube.com/watch?v=...

He connects all logic pins directly to Arduino ports and the display's VCC to Arduino 3.3V . His display works fine... This makes no sense.

I also believed that when a pin is configured as input, it has high impedance and that's why I thought it would be ok to drive a 3.3V device with 5V on its logic pins. How wrong am I?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tellSlater wrote:
I followed videos like this: https://www.youtube.com/watch?v=...

Do real experts exist on youtube?  devil

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess that's why I end up in this forum every time.. should have known better

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tellSlater wrote:

God did I really brick it? I followed videos like this: https://www.youtube.com/watch?v=...

He connects all logic pins directly to Arduino ports and the display's VCC to Arduino 3.3V . His display works fine... This makes no sense.

I also believed that when a pin is configured as input, it has high impedance and that's why I thought it would be ok to drive a 3.3V device with 5V on its logic pins. How wrong am I?

 

It is very important to use VCC=3.3V.  In theory the logic pins are not 5V compatible.   In practice they seem to be input voltage tolerant providing the VCC pin is <= 3.3V.

When a logic pin is > PCD8544  VCC the substrate diodes conduct.   e.g. 5V logic with PCD8544 VCC=3.3V.

This does no harm if the substrate diode current is small.   e.g. external (or internal) series resistors.

Some integrated circuits are specifically designed to tolerate logic signals > VCC.

 

As I said,   the PCD8544 appears to tolerate the 5V logic in your video.    Other chips are less forgiving.

 

Personally,   I always use 3.3V logic as  Nature intended.    Using a 3.3V Zero, Due,  Teensy, ... is much simpler than external level shifters.

 

Regarding packaging.   If an item with a glass screen arrives through your letterbox in a thin plastic envelope it has probably got a cracked screen.

 

David.

Last Edited: Fri. Sep 25, 2020 - 07:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tellSlater wrote:

Adafruit has great products but also high prices.

To me, purchasing something that does not work is an awfully high price.

 

Jim 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your display is likely fine, or at least it was until you powered it at 5V !  frown

 

It is a 3V device.

Even the example running it with series resistors isn't really the "right" way to run it from 5V signals.

It IS reasonable to run the GLCD's inputs, from 5V signals, using simple two resistor voltage dividers on the signal lines, (The Vcc still needs to be 3V, not 5V).

 

Know that different "batches" of these displays need a different Contrast setting.

 

I, too, originally had trouble making the displays work, so I copied a working display setup routine from a working program on the web.

I then adjusted the Contrast up and down by 10, with multiple compiles and downloads, until I could suddenly see the data on the display.

(You could do this with a loop, but just re-compiling was faster and easier for me...)

 

ALSO, make sure you have a 0.5 Second startup delay, after you power up the board, before you try to write anything to the GLCD.

It takes a little time for the GLCD to do its own internal power up.

You can study the data sheet, or just give it some time.

 

Below is the setup values I'm using, check your code for the Contrast value, and try higher and lower values.

 

Do report back on your progress!

 

JC

 

Nokiasetup:
   'Initialize the Nokia GLCD Display Parameters
   '*** Note Well, SPIInit Reconfigures the SPI Pins for SPI ***
   'If were not using MISO and used it for something else, then this will
   'reset it for input mode....
   Spiinit                                                  'Init the uC SPI pin's status
 '  Waitms 1
   Reset Glcdcs                                             'GLCD Chip Select Active
 '  Waitms 1
   Reset Glcdrst                                            'Reset the GLCD
   Waitus 2                                                 'Overkill
   Set Glcdrst
   Waitms 1                                                 'Enable GLCD

   'Now send inits to GLCD
   Reset Glcdmode                                           'Mode, Command

'Setup from web, seven steps:  (Contrast value is specific for each display!)

   'Display is Active, (On), Horizontal Mode, Switch to Extended Commands:
   Glcddb = 33                                              'Extended Commands
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs

   Glcddb = 180                                             'Voop, (Contrast)
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs

   Glcddb = 4                                               'Temp Corf
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs


   Glcddb = 20                                              'Bias 1:48
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs

   Glcddb = 12                                              'Nl Mode
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs

   'Display is Active, (On), Horizontal Mode, Switch to Basic Commands:
   Glcddb = 32
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD
   Set Glcdcs

   Glcddb = 12
   Reset Glcdcs
   Spiout Glcddb , 1                                        'Send it to GLCD

   Set Glcdcs                                               'GLCD Chip Select Inactive

   Return

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It was on warranty when it arrived but I never checked if it worked - I bought it for future projects. Buying from ebay only comes with the risk of waiting 1 month and ending up with a broken item but you never lose your money through ebay warranty - this is not a sponsored comment. So to me - still worth buying 4 screens in stead of 1 in hopes that >=1 will work.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot! After trying countless such codes and messing with the resolution and having no results, I ordered a new one from a local seller that also comes with warranty. I will run your code on the new display. I will post again if I have results

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So here is what I tried on my new display and still had no result:

 

This Arduino sketch

// LCD5110_Graph_Demo
// Copyright (C)2015 Rinky-Dink Electronics, Henning Karlsen. All right reserved
// web: http://www.RinkyDinkElectronics.com/
//
// This program is a demo of most of the functions
// in the library.
//
// This program requires a Nokia 5110 LCD module.
//
// It is assumed that the LCD module is connected to
// the following pins using a levelshifter to get the
// correct voltage to the module.
//      SCK  - Pin 13
//      MOSI - Pin 11
//      DC   - Pin 5
//      RST  - Pin 6
//      CS   - Pin 7
//
#include <LCD5110_Graph.h>

LCD5110 myGLCD(13,11,5,6,7);

extern uint8_t SmallFont[];
extern uint8_t arduino_logo[];
extern unsigned char TinyFont[];
extern uint8_t The_End[];
extern uint8_t pacman1[];
extern uint8_t pacman2[];
extern uint8_t pacman3[];
extern uint8_t pill[];

float y;
uint8_t* bm;
int pacy;

void setup()
{
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
  randomSeed(analogRead(7));
}

void loop()
{
  myGLCD.setContrast(70);

  myGLCD.clrScr();
  myGLCD.drawBitmap(0, 0, arduino_logo, 84, 48);
  myGLCD.update();

  delay(2000);

  myGLCD.clrScr();
  myGLCD.print("LCD5110_Graph", CENTER, 0);
  myGLCD.print("DEMO", CENTER, 20);
  myGLCD.drawRect(28, 18, 56, 28);
  for (int i=0; i<6; i++)
  {
    myGLCD.drawLine(57, 18+(i*2), 83-(i*3), 18+(i*2));
    myGLCD.drawLine((i*3), 28-(i*2), 28, 28-(i*2));
  }
  myGLCD.setFont(TinyFont);
  myGLCD.print("(C)2015 by", CENTER, 36);
  myGLCD.print("Henning Karlsen", CENTER, 42);
  myGLCD.update();

  delay(5000);

  myGLCD.clrScr();
  for (int i=0; i<48; i+=2)
  {
    myGLCD.drawLine(0, i, 83, 47-i);
    myGLCD.update();
  }
  for (int i=83; i>=0; i-=2)
  {
    myGLCD.drawLine(i, 0, 83-i, 47);
    myGLCD.update();
  }

  delay(2000);

  myGLCD.clrScr();
  myGLCD.drawRect(0, 0, 83, 47);
  for (int i=0; i<48; i+=4)
  {
    myGLCD.drawLine(0, i, i*1.75, 47);
    myGLCD.update();
  }
  for (int i=0; i<48; i+=4)
  {
    myGLCD.drawLine(83, 47-i, 83-(i*1.75), 0);
    myGLCD.update();
  }

  delay(2000);

  myGLCD.clrScr();
  for (int i=0; i<8; i++)
  {
    myGLCD.drawRoundRect(i*3, i*3, 83-(i*3), 47-(i*3));
    myGLCD.update();
  }

  delay(2000);

  myGLCD.clrScr();
  for (int i=0; i<17; i++)
  {
    myGLCD.drawCircle(41, 23, i*3);
    myGLCD.update();
  }

  delay(2000);

  myGLCD.clrScr();
  myGLCD.drawRect(0, 0, 83, 47);
  myGLCD.drawLine(0, 23, 84, 23);
  myGLCD.drawLine(41, 0, 41, 47);
  for (int c=0; c<4; c++)
  {
    for (int i=0; i<84; i++)
    {
      y=i*0.017453292519943295769236907684886;
      myGLCD.invPixel(i, (sin(y*6)*20)+23);
      myGLCD.update();
      delay(20);
    }
  }

  delay(2000);

  for (int pc=0; pc<3; pc++)
  {
    pacy=random(0, 28);

    for (int i=-20; i<84; i++)
    {
      myGLCD.clrScr();
      for (int p=4; p>((i+20)/20); p--)
        myGLCD.drawBitmap(p*20-8, pacy+7, pill, 5, 5);
      switch(((i+20)/3) % 4)
      {
        case 0: bm=pacman1;
                break;
        case 1: bm=pacman2;
                break;
        case 2: bm=pacman3;
                break;
        case 3: bm=pacman2;
                break;
      }
      myGLCD.drawBitmap(i, pacy, bm, 20, 20);
      myGLCD.update();
      delay(25);
    }
  }

  for (int i=0; i<25; i++)
  {
    myGLCD.clrScr();
    myGLCD.drawBitmap(0, i-24, The_End, 84, 24);
    myGLCD.update();
    delay(100);
  }
  myGLCD.setFont(SmallFont);
  myGLCD.print("Runtime (ms):", CENTER, 32);
  myGLCD.printNumI(millis(), CENTER, 40);
  myGLCD.update();
  for (int i=0; i<5; i++)
  {
    myGLCD.invert(true);
    delay(1000);
    myGLCD.invert(false);
    delay(1000);
  }
}

 

I checked my connections several times and also made sure that the pins on my clone nano were correctly named by blinking an LED on each one of them.

The result should have been identical to what this video shows right at the start --> https://www.youtube.com/watch?v=...

 

a) An Arduino logo displays for 2 sec

b) A library logo displays for 5 sec

c) A line animation shows up

 

Still nothing shows up on my screen - even after trying several settings for contrast. I also used a multi-meter on continuity and on resistance mode to check on my connections - all seemed normal, still no results.

I used the connections recommenced by Sparkfun with limiting resistors:

 

 

My Arduino uses an old boot-loader... could this be a problem?

 

I used my Hantek osciloscope to take some captures of the pin signals from power up. I know there is not much definition at 1sec/division but the signals seem to be correct from afar. Cold you take a look at them as well?

 

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Thu. Oct 1, 2020 - 12:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is also a zoomed in version I was able to make around the time reset goes high:

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was intrigued by your "problem".   So I ran your sketch with 3.3V logic (and slightly different wiring).   It worked fine.

 

However your scope traces are appalling.   They seem to have 2us rise and fall on 5V signals.    2us could contain 32 AVR instructions.

I would expect rise and fall to be in nanoseconds !!

 

Incidentally,   when you use a library example it is best to just post a link to the library.   And quote the example by name. 

 

David.

 

p.s. I am that intrigued that I will copy your wiring exactly with a 5V Nano clone.    And dig out a scope to compare my results.

 

Ah-ha.  The Adafruit and Sparkfun 5110 pinout is.

1 GND

2 VCC

3 CLK

4 DIN

5 D/C

6 CS

7 RST

8 LED

 

but my Red 5110 is

1 RST

2 CE (CS)

3 DC

4 DIN (MOSI)

5 CLK (SCK)

6 VCC (3V)

7 LIGHT (LED)

8 GND

 

So your first job is to read the printed pin labels on your pcb.

 

Edit.  Second job is to use the same Fritzing diagram as the particular library example and display.

I had to connect LED 330R to GND.  And use this constructor to match your SparkFun Fritzing in #9 :

LCD5110 myGLCD( 7,   6, 5, 13, 11);

 

Last Edited: Thu. Oct 1, 2020 - 09:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

BTW how important is your design that it must be this 5110 display? I bought a couple of these from eBay the other day:

 

https://www.ebay.co.uk/itm/14339...

 

 

and they are VERY easy to use with an Arduino (though it requires some 5V->3.3V protection when using a 5V Arduino).

 

For your £5 ($8) you get a 320x240 16-bit colour TFT with a touch interface.

 

Just playing about I put this together in about an hour...

 

https://youtu.be/JX2qGT2LkCs?t=1

 

 

The code used in that video is:

 

https://github.com/wrightflyer/m...

(the only "tricky" bit in any of that are lines 84..87 where I apply the results of a "hand calibration" to map the touch points to the pixel points)

 

When you switch record mode off it spews the current point array to the serial terminal so it comes out looking like:

 

https://github.com/wrightflyer/m...

 

BTW the bottom of the following page displays some of an extensive range of fonts you can easily use:

 

https://www.pjrc.com/store/displ...

 

Having used this wonderful display I see things like Nokia mono screens as so "last century" ! ;-)

 

EDIT: I forgot to say that the interface to this display is also SPI (like the 5110) so you could have this kind of display using pretty much the same pins as you already do. (and the touch interface is also SPI so it shares MOSI/MISO/SCK but then needs just one more IO line for its own chip select)

Last Edited: Thu. Oct 1, 2020 - 09:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
your first job is to read the printed pin labels on your pcb 

always - with any PCB!

 

If you were using a genuine Adafruit (or whatever) module with a tutorial written by that supplier specifically for their module, you might hope that they'd get the pinout right; but it still pays to check - as mistakes do happen, product revisions do occur, etc ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is very interesting for future research but I have NEVER used a display before and thought I should start with a simple and easy one.

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I cannot tell you how many times I have checked my wiring already. I am seeing dreams of that Red 5110 pinout. Also I did check sketch pin configuration.

I am also confident the wiring is correct because of that 1sec/division scope I did - everything seems normal. The RST rises and stays put MOSI seems to be giving data at the appropriate times etc etc...

Yes, I was also worried about this big rising time on my signals so what I did next was use these commands:

 


  CLKPR = (1 << CLKPCE);

  CLKPR = 1 << CLKPS3);

 

to presale my FCPU by a factor of 1/256. I checked that the CPU was prescaled using a simple blink sketch - it was. Still no luck.

Could you check where the pcb's pins are routed to on the screens interface?

 

 

I am so looking forward to seeing your scoped signals

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I had my first displayed image! HALELUJAH!

 

On the new display I ordered the display's connector (that small black piece with very small pins that connects the display to its PCB) was dangling around a bit so I opened the display up using a spudger and repositioned the piece properly.

After that, the example I posted previously works as intended. So I am guessing my first display was bad and the second one had this connectivity problem.

 

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your pinout is exactly the same as mine

1 RST           10k D5
2 CE (CS)       10k D6
3 DC            10k D7
4 DIN (MOSI)    10k D8
5 CLK (SCK)     10k D9
6 VCC (3V)      --- 3V
7 LIGHT (LED)   330 GND
8 GND           --- GND

//if you use that scheme all the wires run in the same order.   So it is easier to wire up to your Arduino.
//and then you simply use the following constructor.

//LCD5110 lcd(SCK,MOSI,DC,RST, CS)
LCD5110 myGLCD( 9,   8, 7,  5,  6);

As Andy and I have suggested.   It is always wise to follow a tutorial that matches your hardware and library.

 

Since you have "chosen" LCD5110_Graph.h library it is better to follow my "ordered" scheme than the Sparkfun diagram.

If you have a problem you can post a photo.

 

It should be convenient to plug one side of your Nano into a mini breadboard to line up with the 10k resistors.

Then you only need about 3 jumper wires.

 

I don't like breadboards.   But they do make things easier to debug.

 

Incidentally,  if you had put your pin header on the pcb side it means that you can view the LCD when it is plugged into the breadboard.   And I bet that the screen view shows the printed pin names.

 

David.

Last Edited: Thu. Oct 1, 2020 - 03:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson, do you have the code for the touch interface for the ILI9341?

 

Wm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tellSlater wrote:
So I had my first displayed image! HALELUJAH!

Please mark the solution.

When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That'll be the link immediately after he says, "The code used in that video is:" ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fianawarrior wrote:
clawson, do you have the code for the touch interface for the ILI9341?

Well I use Teensyduino so I'm using Paul Stoffregen's library code. The library I'm using is here:

 

https://github.com/PaulStoffrege...

 

but that's just installed by default when you add Teensyduino to Arduino. I guess the key part of the entire code is:

 

https://github.com/PaulStoffrege...

 

which does the main SPI communication  to the XPT2046 touch controller IC.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ki0bk wrote:
When your question is resolved, mark the solution: https://www.avrfreaks.net/comment... 

What an excellent idea - if only there was some little reminder about that somewhere on the site ...

 

wink

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks clawson...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tellSlater wrote:

I cannot tell you how many times I have checked my wiring already.

 


 

 

One thing I can say about that, is sometimes it's best to  just walk away, take a break, maybe an hour, maybe a day, clear the old gray matter and look at it again.

 

I cannot tell you how many times I have checked something, and checked it again, and again and again, only to find out I was wrong.

 

The old brain gets used to seeing something, and it will block out stuff it doesn't "want to see".

 

Hell, after all these years, I'm still doing it, in fact, probably more so because the thinker is more worn out than it used to be (that's my story and I'm sticking to it, it's not from being unused....)

 

Glad you got it working.   Great feeling isn't it?  That's why I'm still doing this, I love that feeling.   The "eureka!" moments are the best, that's when you beat your head against the wall trying to figure something out, and then it all becomes clear and you have a fundamental understanding of the subject.  That stuff, you'll never forget.   Bet you remember this one too!

 

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yess! And the harder it was to get it working the greater the eureka moment - I definitely had a good moment. Thanks for helping me get there :)

Yeah that sure is good advice, sleeping on a problem is the best way to help solving it sometimes. Maybe dreams help in some way - who knows

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tellSlater wrote:

Thanks for helping me get there :)

 

*I* didn't do anything, I just got here.   The pros are the ones that helped.  smiley  (but I'm sure they get it)

 

I've been a bit busy so I haven't dropped in much.   But I got some help here a while back, and have been merrily programming away lately.  Have to admit, it's much more fun when something works like it's supposed to.

 

Sometimes, I imagine that is what Einstein or Tesla must have felt like a lot.  They had such fundamental understandings of things, it's like everything was a "Eureka!" moment, or maybe they just got used to it.  Maybe wondering why the rest of us don't "get it" like they way they do.  ("Whatsamatter?  how can you not see how those magnetic fields flow inside those conductors when you apply AC to the .......")

Just gettin' started, again....