NHD 2.8-25664UCY2 & Arduino DUE ... help!

Hello, greetings to you all and best wishes for the New Year.
I write because I need help to verify the integrity of my display NHD 2.8-25664UCY2.
The display is connected to the Arduino board according to the scheme I have attached (B.jpg), so far only the display called DED.
To operate the display I used a code written by another person and that takes advantage of the libraries U8glib.
But since they changed version of the code and I have updated the OS Windows 10 Pro 64bit and updated the IDE of Arduino TWO, the display does not work, or rather, remains completely black.

Unfortunately I can not program the Arduino and I would not know how to test the display with a simple code.
I wonder if any of you can write a simple code and get me to the terminal plan in order to test the operation of the display so as to rule out a malfunction.

I thank you and I offer my best wishes for a happy new year.

Useful data:
PC Operating System: Windows X Pro 64bit
Arduino IDE: 1.6.6
Display: NHD-2.8-25664UCY2-243421
Library Display: u8glib_DEDuino_v1.18.1 and updates

PS: I attach also the libraries, but others are also fine, the important thing
is to test the functionality of the display.

(sorry for my english)

u8glib_DEDuino_v1.18.1.zip (1.07 MB)

Hi

The root cause for such problems usually are: 1) wrong U8glib constructor 2) wrong wiring 3) Display is in wrong communication mode

1) can not be checked, because you did not provide the source code 2) can not be checked, because you did not provide the source code which must include the matching pin numbers 3) can not be checked, because you did not provide pictures of the display and pdf datasheet.

Please provide more information if you expect answers.

Oliver

Thanks for your attention Oliver.
I did not include the source code because I did not think it was necessary, I was thinking of a simple source code written exnovo to test the display without affecting the wiring according to the attached diagram.

I enclose:

  1. the source code (arduino_code.zip)
  2. datasheet display
  3. some pictures of the display and wiring

The libraries as well as in the .zip file, are attached to the first post.

Thanks.
Giuseppe

NHD-2.8-25664UCY2-243421.pdf (314 KB)

arduino_code.zip (1.07 MB)

Hi

I did a small crosscheck, but the code is not very well written and difficult to analyze. However probably your wiring is ok.

I did not include the source code because I did not think it was necessary, I was thinking of a simple source code written exnovo to test the display without affecting the wiring according to the attached diagram.

Why not download a fresh version of U8glib (can be done in the Arduino IDE Library Browser) and test your display with one of the examples?

Oliver

The Arduino IDE I've updated the library U8glib! If, always from the IDE, load the example U8glib>HelloWorld.... I do not know how to "adapt" the code to my display and the type of connection I have.

I tried a little studying U8glib from the site, for example if I did not understand from the sketch "HelloWorld," for my display, I have to remove the comment on line 53 or insert one of these builders: display 256x64 SSD1322 (which also I do not know how to do it :sob: )

I do not know how to tell the code my connections ... A) use 3-pin SPI: RESET, SCK and MOSI. B) then the ground taken from near the pin number 13 of the Arduino and combined with the ground of the external power supply of the display. C) and finally, the pins 9 and 8! The number 9 is connected to pin 4 of the display; the number 8 is connected to pin 17 of the display. Which according to the datasheet of the display can change the function may differ depending on whether connected in Parallel Interface or Serial Interface !? !? D) The power to the display is provided separately. (as well shown in the slide B.jpg attached to the first post!)

Now, suppose you wanted to use the sketch of "HelloWorld" library U8glib... case A: ... and I had to remove the comment line number to 53, as I point out in the manufacturer the pin that I use in my connection? case B: ... and wanted to use the constructor for my display indicated in the link (display 256x64 SSD1322), which constructor should be used? and, as I indicate in the constructor pins that I use in my connection?

If you can tell me the code changes needed to the sketch "HelloWorld" library U8glib, according to my connections, I might try the operation of the display!?

Thanks for everything and good Sunday Giuseppe

PS: a piece of code "HelloWorld" with the line 53 uncommented for the constructor who would be right (!?) for my display:

// setup u8g object, please remove comment from one of the following constructor calls
// IMPORTANT NOTE: The following list is incomplete. The complete list of supported 
// devices with all constructor calls is here: https://github.com/olikraus/u8glib/wiki/device
//U8GLIB_NHD27OLED_BW u8g(13, 11, 10, 9);   // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_2X_BW u8g(13, 11, 10, 9);    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_GR u8g(13, 11, 10, 9);   // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD27OLED_2X_GR u8g(13, 11, 10, 9);    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9);   // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_2X_BW u8g(13, 11, 10, 9);    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
  U8GLIB_NHD31OLED_GR u8g(13, 11, 10, 9);  // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_NHD31OLED_2X_GR u8g(13, 11, 10, 9);    // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGS102 u8g(13, 11, 10, 9, 8);     // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGM132 u8g(13, 11, 10, 9);        // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9
