Author Topic: NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT  (Read 3101 times)

wb2dyb

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT
« on: April 12, 2015, 11:58:47 PM »
Well, learned more but really having trouble figuring out the command structure. And have a display lash up on the desk, and keep fiddling with codes and cannot seem to figure out the three line mode with the two middle lines of the display serving as one double height line. I think, but not certain, that I just cannot figure out how to manipulate the IS and RE bits. And when I try what I think should work, it doesn't.

Has anybody been able to do this? I stumbled into it by accident, thought I had it, but as soon as I power cycled the thing it went to plain old 3 line mode. If I hit Arduino reset it comes back where I want it. What I'm looking to do is exactly as shown in the US2066 data page 37 table 7-2, second image down.

Then there is the table in 7-1 where the UD1 bit is shown as 1 for what I'm looking to do. But the instructions clearly states just above the images that UD1=0 is forbidden in 3 line mode. the first image shows UD1=0, and it is a 3 line display.

As I manipulate these bits I never see a particular bit doing what is shown in this data.

My code:

#include "Wire.h"
#include "OLedI2C.h"
#include "SoftReset.h"
OLedI2C LCD;

void setup()
{
  Wire.begin();
  LCD.init();
 
}
void loop()
{
     /////LCD.sendCommand(B00101010);
     LCD.sendCommand(B00101100); //0100 and 1100 wok
     
/////LCD.sendCommand(B00101110);
  //LCD.sendCommand(B00101000);
   // LCD.sendCommand(B00101010);
  //LCD.sendCommand(B00010000);
  /////LCD.sendCommand(B00101010); //function setset re=1 is=0 3/4 line"
/////LCD.sendCommand(B00101110);
  //LCD.sendCommand(B00001001);  //display on
  LCD.sendCommand(B00101010);
  LCD.sendCommand(B00010101); //3 line format if is=0 & re=1
 

  //LCD.cursPos(1,0);
  //LCD.sendData(00);
 
  delay(100);

 
  LCD.sendString("FREQ  USB  NB  SQ   ",0,0);
  LCD.sendString("14.300.00           ",0,1);
 
  LCD.sendString("RXTX BAND  SQ  DSP >",0,2);
 //LCD.sendString("04",0,3);
  while(1);
}



_______________________________________________

Anything like a command cheat sheet?

Thanks, everyone.

GeorgeC

Dandy

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT
« Reply #1 on: June 30, 2015, 08:44:20 AM »
I have a similar requirement - I wanted the top line double height and the bottom two lines normal.  I got that to work, after a fashion, but there is a gap between the top half of the double-height characters, and the bottom half. Looking at the display, it does look like the OLED is arranged as 4 rows of 20 characters, with gaps between.  So the double-height characters will ALWAYS have a gap in the middle like a black belt.  This would be true of your requirement too.  I think the display is a 4x20 whether that's what you want or not!

Any comments from anyone?

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT
« Reply #2 on: July 01, 2015, 09:36:54 AM »
Hello,

Our Slim OLED character displays are available in 2x16, 2x20, and 4x20 character formats.

When you send the Double Height command you are doubling the size of the text. i.e Combining the rows (see picture attached).


I recommend looking at our Graphic OLED displays if a standard character display will not fit your requirements:

http://www.newhavendisplay.com/oled-graphic-oled-c-119_577.html


Hope this helps!








Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 248
  • Karma: 16
    • View Profile
Re: NHD0420CW-A*3 tHREE LINE MODE, MIDDLE LINE DOUBLE HEIGHT
« Reply #3 on: July 01, 2015, 09:49:46 AM »
Finally, please see the example Double Height Arduino Sketch below, before proceeding download NHD's US2066 Arduino Library and place the Sketch in the example folder:

https://github.com/NewhavenDisplay/NHD_US2066

