Newhaven Products > OLEDs

Characters Mirrored on NHD-0420CW Display

(1/2) > >>

garryg:
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.


Saurabh_B:
Would it be possible to get a picture of what you are seeing?

garryg:
Photo attached

Saurabh_B:
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.

garryg:
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.



Navigation

[0] Message Index

[#] Next page

Go to full version