Newhaven 128x64 ST7565 LCD NHD-C12864WC-FSW-FBW-3V3-M does not power on reliably
Hi Everyone,
I recently decided to use a NHD-C12864WC-FSW-FBW-3V3-M http://www.mouser.com/ds/2/291/NHD-C12864WC-FSW-FBW-3V3-M-53730.pdf in a project. It has been extremely painful to get this nice LCD to work at all. Over 2 days of debugging ive noticed a lot of strange behavior. Hopefully someone can help me to get the LCD to work reliably.
I am using the LCD in SPI mode, the LCD is connected like so:
I am using it in serial SPI mode. I have tied WR to ground and RD to 3v3 because i only intend to write to the LCD. Furthermore, ive tied PS to ground to indicate serial mode and i have left C86 floating (i think in serial mode the controller doesnt care about this pin..)
Im using a PIC MCU and ive written the following test code:
//Init code
CS_LCD(0);
Rst_LCD(0);
Rst_LCD(1);
MS_LCD(0);
Write_SPI1(0xA3);
Write_SPI1(0xA0);
Write_SPI1(0xC8);
Write_SPI1(0xA4);
Write_SPI1(0x40);
Write_SPI1(0x25);
Write_SPI1(0x81);
Write_SPI1(3);
Write_SPI1(0x2F);
Write_SPI1(0xB0);
Write_SPI1(0xAF);
CS_LCD(1);
//Test Pattern code
CS_LCD(0);
unsigned int i, j;
unsigned char page = 0xB0;
for (i = 0; i < 8; i++){
MS_LCD(0);
Write_SPI1(0x10);
//set column address
Write_SPI1(0x00);
//set column address
Write_SPI1(page);
//set page address
for (j = 0; j < 128; j++)
{
MS_LCD(1);
Write_SPI1(0x80);
}
page++;
}
CS_LCD(1);
The code should draw lines on the display but the screen does not turn on at all. After a lot of head scratching i randomly took another capacitor and connected it across the LCDs capacitors on the PCB and every now and then the LCD comes to life! It displays my test pattern partially, but the pattern is not perfect, there seems to be random junk in places.
Now here is the weird bit, if i leave the capacitor exactly where it was connected when the LCD turned on, and i restart the LCD, it does not turn on again! I need to again play around with this external capacitor connecting it across the LCDs capacitors and then randomly it would turn on again.
I am not familiar with these LCDs, but to me it seems as if the onboard DC DC converter that generates the LCDs voltages does not start up, but giving it some extra capacitance sometimes brings it to life and the lcd works partially.
I am really lost can someone please help me.
-
Morning adilmalik,
Thank you for contacting us with this inquiry, I am happy to help
I found a couple discrepancies in your Eagle schematic, the ST7565R controller datasheet indicates "/RD", "/WR", and "C86" should be fixed High.
Please see page 23 in the controllers datasheet (Table 1):https://newhavendisplay.com/content/app_notes/ST7565R.pdf
Another recommendation is to try and add some delays in your initialization sequence. It is important to make sure that the LCD controller has finished executing an instruction before sending it another one, otherwise the second instruction will be ignored.
Hope this helps, keep us posted on your progress!0 -
thanks for the help! This time i built it on a breadboard, with the pins to high. Still nothing. Any other ideas :/0
-
I have some good news. I have pin pointed the problem: The problem is the fact that the internal DC DC convertor is not producing the correct voltage across C50 (from pin 23 to VCC). When i remove C50 and supply pin 23 with +2V or thereabouts everything works. What is going on?0
-
I had exactly this problem with this exact GLCD ! On the VREG pin, you should be getting 10.5 volts resulting from the step-up circuit which supplies the LCD's contrast. When mine was not working properly, it was also around 2 volts.
Like said before, make sure you put a delay, it is quite important I believe. I also noticed your initialization sequence differs slightly from mine.
Assuming you followed the model initialization sequence as written in the datasheet, your first byte, 0XA3, seems incorrect... this GLCD requires a 1/9 bias , where as you seem to be putting it at 1/7 (not sure if this would issue that problem though) .
Again assuming you followed the datasheet model, your last byte in the initialization is 0xB0 . Mine is set at 0xAF in order to turn on the GLCD, perhaps it is not on?
The datasheet also puts a delay between the moment you set A0 for command or data and the first byte you send to the GLCD, try putting a delay between 2 and 20 ms , like this:
A0 Pin = 0 ;
delay_ms(2 - 20 ms)
data
Hope I could be of help! I've also been struggling with this glcd. I have a different issue to resort now though.0
Please sign in to leave a comment.
Comments
4 comments