//U8GLIB_DOGM128 u8g(13, 11, 10, 9);        // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

Hi Giuseppe

Yes, you have to uncomment the constructor in the u8glib example and then change the pin numbers according to your setup. You can use U8GLIB_NHD31OLED_GR u8g(13, 11, 10, 9); but maybe it is better to start with U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9); Pin numbers are this: U8GLIB_NHD31OLED_BW u8g(sck, mosi, cs, a0_or_dc);

So for example if you have connected cs to pin 4, then it will look like this: U8GLIB_NHD31OLED_BW u8g(13, 11, 4, 9);

I find you picture B very confusing, i am sure, you can figure out the the correct wiring. Best is to create a table for the connection:

Display pin name --> Connected to Arduino Pin SCK --> ?? MOSI --> ?? CS --> ?? A0/DC --> ??

Some other remarks:

A) use 3-pin SPI: RESET, SCK and MOSI.

U8glib only support 4-wire SPI. This means, the so called A0 or D/C pin must be connected and provided as 4th argument to the constructor.

B) then the ground taken from near the pin number 13 of the Arduino and combined with the ground of the external power supply of the display.

If you have two (or more) different power supplies, you have to connect their grounds together. Best is to use the pins which are labled as GND in the Arduino board. This means, connect ground of your display supply with the pin labled as GND on your board.

C) and finally, the pins 9 and 8! The number 9 is connected to pin 4 of the display; the number 8 is connected to pin 17 of the display. Which according to the datasheet of the display can change the function may differ depending on whether connected in Parallel Interface or Serial Interface !? !?

I did not understand this. My suggestion is to use 4-wire SPI (3-wire is not supported and parallel is a huge wiring effort). For this, ensure that BS1 and BS2 of the display are connected to ground (0V).

Connect the chip select pin of the display (Pin 17) to any Arduino pin, but write down the Arduino pin number you have used and provide this number to the constructor as 3rd argument.

Connect the data/command pin (also know as D/C or A0 pin) of the display (which is pin 4) to any Arduino pin. Again write down the Arduino pin number and provide this pinnumber as 4th argument to the u8glib constructor.

Similar for SCLK and SDIN (= MOSI).

Oliver

Thanks Oliver.... Today I do not have time to test the code and links, soon as I can, I hope Monday afternoon, I will report. I read what I've written and some things I did not understand, but in due course you will ask, maybe you will understand the best from my report.

I'll make you a question now: there is no difference between the pin ICSP (near the connector alimnetazione) and SPI pins? I used SPI before and worked with just three pins connected!

Thanks, see you later ... good Sunday. Giuseppe

Hi Giuseppe

I'll make you a question now: there is no difference between the pin ICSP (near the connector alimnetazione) and SPI pins? I used SPI before and worked with just three pins connected!

Yes there is a difference, but the constructor with 4 arguments is a SW SPI constructor. You can use any pins of your board.

Something else comes in my mind: You sould also connect the reset input of the display to some suitable value.

Oliver

Unfortunately I can not!! :confused:

I can not find matches between pins of the display and the Arduino DUE pin, ie, which pins to connect the display to which Arduino pin!

The datasheet of the display have these diagrams Pin:

This scheme of the Arduino pin:

I connected only 3.3V and GND :confused:

The pins shown in the code “HelloWorld” by U8glib:
U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK= 13, MOSI= 11, CS= 10, A0= 9
they refer to the Arduino pin or pins of the display?!?
By order:
SCK:
a) to which pin of the display corresponds!? the number 7? (SCLK - Serial Data Input Signal!)
b) in which pin dell’Arduino be connected? It should be connected to the SCK? (SPI connectors?)

MOSI:
a) to which pin of the display corresponds!?
b) in which pin dell’Arduino be connected? It should be connected to the MOSI? (SPI connectors?)

CS:
a) to which pin of the display corresponds!? the number 17? (/CS - Active LOW Chip Select signal!)
b) in which pin dell’Arduino be connected?

A0:
a) to which pin of the display corresponds!?
b) in which pin dell’Arduino be connected?

You can not make a little diagram of connections so that they can be replicated?

Giuseppe

Hi

Unless you want to use highest speed, you can choose four random pins on your DUE port. You can use 13, 11, 10, 9 or you can use anything else it does not matter as long as you tell this to u8glib.

