Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: josephchrzempiec on July 08, 2015, 11:23:34 PM

Title: Mouser Oled
Post by: josephchrzempiec on July 08, 2015, 11:23:34 PM
Hello i bought the Oled display from mouser. It is on the way.  Mouser part number is NHD‐1.5‐128128UGC3 link is http://www.mouser.com/ProductDetail/Newhaven-Display/NHD-15-128128UGC3/?qs=sGAEpiMZZMvHnN%252b%2fGH9WnRoJMEv7X8ZRc2IqbjW%2fbEY%3d there are 20 pins and i do not know which one to use for the arduino. or Which library to use for arduino can someone please help me?



Joseph
Title: Re: Mouser Oled
Post by: Paul_B on July 09, 2015, 07:47:18 AM
Hi Joseph,

Below is some example code for that display written for the Arduino  ;)

https://github.com/NewhavenDisplay/NHD-1.5-128128UGC3-Example-Code

Regarding the pin out, please see page 4 in the displays datasheet:

http://www.newhavendisplay.com/specs/NHD-1.5-128128UGC3.pdf

You will need to select a interface that best supports your needs. Finally the example code can be configured to support multiple interfaces (See line 48).

Enjoy your new display!

Title: Re: Mouser Oled
Post by: josephchrzempiec on July 09, 2015, 08:23:11 AM
Thank you very much for the information I will try it when I get my display.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 14, 2015, 02:48:30 AM
Hello is there a simple text  sample i can try with this oled?
Title: Re: Mouser Oled
Post by: Paul_B on July 14, 2015, 10:15:37 AM
Hi Joseph!

There are plenty of user created Arduino Libraries written for the SSD1351 controller. I recommend searching in google for "SSD1351 Arduino library".

Hope this helps, feel free to contact me if you have any questions!
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 14, 2015, 07:48:15 PM
Hello okay it's the SSD1351 library thank you. i didn't know hat
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 15, 2015, 12:24:11 AM
Hello Paul i was wondering if there was a schematic of this display and what parts are being used i would like to somehow integrate this oled into my project? can you please help me out?
Title: Re: Mouser Oled
Post by: Paul_B on July 15, 2015, 09:27:33 AM
Hi Joseph,

I'm sorry, unfortunately we do not have a public schematic available for this display.

Sorry for the inconvenience.
 
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 15, 2015, 09:38:52 AM
Not a problem just wondering that is all the way it is now is okay Something down the road in the future may need to have it on the same board as my micro processor that's all.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 15, 2015, 05:36:28 PM
I just received my Oled in today 20 pins on it. and i looked at the datasheet for the pinout but I'm a little confused on it.


it's got in the sample sketch


Code: [Select]
#define   SDI_PIN    1    // SDI (serial mode) signal connected to pin 1
#define   SCL_PIN    0    // SCL (serial mdoe) signal connected to pin 0
#define    RS_PIN    8    // RS signal connected to pin 8
#define    RW_PIN    9    // R/W (6800 mode) signal connected to pin 9
#define    WR_PIN    9    // /WR (8080 mode) signal connected to pin 9
#define     E_PIN   10    // E (6800 mode) signal connected to pin 10
#define    RD_PIN   10    // /RD (8080 mode) signal connected to pin 10
#define   RES_PIN   11    // /RES signal connected to pin 11
#define    CS_PIN   12    // /CS signal connected to pin 12
#define   BS1_PIN   A0    // BS1 signal connected to pin A0
#define   BS0_PIN   A1    // BS0 signal connected to pin A1
#define   LVL_DIR   A2    // DIR (direction control) signal of level shifter IC connected to pin A2
#define   LVL_OEN   A3    // /OE (output enable) signal of level shifter IC connected to pin A3


and in the datasheet it has

Code: [Select]
1 GND Power Supply Ground
2 VDD Power Supply Supply Voltage for OLED and logic.
3 NC  ‐ No Connect
4 D/C MPU Register select signal. D/C=0: Command, D/C=1: Data
Tie LOW for 3‐wire Serial Interface.
5‐6 VSS Power Supply Ground
7 SCLK MPU Serial Clock signal.
8 SDIN MPU Serial Data Input signal.
9 NC  ‐ No Connect
10‐14 VSS Power Supply Ground
15 GND Power Supply Ground
16 /RES MPU Active LOW Reset signal.
17 /CS MPU Active LOW Chip Select signal.
18 GND Power Supply Ground
19 BS1 MPU MPU Interface Select signal.
20 BS0 MPU MPU Interface Select signal.


