Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: garryg on September 13, 2017, 03:23:09 AM

Title: Characters Mirrored on NHD-0420CW Display
Post by: garryg on September 13, 2017, 03:23:09 AM
Hi,

Using an NHD-0420CW display with I2C interface, characters are mirrored, and start from right to left on top line of display.
I have used the initialization sequence from the data sheet as follows:

I2C_LCD_WriteControl(0x2A); //function set (extended command set)
I2C_LCD_WriteControl(0x71); //function selection A
I2C_LCD_WriteData(0x5C);     // disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
I2C_LCD_WriteControl(0x28); //function set (fundamental command set)
I2C_LCD_WriteControl(0x08); //display off, cursor off, blink off
I2C_LCD_WriteControl(0x2A); //function set (extended command set)
I2C_LCD_WriteControl(0x79); //OLED command set enabled
I2C_LCD_WriteControl(0xD5); //set display clock divide ratio/oscillator frequency
I2C_LCD_WriteControl(0x70); //set display clock divide ratio/oscillator frequency
I2C_LCD_WriteControl(0x78); //OLED command set disabled
I2C_LCD_WriteControl(0x09); //extended function set (4-lines)
I2C_LCD_WriteControl(0x06); //COM SEG direction
I2C_LCD_WriteControl(0x72); //function selection B
I2C_LCD_WriteData(0x00);    //ROM CGRAM selection
I2C_LCD_WriteControl(0x2A); //function set (extended command set)
I2C_LCD_WriteControl(0x79); //OLED command set enabled
I2C_LCD_WriteControl(0xDA); //SEG
I2C_LCD_WriteControl(0x10); //SEG
I2C_LCD_WriteControl(0xDC); //function selection C
I2C_LCD_WriteControl(0x00); //function selection C
I2C_LCD_WriteControl(0x81); //set contrast control
I2C_LCD_WriteControl(0x7F); //set contrast control
I2C_LCD_WriteControl(0xD9); //set phase length
I2C_LCD_WriteControl(0xF1); //set phase length
I2C_LCD_WriteControl(0xDB); //set VCOMH deselect level
I2C_LCD_WriteControl(0x40); //set VCOMH deselect level
I2C_LCD_WriteControl(0x78); //OLED command set disabled
I2C_LCD_WriteControl(0x28); //function set (fundamental command set)
I2C_LCD_WriteControl(0x01); //clear display
CyDelay(100u); //delay

I2C_LCD_WriteControl(0x80); //set DDRAM address to 0x00
I2C_LCD_WriteControl(0x0C); //display ON
CyDelay(100u); //delay

I have tried changing the COM SEG direction command (ENTRY SET MODE), and it changes the orientation, but never to the correct one.
I have also tried setting the REV bit in the FUNCTION SET command, but again, it never gets the correct orientation.

I have attached the schematic showing the connection of the display - there are pullups on the I2C lines.

Any idea as to what I might be doing wrong or missing?
Thank you.


Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: Saurabh_B on September 13, 2017, 09:05:59 AM
Would it be possible to get a picture of what you are seeing?
Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: garryg on September 13, 2017, 12:27:07 PM
Photo attached
Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: Saurabh_B on September 13, 2017, 03:53:40 PM
From the Photo it looks like the segments are going backwards.

Can you try sending a 0x2A (Function Set, RE = 1)
followed by the Entry mode set(0b000001XY) where y could be a 0 or 1, this should stop the mirroring on the display.
Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: garryg on September 14, 2017, 02:21:53 AM
The original initialization code posted above already included ENTRY MODE SET 0x06 (see line 12)
The photos posted below are using 0x04 and 0x05 for the ENTRY MODE SET value.



Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: garryg on September 14, 2017, 09:52:30 PM
Not sure what else I can try?
I have tried the ENTRY SET MODE as suggested with results posted in previous post.
I have also tried the REV instruction with no success.
Not sure where else to look.  I have spent days on this problem.
Any help is much appreciated.  Thank you.
Title: Re: Characters Mirrored on NHD-0420CW Display
Post by: Saurabh_B on September 18, 2017, 10:30:24 AM
Hello Garry,

Would it be possible to send me a picture of the back of the display as well?

I would like to see the date code and the bonding of the OLED Glass to the PCB. I would like to confirm that these are connected properly as well.
I haven't been able to replicate this issue.

Has this occurred on multiple displays or have you only been able to test 1?