I can not find matches between pins of the display and the Arduino DUE pin

There is no specific matching required. You can use any pins of your board. You only have to define the matching.

which pins to connect the display to which Arduino pin!

This is exactly what you have to define and write down.

The pins shown in the code "HelloWorld" by U8glib: U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK= 13, MOSI= 11, CS= 10, A0= 9 they refer to the Arduino pin or pins of the display?!?

They refer to your Arduino board. These are the Arduino pin numbers.

SCK: a) to which pin of the display corresponds!? the number 7? (SCLK - Serial Data Input Signal!) b) in which pin dell'Arduino be connected? It should be connected to the SCK? (SPI connectors?)

a) Yes, pin 7 of the Display. b) Do not get confused by the lables. Again: You can use ANY pin! But of course if you want to use the SPI connector you could use pin 76. But bin 13 would be fine also if you instruct U8glib to use SW SPI. But let us continue with pin 76. So you would connect

Display Pin 7 with Arduino Due Pin 76.

Then later your constructor for U8glib must have the Pin Number 76 as first argument: U8GLIB_NHD31OLED_BW u8g(76, ?, ?, ?); Let us continue with the next pin.

MOSI: a) to which pin of the display corresponds!? b) in which pin dell'Arduino be connected? It should be connected to the MOSI? (SPI connectors?)

I mentioned in my last to last post (see above), that MOSI is equal to SDIN. So this is pin 8 of the Display.

Again, you could use any pin, but let us continue with the SPI connector. Hardware MOSI is there on pin 75. Again since U8glib is instructed not to use HW SPI, the actual pin does not matter. Ok, let us still use pin 75. So, please connect

Display Pin 8 with Arduino Due Pin 75.

The constructor will look like this until now: U8GLIB_NHD31OLED_BW u8g(76, 75, ?, ?); // SPI Com: SCK= 76, MOSI= 75, CS= ?, A0= ?

CS: a) to which pin of the display corresponds!? the number 17? (/CS - Active LOW Chip Select signal!) b) in which pin dell'Arduino be connected?

Bingo, it is pin 17. Very good. Again you are absolutly free to choose any pin. Let me select pin 24. Connect

Display Pin 17 with Arduino Due Pin 24.

A0: a) to which pin of the display corresponds!? b) in which pin dell'Arduino be connected?

I also wrote this above and this is also part of the U8glib description. This is the D/C Pin 4 of the display. You probably will not be surprised if i sa,y that you can choose a random pin on your board for this. Let us use Pin 25. Now connect pin 4 of your display with pin 25 of your board. Display Pin 4 with Arduino Due Pin 25.

This will lead to the following constructor: U8GLIB_NHD31OLED_BW u8g(76, 75, 24, 25); // SPI Com: SCK= 76, MOSI= 75, CS= 24, A0= 25

Now, let me tell you, that the constructor accept one more optinal pin: The reset pin. Display Pin 16 (reset) with Arduino Due Pin 26.

This will finally lead to the following constructor: U8GLIB_NHD31OLED_BW u8g(76, 75, 24, 25, 26); // SPI Com: SCK= 76, MOSI= 75, CS= 24, A0= 25, Reset = 26

Additionally you have to select 4-wire SPI: for the Display: Connect pins 19 and 20 with GND (ok, i hope i did remember this correctly)

Then connect pin 1 (gnd) with GND and pin 2 (power supply) with 3.3V

Summery Display Pin --> Arduino Pin 7 --> 76 8 --> 75 17 --> 24 4 --> 25 16 --> 26 1 --> GND 19 --> GND 20 --> GND 2 --> 3.3V

Constructor: U8GLIB_NHD31OLED_BW u8g(76, 75, 24, 25, 26); // SPI Com: SCK= 76, MOSI= 75, CS= 24, A0= 25, Reset = 26

Finally, you may wonder how to activate HW SPI. This is simple: Just use this constructor: U8GLIB_NHD31OLED_BW u8g(24, 25, 26); // SPI Com: SCK= 76, MOSI= 75, CS= 24, A0= 25, Reset = 26

Oliver

Thank you very much, you made a beautiful and useful explanation.

To see if I understand this, I summarized schematically with the aid of the software, the two cases, with or without SPI:

with SPI

no SPI

When I have a window useful to devote to my hobbies, I will prove the connections and if the display works. I will keep you up to date.

Unfortunately I tried the two solutions, with and without connections SPI, but nothing is displayed ner!! I also changed the type of manufacturer: U8GLIB_NHD31OLED_BW and U8GLIB_NHD31OLED_GR. If I can, tomorrow afternoon, tests and try again with another PC!