i figure out some pins like the VCC and VDD and a few others but I'm using a uno board for test and i need help figuring out what pins go where can someone please help me on that.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 15, 2015, 11:27:21 PM
Hello Paul I'm still stick which pins from the display does to my Arduino Uno board to make it work? Can you please help me out? Thank you.
Title: Re: Mouser Oled
Post by: Paul_B on July 16, 2015, 11:57:25 AM
Hello Joseph,

I recommend you use the 4-wire SPI interface when first starting out  8)

The serial interface pinout can be viewed on page 4 in the displays datasheet:

http://www.newhavendisplay.com/specs/NHD-1.5-128128UGC3.pdf

Be sure to take special note of the MPU Interface Pin Selections table, see page 4. Pin BS0 & BS1 will determine the interface selection.

E.g. In your case when using the 4-wire SPI interface BS0 and BS1 will both need to be tied LOW (GND).

Finally, you will need to modify the Arduino_OLED_128128.ino file so it selects the correct interface.

Edit line 48 from:

Code: [Select]
const unsigned char interface = 1;    // 0 = 8-bit parallel (6800 mode) interface; 1 = 8-bit parallel (8080 mode) interface; 2 = 4-wire SPI interface
To:

Code: [Select]
const unsigned char interface = 2;    // 0 = 8-bit parallel (6800 mode) interface; 1 = 8-bit parallel (8080 mode) interface; 2 = 4-wire SPI interface
Hope this help!



Title: Re: Mouser Oled
Post by: Paul_B on July 16, 2015, 12:00:03 PM
Be sure to also look up the Arduino UNO's pinout when you begin to wire up your display  ;)

http://40.media.tumblr.com/4ff695d730e837e19b393e26b6bb849c/tumblr_mj1nsyafhx1s5t695o1_1280.png
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 16, 2015, 03:23:05 PM
Sense there is so many pin layouts for this oled this is what I'm confused about because it says pin 19 and pin 20 on page 5 of the datasheet says for the 4-wire it says VDD - Ground. Now on page 4 of the datasheet in the serial it says pin 19 and pin 20 is Ds1 and Ds0 this is a bit confusing for me. So i do not know which pinout to follow or if the sketch pinout define is wrong i do not know.
Title: Re: Mouser Oled
Post by: Saurabh_B on July 16, 2015, 03:53:19 PM
I think you're looking at the pictures and taking those positions as pin outs. you want to use the pin out numbers listed on page 4. On page 5 the pins are backwards, so pin 1 and 2 on the sketch correspond to pins 20 and 19 respectively. They are also marked BS0 and BS1

On page 4 its telling you that pins 19 and 20 are control pins that tell the display what interface it should expect. Using the last table on page 4 you can see that when both pins are tied to ground or logic 0, the display will behave in a 4 line SPI interface.

Again the locations on the sketch are backwards. In general the sketches are drawn to show how the pins should be wired, and the pins wont be in the same location. You should always use the Interface Description to get accurate Pin locations.

