0420CW comes up mirror image with 1sec power cycle
I'm using the display in SPI mode with an 8-bit PIC microcontroller.
On initial startup the display works fine. If I cycle power for about 1 second, it displays as a mirror image and ROM C is selected rather than ROM A. If power cycles quicker or longer than about 1 sec the initialization is normal.
I've tried extending all three delays in the initialization sequence significantly (up to 2 seconds each) and adding an additional delay after enabling the 4-line display and before setting the L-R direction.
This is 100% repeatable. Any help is much appreciated.
Initialization code is below.
Thanks...
void DisplayInitialize(void)
{
/* Refer to display device and controller documentation:
* NHD-0420CW-AB3 (Newhaven)
* US2066 (WiseChip Semiconductor)
*
* This initialization sequence is from the Newhaven
* document.
*/
DISP_CS_SetHigh();
DISP_RST_SetLow();
DelayMs(1);
DISP_RST_SetHigh();
DelayMs(1);
WriteCommand(0x08); // Display off, cursor off, blink off
WriteCommand(0x2A); // Select extended command set
WriteCommand(0x79); // Enable OLED command set
WriteCommand(0xD5); // Set display clock divide
WriteCommand(0x70); // ratio/oscillator frequency
WriteCommand(0x78); // Disable OLED command set
WriteCommand(0x09); // Extended function set: enable 4-line display
WriteCommand(0x06); // Set direction left to right
WriteCommand(0x72); // Select ROM character
WriteData(0x00); // set A
WriteCommand(0x2A); // Select extended command set
WriteCommand(0x79); // Enable OLED command set
WriteCommand(0xDA); // Set SEG pins
WriteCommand(0x10); // hardware configuration
WriteCommand(0xDC); // Set internal Vsl (Voltage Output Low Level for
WriteCommand(0x00); // SEG Signal) & US2066 controller GPIO disabled
WriteCommand(0x81); // Set contrast to
WriteCommand(0x0F); // 0x0F (range 0x00 - 0xFF))
WriteCommand(0xD9); // Set phase lengths of
WriteCommand(0xF1); // segment waveforms
WriteCommand(0xDB); // Set Vcomh
WriteCommand(0x40); // deselect level
WriteCommand(0x78); // Disable OLED command set
DisplayClear();
DelayMs(100);
}
void DisplayClear(void)
{
WriteCommand(0x28); // Select fundamental command set
WriteCommand(0x01); // Clear display
WriteCommand(0x80); // Set DDRAM address to 0x00 (Home)
WriteCommand(0x0C); // Display on, cursor off, blink off
}
-
Hello breinhold,
The initialization routine looks good so far, although our init routine on our datasheets lists a few more commands in the beginning section before command(0x08). Please try incorporating these missing commands in your init sequence for good measure.
We will try to replicate the observed issues on our end as well to see if there is some sort of pattern or if this related to the display you're using. If you have more than 1 display to test, is this happening across all displays?
As a band-aid solution, try including those pertinent commands related to selecting ROM A and the proper scan direction after your init sequence but before your main program begins to see if this helps its behavior with a shorter power cycle.
Best,0 -
Hello breinhold,
The initialization routine looks good so far, although our init routine on our datasheets lists a few more commands in the beginning section before command(0x08). Please try incorporating these missing commands in your init sequence for good measure.
We will try to replicate the observed issues on our end as well to see if there is some sort of pattern or if this related to the display you're using. If you have more than 1 display to test, is this happening across all displays?
As a band-aid solution, try including those pertinent commands related to selecting ROM A and the proper scan direction after your init sequence but before your main program begins to see if this helps its behavior with a shorter power cycle.
Best,That's good to know! Thank you!0
Please sign in to leave a comment.
Comments
2 comments