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.


Topics - stylonurus

Pages: [1]
1
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

2
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]