So you should have most of the pins tied to ground like the third image on page 5 suggests, and only 5 wires going from the Display to the digital outputs of the Arduino. for the rest that need to either be tied to ground or Vdd you should just get a breadboard and use the output from the Arduino for ground an Vdd and tie them together.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 16, 2015, 05:33:41 PM
So pin 1 and 2 on the oled is ground and VDD but in the image on page 5  the 4-wire one it is Ds0 and Bs1. So i need to look at it from the right to the left on the image  for pin 1 and pin 2 on the oled display?
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 16, 2015, 05:44:25 PM
on pin 4 it says D/C but in the sketch example there is nothing for D/c does that get still connected and to which pin and what about the example sketch?
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 16, 2015, 06:16:37 PM
Hello i mange to get the oled wired up and i got something from it image is attached but something is off i see a little characters in the mess of colors but not sure what is wrong. Also the oled is really really warm to the touch that i can't touch it for long it's on 3.3v but something might be wrong I'm not sure. Can someone please help me out?
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 16, 2015, 06:33:15 PM
Not the oled it's self the screen that gets warm but the little chip that is on the ribbon cable that gets warm.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 12:00:18 AM
I wired it up as 4-wire in the image on the datasheet http://www.newhavendisplay.com/specs/NHD-1.5-128128UGC3.pdf  to the sketch pins on the example pinout https://github.com/NewhavenDisplay/NHD-1.5-128128UGC3-Example-Code/blob/master/Arduino_OLED_128128.ino i also change the  const unsigned char interface = 1;   from 1 to 2 and when i power it up  i get that image there  not sure what I'm doing wrong maybe because I'm running the arduino at maybe 5v logic instead of 3.3v logic i do not know and it's messing up? at this point I'm stuck on what I'm doing wrong. But i thank Everybody for the help that got me this far.
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 08:47:40 AM
As for the heat the Arduino still uses 5V logic; you want to either modify the voltage regulator on the Arduino or you would need to use a level shifter to bring down the voltage to 3.3V. Although you might be using the 3V output from the Arduino itself to power the chip, the rest of the pins are still applying 5V.

As for the D/C pin,  you do need to have that connected if you're running in 4 line mode. you're probably looking at the last picture which is the 3 line SPI interface. the D/C is a signal that will tell the display whether the incoming information is a command or data.

Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 08:55:53 AM
I wore it up as 4-wire as I the image I didn't understand where to connect the cc pin at I change the sketch from 1 to 2 for the 4-wire and that is the image I got unless I didn't something I'm not sure. And I'm not sure how to get it. To 3.3 logic instead of 5 I'm using 3.3v on the vdd as it needs to be but not sure how they 3.3v  on the logic side
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 09:31:57 AM
I'm not too sure what you mean by cc. But looking at your board the bottom right pin should be pin 1, above that is pin 2, one one on the the bottom next to 1 is 3. The on on the top left should be pin 20. Follow that along with the TABLE on page 4. the sketches again aren't always accurate.

You are might be using the 3.3V output from the Arduino, but everything else going in is 5V. So you can do one of two things to stop it from heating up.

