Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lasteem1

Pages: [1]
1
OLEDs / Re: NHD-0420DZW 8-bit interface
« on: February 02, 2015, 07:03:42 PM »
I figured out my problem. The resistor network on the oled was configured to the 8080 instead of 6800.  :-[    Everything works fine now. Thanks for your help.

2
OLEDs / NHD-0420DZW 8-bit interface
« on: February 01, 2015, 04:20:23 PM »
I'm attempting to transition from a LCD to a NH OLED. Starting out I'm trying  to make some sample code given out by an Admin on this forum work. That thread with code can be found here: http://www.newhavendisplay.com/NHD_forum/index.php?topic=61.0

I'm using a Silicon Labs C8051F020 and a NHD-0420DZW. I can't even get the display to come on. I've tried adjusting the timing of various interactions, but no results. Here is my code with some remnants of the changes I've tried.


const char text1[] = {"  Newhaven Display  "};
const char text2[] = {"   Character OLED   "};
const char text3[] = {"  4 Line x 20 Char  "};
const char text4[] = {"0123456789!@#$%^&*()"};

const char text5[] = {"Line 1"};
const char text6[] = {"Line 2"};
const char text7[] = {"Line 3"};
const char text8[] = {"Line 4"};

void command(char c)

  PORTOUT1 &= RSEOFF;// digitalWrite(RS, LOW);
   PORTOUT0 = c;//PORTD = c;
   PORTOUT1 |= EON;//digitalWrite(E, HIGH);
   wait_(10);
   PORTOUT1 &= EOFF;//digitalWrite(E, LOW);
   wait_(100);
}

void dataOled(char d)
{
   PORTOUT1 |= RSON;//digitalWrite(RS, HIGH);
   PORTOUT0 = d;//PORTD = d;
   PORTOUT1 |= EON;//digitalWrite(E, HIGH);
   wait_(10);
   PORTOUT1 &= EOFF;//digitalWrite(E, LOW);
   wait_(100);
}

void disp2()
{
   int i;
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   wait_(5);
   for (i=0;i<6;i++)
   {
      dataOled(text5);
   }
   wait_(250);
   for (i=0;i<14;i++)
   {
      command(0x1C);
      wait_(40);
   }
   command(0x01);  //Display Clear
   wait_(2);
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   command(0xC0);  //Second Line  [Set DDRAM address to Line 2 position 1]
   for (i=0;i<6;i++)
   {
      dataOled(text6);
   }
   wait_(250);
   for (i=0;i<14;i++)
   {
      command(0x1C);
      wait_(40);
   }
   command(0x01);  //Display Clear
   wait_(2);
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   command(0x94);  //Third Line  [Set DDRAM address to Line 3 position 1]
   for (i=0;i<6;i++)
   {
      dataOled(text7);
   }
   wait_(250);
   for (i=0;i<14;i++)
   {
      command(0x1C);
      wait_(40);
   }
   command(0x01);  //Display Clear
   wait_(2);
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   command(0xD4);  //Fourth Line  [Set DDRAM address to Line 4 position 1]
   for (i=0;i<6;i++)
   {
      dataOled(text8);
   }
   wait_(250);
   for (i=0;i<14;i++)
   {
      command(0x1C);
      wait_(40);
   }
   command(0x01);  //Display Clear
   wait_(2);
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
}

void OledSetup()
{
 //  DDRD = 0xFF; //initialized elsewhere
 //  PORTD = 0x00;  //initialized elsewhere
  // pinMode(RS, OUTPUT);//initialized elsewhere
 //  pinMode(RW, OUTPUT);//initialized elsewhere
 //  pinMode(E, OUTPUT);//initialized elsewhere
 //  digitalWrite(RW, LOW); //set to gnd in hw
   PORTOUT1 |= EON;
   command(0x38);  //Function Set  [8-bit mode, Font Table: English/Japanese (FT[1:0] = 00)]
   command(0x08);  //Display OFF
   command(0x01);  //Display Clear
   command(0x06);  //Entry Mode Set  [Auto increment address when a character is written]
   command(0x02);  //Home Command  [Set DDRAM address to Line 1 position 1]
   command(0x0C);  //Display ON
}

void Oledloop()

  disp1();
  wait_(3500);
  command(0x01);  //Display Clear
  disp2();
  wait_(50);
}

  Other than an issue of timing what could I be missing? Any help here would be greatly appreciated!

Pages: [1]