Code: [Select]
//---------------------------------------------------------
/*

DoubleHeight.ino

Program for writing to Newhaven Display Slim OLEDs based on US2066 controller.

Pick one up today in the Newhaven Display shop!
------> http://www.newhavendisplay.com/oled-slim-character-oleds-c-119_825.html

This code is written for the Arduino Mega.

Copyright (c) 2015 - Newhaven Display International, Inc.

Newhaven Display invests time and resources providing this open source code,
please support Newhaven Display by purchasing products from Newhaven Display!

*/
//---------------------------------------------------------

#include <SPI.h>
#include <Arduino.h>
#include <Wire.h>
#include <avr\io.h>

#include "NHD_US2066.h"
unsigned char text1[]   = {"Newhaven Display    "};
unsigned char text2[]   = {"International       "};
unsigned char text3[]   = {"123456789           "};
unsigned char text4[]   = {"ABCDEFGHI           "};

unsigned char text5[]   = {"New Slim Profile    "};
unsigned char text6[]   = {"2 or 4 Lines        "};
unsigned char text7[]   = {"16 or 20 CHAR       "};
unsigned char text8[]   = {"OLED Modules        "};


unsigned char text9[]   = {"2.8V or 5V Power    "};
unsigned char text10[]  = {"Built-in Reg        "};
unsigned char text11[]  = {"Parallel or         "};
unsigned char text12[]  = {"Serial Interface    "};
unsigned char text13[]  = {"3 Font Tables       "};
unsigned char text14[]  = {"===================="};
unsigned char text15[]   ={"***   Built-in   ***"};
unsigned char text16[]  = {"--------------------"};



void output()
{
int i;
       
        command(0x2E);
        command(0x1C);
        command(0x2C);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text1[i]);
        }
        delay(5);
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
       
        delay(7000);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text3[i]);
        }
        delay(5);
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
       
        delay(7000);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text5[i]);
        }
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
       
        delay(7000);
       
        command(0x28);
        delay(5);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text6[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text7[i]);
        }
        delay(5);
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text16[i]);
        }
       
        command(0xE0);
        delay(5);
        for(i=0;i<20;i++){
          data(text16[i]);
        }
       
        delay(7000);

        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text9[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text10[i]);
        }
        delay(5);
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
        command(0xE0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
       
        delay(7000);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text11[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text12[i]);
        }
        delay(5);
       
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
        command(0xE0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
       
        delay(7000);
       
        command(0x01);
        delay(5);
        for(i=0;i<20;i++){
          data(text13[i]);
        }
        delay(5);
       
        command(0xA0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
        delay(5);
       
       
        command(0x2E);
        command(0x10);
        command(0x2C);
       
     
        command(0xC0);
        delay(5);
        for(i=0;i<20;i++){
          data(text15[i]);
        }
        delay(5);
       
        command(0xE0);
        delay(5);
        for(i=0;i<20;i++){
          data(text14[i]);
        }
   
         delay(7000);
         
}


void blocks()
{
int i;

        command(0x01);
        delay(5);

        for(i=0;i<20;i++){
          data(0x1F);
        }

        command(0xA0);
        for(i=0;i<20;i++){
          data(0x1F);
        }
}

void setup()
{
init_oled();
}

void loop()

  while(1)
  {
    output();
    //blocks();
    delay(2000);
  }
}

 

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

Started by guenterBoard TFTs

Replies: 0
Views: 1934
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: 2994
Last post December 15, 2014, 05:12:27 PM
by Michael_L
NHD-2.4-240320CF-CSXN#-F works in 18 bits(262K colors) mode

Started by charlieBoard TFTs

Replies: 3
Views: 2149
Last post March 15, 2016, 10:39:50 AM
by Saurabh_B
Text orientation not changing with Extended Entry Mode Set Register

Started by tekknojoeBoard OLEDs

Replies: 5
Views: 1385
Last post January 27, 2017, 10:13:57 AM
by jmadsenee
Large custom fonts in 8080 parallel mode

Started by bluedog54Board OLEDs

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