1. Swap out the voltage regulator on the Arduino for a 3.3V and use a dc jack to power it something like 3.3 V Regulator on Mouser (http://www.mouser.com/ProductDetail/ROHM-Semiconductor/BD733L5FP-CE2/?qs=sGAEpiMZZMv7GdWQYEW1%2fjHNQKNU4XDUlYgKkcosBB8%3d)

Or,

2. Get a level shifter to bring down the 5V coming from your Arduino digital pins to 3.3V. Something Like This (http://www.adafruit.com/products/757?gclid=CIu87Pyt4sYCFYMWHwodlEUNPQ)


Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 09:48:21 AM
My Arduino uno has a 3.3v on there that is what I'm using to power up the screen with. I think something is wrong with the sketch
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 11:01:23 AM
But the rest of the pins you're using are at 5V. They need to be brought down to 3.3.

What pin do you have D/C connected to on the Arduino?

The example code is verified to work so long as everything is wired up correctly.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 11:50:19 AM
Hello can you tell me what pins from the oled display goes to the Arduino uno board if I use some resistors for testing to bring the logic level down to 3.3v then I think it be a good test then figure something out. I think either the pin out is wrong or something I did is wrong I do not know.
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 12:09:46 PM
Code: [Select]
#define   SDI_PIN    1    // SDI (serial mode) signal connected to pin 1
#define   SCL_PIN    0    // SCL (serial mdoe) signal connected to pin 0
#define    RS_PIN    8    // RS signal connected to pin 8
#define    RW_PIN    9    // R/W (6800 mode) signal connected to pin 9
#define    WR_PIN    9    // /WR (8080 mode) signal connected to pin 9
#define     E_PIN   10    // E (6800 mode) signal connected to pin 10
#define    RD_PIN   10    // /RD (8080 mode) signal connected to pin 10
#define   RES_PIN   11    // /RES signal connected to pin 11
#define    CS_PIN   12    // /CS signal connected to pin 12
#define   BS1_PIN   A0    // BS1 signal connected to pin A0
#define   BS0_PIN   A1    // BS0 signal connected to pin A1
#define   LVL_DIR   A2    // DIR (direction control) signal of level shifter IC connected to pin A2
#define   LVL_OEN   A3    // /OE (output enable) signal of level shifter IC connected to pin A3

So the pins you need to have connected

OLED                                                                                     Arduino/personal circuit
1,5,6,10,11,12,13,14,15,18,19,20            |                         Ground
2    Vdd                                                        |                         +3.3V
4     D/C                                                       |                         Pin 8   [D/C is often referred to as RS (register select)]
7 SCLK                                                         |                         Pin 0
8 SDI                                                           |                        Pin 1
16 /RES                                                       |                         Pin 11
17 /CS                                                         |                         Pin 12



Again I would recommend using a proper level shifting IC.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 12:23:55 PM
Hello what about the lvl_dir and the lvl_oen pins I don't see them on the data sheet  where are they on the display and the bs0 and bs1 goes to a0 and a1. ?
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 12:25:05 PM
The 4050 I see around is a level shifter correct that is what I'm missing I think
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 12:31:44 PM
Those are pins that would be on a level shifter and not the OLED. 4050 is the part number for level shifter

By any chance do you have another MCU that is 3.3V instead?
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 12:37:10 PM
I have a Arduino pro mini it's also 5v but I still run it on 3.3v all the time.
Title: Re: Mouser Oled
Post by: Michael_L on July 17, 2015, 01:19:35 PM
The display you are trying to use is a 3.3V display.  It requires 3.3V for VDD and logic to function properly.  The Arduino Uno is a 5V MCU board.  Yes, there is a 3.3V pin on the board, however all other logic signals on the board are TTL (0V / 5V).  So as you may be connecting the display's VDD signal to the Arduino's 3.3V pin, every other display pin you connect will receive 5V, which is over the maximum specified voltage allowed for the display, as indicated in the datasheet.  Therefore, to use this color OLED, you need a 3.3V MCU, or a modification to the Arduino Uno to make it provide 3.3V logic, hence the previous voltage regulator replacement option.  Another way is to use a level shifter IC between the Arduino and the display.

The pin connections are shown in the example code.  Please also note this example code is just a reference, and does not imply this display must be used with an Arduino Uno.  We have chose to release example code for the Arduino Uno simply because it is a low cost, easy to use, MCU board that is very popular for projects and prototyping.  If you have used any other MCU platforms (preferably 3.3V MCUs), you may use this display with it, and port the C code accordingly.

The Arduino Pro Mini 5V board still has the same issue of not being a 3.3V MCU.  It will send TTL signals (5V) on all of the data and control lines of the display.  I believe there is a version of the Arduino Pro Mini that is 3.3V, so if you have or can obtain one of those, that would be recommended.

To get the display to work with your Arduino Uno, you need to either:

1)  replace the voltage regulator on the Arduino Uno with a 3.3V regualtor (such as an LM1117/AME1117/AP1117), and when powering the Arduino + display, you must use the DC jack power input, not the USB.

or

2)  use a level shifter IC.  Here are the level shifters used for this particular program example:
     http://www.ti.com/product/sn74lvc4245a (http://www.ti.com/product/sn74lvc4245a)
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 01:54:52 PM
hello Michael_L thank you. yeah i know i hope its not killed off the oled being that high on the logic i do some place have a 74HC4050  level shifter not sure where i can do it with resistors but it might take a lot. i think i got the pinout correct now one thing in the example code i was unsure of is that


#define   BS1_PIN   A0    // BS1 signal connected to pin A0
#define   BS0_PIN   A1    // BS0 signal connected to pin A1
#define   LVL_DIR   A2    // DIR (direction control) signal of level shifter IC connected to pin A2
#define   LVL_OEN   A3    // /OE (output enable) signal of level shifter IC connected to pin A3


