Author Topic: Text orientation not changing with Extended Entry Mode Set Register  (Read 1394 times)

tekknojoe

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
I'm using a NHD-0420CW-AG3 display.
Communication seems to be working fine.
I'm using the initialization sequence included in the datasheet:

void init()
{
RES = 1; //reset HIGH inactive
delayms(1); //delay
command(0x2A); //function set (extended command set)
command(0x71); //function selection A
data(0x00); // disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
command(0x28); //function set (fundamental command set)
command(0x08); //display off, cursor off, blink off
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0xD5); //set display clock divide ratio/oscillator frequency
command(0x70); //set display clock divide ratio/oscillator frequency
command(0x78); //OLED command set disabled
command(0x09); //extended function set (4-lines)
command(0x06); //COM SEG direction
command(0x72); //function selection B
data(0x00); //ROM CGRAM selection
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0xDA); //set SEG pins hardware configuration
command(0x10); //set SEG pins hardware configuration
command(0xDC); //function selection C
command(0x00); //function selection C
command(0x81); //set contrast control
command(0x7F); //set contrast control
command(0xD9); //set phase length
command(0xF1); //set phase length
command(0xDB); //set VCOMH deselect level
command(0x40); //set VCOMH deselect level
command(0x78); //OLED command set disabled
command(0x28); //function set (fundamental command set)
command(0x01); //clear display
command(0x80); //set DDRAM address to 0x00
command(0x0C); //display ON
delayms(100); //delay
}

After the initialization I am able to write "Line 1" on line 1, "Line 2" on line 2, "Line 3" on line 3 and "Line 4 on line 4.

HOWEVER,

The text is upside down.

From the forums I see that you can change this with the bottom 2 bits in the Extended Entry Mode Set register for example

command(0x2A); //function set (extended command set)
command(0x06); //COM SEG direction
command(0x28); //function set (fundamental command set)

If I use 0x04 for the Extended Entry Mode Set register
The text is upside down and text is from right to left

If I use 0x05
The text is upside down, but text is left to right

If I use 0x06
The text is upside down, but text is left to right

If I use 0x07
The text is upside down, but text is left to right

It seems like the bits in this register aren't changing things like I would expect.

I know the display can show text in the correct orientation, since there has been times before I used this initialization sequence in the datasheet where it would come up in the correct orientation after power up (I assume the bits must come up randomly after a POR)

Maybe there is a timing thing that I need to consider? Or maybe an ordering of the commands?

Any suggestions here would be great!








Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 355
  • Karma: 10
    • View Profile
Re: Text orientation not changing with Extended Entry Mode Set Register
« Reply #1 on: September 27, 2016, 08:04:16 AM »
Would you be able to post a picture of what you are seeing. I will try to recreate the issue as well to see if i can find a sollution.

jmadsenee

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Text orientation not changing with Extended Entry Mode Set Register
« Reply #2 on: January 25, 2017, 04:35:04 PM »
Hi,

I am having basically the same problem.  My text is upside down and mirrored, I am using the same display, and initialization code.  codes 0x04 and 0x05 give the same output, as do 0x06 and 0x07.  See pictures.  What am I doing wrong??  Please help!

jmadsenee

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Text orientation not changing with Extended Entry Mode Set Register
« Reply #3 on: January 25, 2017, 04:36:18 PM »
Here is the first picture... 

jmadsenee

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Text orientation not changing with Extended Entry Mode Set Register
« Reply #4 on: January 25, 2017, 04:37:36 PM »
Here is the second picture.  The names tell you what the register values were.

jmadsenee

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Text orientation not changing with Extended Entry Mode Set Register
« Reply #5 on: January 27, 2017, 10:13:57 AM »
Well, I figured out the problem - User error.  Since the display wants LSB first (in SPI mode) and my processor sends out MSB first, I needed to reverse the bits in each byte sent.  I just screwed up one of the reversals... :-[

 

NHD‐3.5‐320240MF‐ATXL#‐CTP‐1 Problem with standby mode

Started by guenterBoard TFTs

Replies: 0
Views: 1940
Last post June 16, 2016, 12:14:36 PM
by guenter
NHD-0420H1Z-FL-GBW-33V3 pull-ups and pull-downs in 4 bit mode

Started by richardwrightBoard Character LCDs

Replies: 3
Views: 3002
Last post December 15, 2014, 05:12:27 PM
by Michael_L
NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT

Started by wb2dybBoard OLEDs

Replies: 3
Views: 3109
Last post July 01, 2015, 09:49:46 AM
by Paul_B
NHD-2.4-240320CF-CSXN#-F works in 18 bits(262K colors) mode

Started by charlieBoard TFTs

Replies: 3
Views: 2163
Last post March 15, 2016, 10:39:50 AM
by Saurabh_B
Large custom fonts in 8080 parallel mode

Started by bluedog54Board OLEDs

Replies: 1
Views: 2492
Last post July 22, 2015, 03:12:47 PM
by Saurabh_B