In the meantime I found an old display and downloaded the datasheet, unfortunately I can not understand what kind of manufacturer serving and if the library U8glib supports it! |500x358

I can not attach the pdf datasheet because they are too big, I leave the download link: CFAG12864B-YYH-N

I do not give up, I want to be able to understand and operate the display!! >:(

Unfortunately still nothing. Yesterday I tried to other computers, installed ArduinoDUE, libraries U8glib and tried sketching "HelloWorld" but the display always black. Then, over the datasheet of the display CFAG12864B-YYH-N, I found libraries GLCD (GLCD-v3-20111205) that should be able to operate the display with Arduino, but I have the same problem of how to connect the display to the Arduino and whitout using potentiometers or resistors for the backlight. On the web I found nothing to me understandable to help me connect the display to ArduinoDUE.

This is because, in addition to verifying the proper functioning of the card ArduinoDUE, might need in the future also the display CFAG also help me to further understand the operation of the display with the hope to also operate the NHD.

I continue to study and search.

On the website of Arduino I found that: I quote from page.... "NOTICE: GLCDv3 is no longer recommended GLCDv3 development has been idle since ca. 2012 and the authors have not done an official code release since Dec 2011. The GLCDv3 library does not work on newer arduino boards and no longer builds on newer IDEs The GLCDv3 library has reached end of life. ......"

But, for example, in the sketch "Hello World", I do not know what kind of constructor used in the display-CFAG12864B YYH-N, which should use the controllers NT7107-64 or NT7108-64!!

Hi

Bad, that the display is still not working. However nice pictures of the setup. However, i guess you mean hardware SPI vs. software SPI. One more suggestion: You should really connect all pins of the display as instruced by the datasheet. For example pins 5 & 6 should be connected ot GND, however they are open according to your setup.

Another source of errors are these breadboards. It is more reliable to solder the wires. Of course you could trace the signals from the Arduino board with a scope.

Oliver

Edit: Bill has moved development of GLCDv3 to bitbucket (https://bitbucket.org/bperrybap/openglcd/wiki/Home). To my knowledge it does not support OLEDs.

Edit 2: The other display you found, is indeed a classical KS0108 display with parallel interface This display does not support SPI. This is supported by openglcd and u8glib (different constructor).

Thanks Oliver because you're giving me support and help.

I updated the IDE to version 1.6.7 and performed a simple test with the sketch "blink", which turns on and off the LED connected to pin 13 and works. This is to verify that the card is not broken. Little test that I could quickly this morning, when I have more time, try again with your suggestions.

Giuseppe

A question: but not matter, in the IDE, what kind of "programmer" is selected?

I tried using the display CFAG12864BYYHN always sketching "HelloWorld" library U8glib ......

constructor:

U8GLIB_KS0108_128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16);
// 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs1=14, cs2=15,di=17,rw=16

pin ArduinoDUE -> pin dispaly 8 -> 4 9 -> 5 10 -> 6 11 -> 7 4 -> 8 5 -> 9 6 -> 10 7 -> 11 18 -> 17 (en !?) 14 -> 12 (cs1) 15 -> 13 (cs2) 17 -> 16 (D/I !?) 16 -> 15 (R/W) 5V -> 1 GND -> 2

Not sure on connecting pin numbers 18 and 17 Arduino to display. Not sure if it is connected also 3V pin number 3 of the display.

However, with this sketch and these connections, even this display can operate. :confused: :confused: :confused: :confused:

Can you tell me if I was right connections, according to the datasheet!? Thanks.

Tomorrow is another day..... :roll_eyes:

Hi Same problem with the previous display. I can not say much without the display datasheet. I also can say, that openGLCD might have better support for this display. In fact there was a disgnostics tool there in the history. Even more: Bill might be a better speciallist on these kinds of displays. He probably will answer when you start a new thread with the keywords "openGLCD" and "KS0108" in the title.

Oliver

Thanks.... I'm sorry I thought I had posted the slide contacts of the display, while the datasheeet (pdf) I can not post it because it was too big in MB.

For the rest I'll try to do a search with the keywords you suggested and if I do not get useful results, I will open a new thread.

Giuseppe

PS: although, to be able to operate the display CFAG12864BYYHN, help me to experience and understand more Arduino and displays, but does not tell if the display NHD 2.8 is broken or not!

Hi Giuseppe

I still do not understand why you did not succeed with the OLED. For the KS0108 it should be similar: Create a table with the Arduino Pin numbers and how these pins are connected to the display. For the KS0108 display, you additionally need a contranst adjustment.

Oliver