i know the Bs1 and Bs0 are on the display but the DIR and OE N i don't see that on the display wiring part not sure what pins are they are on the lcd  wasn't sure what they are for or where they go to?
Title: Re: Mouser Oled
Post by: Saurabh_B on July 17, 2015, 02:14:44 PM
Those pins are not on the display correct, they're pins that should be on the Level Shifter.

If you take a look at page 3 of the  DATASHEET  (http://www.ti.com/lit/ds/symlink/sn74lvc4245a.pdf), Michael linked you to, you will find those pins.

The DIR pin controls the direction of shift, whether the signals go from Port A to B or B to A.

The /OE is an Active Low output enable signal. Again both of these pins are on the level shifter.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 17, 2015, 11:24:10 PM
I been actually going about this the wrong way. I have a arduino zero it's new not used it much but it does have a 3.3v logic and 3.3v wondering if that will work? it's still new to me this board.  https://www.arduino.cc/en/Main/ArduinoBoardZero
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 18, 2015, 01:16:29 AM
okay i try to compile it with the zero board i got and i get this error

Arduino: 1.7.6 (Windows 7), Board: "Arduino M0"
Build options changed, rebuilding all
sketch_jul18a.ino: In function 'void OLED_Command_128128RGB(unsigned char)':
sketch_jul18a.ino:402:17: error: 'PORTD' was not declared in this scope
sketch_jul18a.ino: In function 'void OLED_Data_128128RGB(unsigned char)':
sketch_jul18a.ino:445:17: error: 'PORTD' was not declared in this scope
sketch_jul18a.ino: In function 'void setup()':
sketch_jul18a.ino:1119:4: error: 'DDRD' was not declared in this scope
sketch_jul18a.ino:1147:8: error: 'PORTD' was not declared in this scope
Error compiling.
This report would have more information with
 "Show verbose output during compilation"
 enabled in File > Preferences.

Title: Re: Mouser Oled
Post by: josephchrzempiec on July 18, 2015, 09:37:28 AM
I'm guessing it's part of the atmega family avr and trying to use it on a 32bit family totally different and I'm not a good programmer to know what's wrong I'm good at hardware but not software.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 19, 2015, 01:43:55 AM
Hello with a little work and luck i mange to get the Oled to work now was wondering about a couple of things. How do i get the Display to turn off command or brightness command? second thing is how can i display text instead of using hex characters I'm not use to them and just would like to use text it's self?
Title: Re: Mouser Oled
Post by: Saurabh_B on July 20, 2015, 08:27:49 AM
As for the commands such as Display Off you would want to use the display mode command, if you look at the Controller Datasheet (http://www.newhavendisplay.com/app_notes/SSD1351.pdf) on page 43 it shows you how the different display modes will work depending on what command you send to the display.

With the text, there is no built in font tables or text saved on the controller. If you look at the example code given, it does have a font table that was previously created. You would have to use another set of commands to display that text. You would also need to send the X and Y positions you want the text to appear. And if you're using the same codes you need to specify the text color and background color as well to ensure it works. For the regular sized text the OLED_Text_128128RGB command will work on showing the text. (Each character will be 5 pixels wide, and 8 pixels tall). If you want the larger text, use the OLED_Text2x_128128RGB command.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 20, 2015, 08:40:34 AM
in the void OLED_Init_128128RGB(void)    i have


   OLED_Command_128128RGB(0xA4h); // Display Off


i get this error



_1.5oled_V3.ino:500:28: error: invalid suffix "xGS0" on integer constant
_1.5oled_V3.ino: In function 'void OLED_Init_128128RGB()':
_1.5oled_V3.ino:498:26: error: 'Ax4h' was not declared in this scope
Error compiling.


what am i doing wrong? is it in the wrong place or did i write it wrong? this is from your example code.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 20, 2015, 08:52:18 AM
i was doing it wrong it is    OLED_Command_128128RGB(0xAE); // Display OFF thank you.
Title: Re: Mouser Oled
Post by: Saurabh_B on July 20, 2015, 09:26:45 AM
When sending a byte of data using hex, you should only be sending in (0x00) to (0xFF) to denote that the value is in hex, leave off the h at the end.
Title: Re: Mouser Oled
Post by: josephchrzempiec on July 20, 2015, 10:23:57 AM
Hello thank you.