Author Topic: Scrolling on NHD-0420CW-AY3(US2066)  (Read 2421 times)

awbrownCGNX

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Scrolling on NHD-0420CW-AY3(US2066)
« on: January 28, 2016, 03:36:04 PM »
Hello all,

I have a NHD-0420CW-AY3 and I am trying to enable scrolling on line 1.
(page 27 on http://www.newhavendisplay.com/app_notes/US2066.pdf)

I am not having much luck which I think is due to a misunderstanding of how the IS,RE, and SD logic bits are set.
After the OLED is initialized, and text is sent to the screen I am sending the following:

Code: [Select]
command(0x28)  //Set Fundamental Command Set
command(0x2B)  //Set IS, RE to 1
command(0x11)  //Enable scrolling on line 1

Any Thoughts?

Thanks!
Andrew
« Last Edit: January 28, 2016, 04:37:21 PM by awbrownCGNX »

Chris O.

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 5
    • View Profile
Re: Scrolling on NHD-0420CW-AY3(US2066)
« Reply #1 on: January 29, 2016, 04:14:50 PM »
Let's start with an easy one. :P
SD logic bits are set by Extension register in OLED Characterization p.29 hex 0x78 b1111000 / 0x79 b1111001

example Set Contrast Control:

Code: [Select]
void OLedI2C::setContrast(unsigned char contrast) // contrast as 0x00 to 0xFF
{
  //Set OLED Command set
  sendCommand(0x2A);        //Function Set  N = 1, BE = 0, RE = 1 Set, REV = "0": normal display (POR)  B00101010
  sendCommand(0x79);        //OLED Characterization / 0x79 B1111001 =  OLED command set is enabled
  sendCommand(0x81);  // Set Contrast
  sendCommand(contrast); // send contrast value
  sendCommand(0x78);  // OLED Characterization / 0x78 B1111000 =Exiting Set OLED Command set disabled (POR)
  sendCommand(0x28);       // Function Set / B101000 (Go Back to Fundamental Command Set)
}

Chris O.

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 5
    • View Profile
Re: Scrolling on NHD-0420CW-AY3(US2066)
« Reply #2 on: January 29, 2016, 04:25:27 PM »
How about Double Height (4-line) / Display-dot shift.
 
Code: [Select]
void OLedI2C::setDoubleH(uint8_t MODE) // 09-19-2015 Chris O. / Double Height Display MODE 0~4
/*---- MODE: "0"=Normal 4-line, "1"=Bottom half Double Height, "2"=Middle Double Height, "3"=Top/Bottom Double Height, "4"=Top Double Height ----*/
{
  sendCommand(0x2A); // Function Set  (extended command set / Extension register, RE ("1")set) B00101010
 //  i'm not sure if needed / Extended Function Set
  sendCommand(B00001001); //Extended Function Set (FW = "0": 5-dot font width, black/white invert cursor DIS,NW = "1": 3-line or 4-line display mode)
  switch (MODE) {
  case 0:    //MODE 0 4x20-line / MODE: "0"=Normal 4-line
    sendCommand(0x28);// Function Set (Go Back to Fundamental Command Set)//101000
    break;
  case 1:    //MODE 1 0x10 / Double Height (4-line)/Display-dot shift
    sendCommand(B00010000); //MODE 1
    sendCommand(0x2C);//101100 Function Set ( when (N=1 :4-line )and(NW=1), Double height =1 Enable, Extension register, RE"0", Extension register, IS"0" )
    break;
  case 2:    //MODE 2 0x14 / Double Height (4-line)/Display-dot shift
    sendCommand(B00010100);   //MODE 2 0x14 / Double Height (4-line)/Display-dot shift
    sendCommand(0x2C);//101100 Function Set ( when (N=1 :4-line )and(NW=1), Double height =1 Enable, Extension register, RE"0", Extension register, IS"0" )
    break;
  case 3:    //MODE 3 0x18 / Double Height (4-line)/Display-dot shift (DH’ = "0": dot scroll enable (POWER UP))
    sendCommand(B00011000);
    //sendCommand(B00011001); //MODE 3 0x19 / Double Height (4-line)/Display-dot shift (DH’ = "1": display shift enable)
    sendCommand(0x2C);//101100 Function Set ( when (N=1 :4-line )and(NW=1), Double height =1 Enable, Extension register, RE"0", Extension register, IS"0" )
    break;
  case 4:
    sendCommand(B00011100);  //MODE 4 0x1C / Double Height (4-line)/Display-dot shift(DH’ = "0": display shift DIS)
    sendCommand(0x2C);//101100 Function Set ( when (N=1 :4-line )and(NW=1), Double height =1 Enable, Extension register, RE"0", Extension register, IS"0" )
    break;
  }
}
« Last Edit: January 29, 2016, 04:28:55 PM by Chris O. »

Chris O.

  • Jr. Member
  • **
  • Posts: 35
  • Karma: 5
    • View Profile
Re: Scrolling on NHD-0420CW-AY3(US2066)
« Reply #3 on: January 29, 2016, 05:16:32 PM »
The IS logic bits are set by Function Set, p27(Bottom of the Page)
Please Note the continuation of Function Set is on the next page 28 (Top of the Page)
The RE logic bits are set on page 28.
Now comes the tricky part, as soon as you set the RE logic bit to 1, you're in control of the bits on page 28.

Hope this helps.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: Scrolling on NHD-0420CW-AY3(US2066)
« Reply #4 on: February 05, 2016, 08:12:10 AM »
Thanks for sharing your solution Chris!


 

NHD‐0420CW‐AB3 I2C Interface

Started by andersonpdBoard OLEDs

Replies: 1
Views: 2630
Last post January 23, 2015, 10:00:06 AM
by Michael_L
NHD‐0420CW‐AG3 Contrast question

Started by RichardRBoard OLEDs

Replies: 2
Views: 2147
Last post January 16, 2016, 09:52:02 AM
by RichardR
NHD‐0420CW‐AG3: blinking part of text?

Started by RichardRBoard OLEDs

Replies: 2
Views: 2301
Last post February 28, 2017, 03:27:02 PM
by BobG
NHD‐0420CW‐AG3 + I2C + PIC assembly code: trouble getting started

Started by RichardRBoard OLEDs

Replies: 4
Views: 3143
Last post December 17, 2015, 03:12:49 AM
by RichardR
MOVED: NHD-0420CW-AY3 display, text is mirror image

Started by Saurabh_BBoard Character LCDs

Replies: 0
Views: 2065
Last post March 11, 2016, 07:51:03 AM
by Saurabh_B