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 - stylonurus

Pages: [1]
1
OLEDs / Re: NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 17, 2014, 06:08:50 PM »
Mike,
Thanks for checking this out.

As it stands, I got this to work by writing the function set command twice in the initialization routine.
   writeOledCommand(0x3B); //     Function Set
   writeOledCommand(0x3B); //     Function Set

Looks like some voltage or wiring issue on the extender board. That' all I can think of.

Thanks again,

2
OLEDs / Re: NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 12, 2014, 10:23:18 AM »
Michael,

I used a delay timer called spinlock to slow things down. I've tried different delay times as well but the delay does not seem to help or change behavior.
More than not, the two lines occur on a cold power up cycle. After running a while if I quickly re power , the four lines appear most of the time. After waiting 5 seconds between powering up the 2 lines appear most of the time.  I tied delaying 3 seconds after power up and before call initialization routine. It did not improve behavior.
All comments, ideas and suggestions are most welcome.

Thanks

void oledInit(void)
{

   P4 = 0x00;   //initialize PORT 4 to 0x00
   spinLock(1,  ONE_MS_RELOAD);      // Spin 1 ms
   LCD_RW = 0;
   spinLock(1,  ONE_MS_RELOAD);      // Spin 1 ms
   LCD_E = 1;
   spinLock(1,  ONE_MS_RELOAD);      // Spin 1 ms


   writeOledCommand(0x3B);           //     Function Set
   writeOledCommand(0x08);           //     Display Off
   writeOledCommand(0x01);           //     Display Clear
   writeOledCommand(0x06);           //     Entry Mode Set
   writeOledCommand(0x02);           //     Home Command
   writeOledCommand(0x0C);          //      Display On
   spinLock(5,  ONE_MS_RELOAD);   //     Spin 5 ms
}


void writeOledCommand(U8 cmd)
{
   // write command
   LCD_RS = 0;
   spinLock(1,  ONE_MS_RELOAD);
   P4 =  cmd;
   spinLock(1,  ONE_MS_RELOAD);
   LCD_E = 1;
   spinLock(1,  ONE_MS_RELOAD);
   LCD_E = 0;
}

3
OLEDs / NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines
« on: June 11, 2014, 07:11:23 PM »
This problem is a bit strange for me and I'm not sure if it's a hardware issue or a software issue. But I have now seen it on both of my test boards.
I am using a Silabs C8051F500 development board with jtag connection for IDE / debuggger.
Silabs board has extender board with OLED display.
Mostly everything works fine.
I have written the driver and a library of routines to write to any line of the display (parallel interface).

The problem.
When I re power the system only lines 1 and 3 are displayed. 2 and 4 are not displayed
But when I connect with the debugger and then disconnect. On the disconnect all the lines including the second and fourth line get displayed. ( might have to connect disconnect 3 or 4 times before 4 lines get displayed)
Once all 4 lines are displayed, they are always displayed.
Is this a timing issue?
A power up voltage issue?
Something else?

Please let me know if you have seen this before.

Thanks

4
OLEDs / Re: NHD-0420DZW-AG5 parallel interface
« on: May 27, 2014, 03:47:03 PM »
Michael,
Thanks for posting the code for the parallel interface. This really helped me. My major problem was the toggling of E in the data write routine. I was setting it high before the write out to the PORT. If you study the diagram in the data sheet you would think that this would be correct.

I also a different sequence with RS, E and RW prior to the initialization sequence although it working none the less. Although I still have not tested it with another display, this configuration appears to be more stable than my original yet somewhat slower. Not sure why but working on it. Thanks Again. I really appreciate it.

5
OLEDs / NHD-0420DZW-AG5 parallel interface
« on: May 22, 2014, 07:16:08 PM »
I am programming a C8051F500 (from Silicon Labs) with the OLED character display mentioned above. I am using a parallel interface as described on page 11 of the data sheet. For the most part I have it working and even wrote a small library. I then received a second display all wired correctly like the first, plugged it in and found that all the characters would now being displayed twice.
After some debugging I noticed a few things that I did not understand.

1. In the writeOledData routine I ended up commenting out the LCD_RW = 1 to stop the duplicates from occurring. Why would this make fix the problem?
    And now any character over 0x7F completely overwites the display with some character above 0x7F. Often it is a 0xB9 but after it is written, its a lot of work to get it back to normal. Loading code or power cyccling don't help. It's stuck in this bad display state????

2. In order to display the character on the display I use the toggle_E() which just performs a LCD_E = ~LCD_E
    If I try to use implicit calls LCD_E = 1 followed by LCD_E =0 around the P4=cmd statement (see below), (or vicaversa) something strange happens like the 2nd and 4th line never get displayed.   

3. Lastly, Once I get all bad characters as I mentioned above in 1, I can load from a debugger (IDE) a previously working hex and it won't matter. It still remains bad even after I power off and back on.

It would help to look at working example that uses a parallel interface. All the examples I have seen use serial. Below is the code for my data write.

Thanks


void writeOledData(U8 cmd)
{
   U8 checkBusy;
   U8 eValue;

   // write data
   LCD_RS = 1;
   LCD_RW = 0;

   toggle_E();
   P4 =  cmd;
   toggle_E();


   spinLock(1,  ONE_MS_RELOAD);      // Spin 1ms or so
   // check for busy
   //LCD_RW = 1;  // causes double characters
   //LCD_RS = 0;   // does nothing

   // As long as I write a character that has a value 0x7F or less
  // CheckBusy is always returns high bit not set
   checkBusy = P4;
   while (checkBusy & 0x80)   {
       spinLock(1,  ONE_MS_RELOAD);      // Spin 1ms or so
       checkBusy = P4;
       eValue++;
       if ( eValue >= 10) {
             toggle_E();        // This actually runs with characters higher than 0x7F and sometimes works
       }
   }

}

Pages: [1]