Dear members, I am using 16x4 OLED with HD44780 chip. The sketch has been programmed for LCD initialization and then starting at (0,0) location of LCD. Everything is all right except one thing that when I reset the board pressing the reset button, the display skips row and starts from 2nd row 0 position. When I reset again it starts from 3rd row 0 position and so on. I got to reset it few times to bring it in proper position of 1st row. Is there any method to rectify this problem ? What am I missing ? Setup is proper and LCD initialization as per Arduino tutorials.
What am I missing ?
You haven't supplied us with the identification of your specific display nor have you given us a copy of your code.
I doubt that your display is using a true HD44780 or an exact clone. Most likely it is using something else that uses a compatible instruction set but is set up to drive the OLED rather than an LCD. It's operation is similar enough so that the LiquidCrystal library works under ideal circumstances but not under those you describe.
When you reset your Arduino by pressing it's reset button you are restarting the code in the Arduino, but the processor in your display is still running along oblivious of the fact that the Arduino has restarted.
The code in the LiquidCrystal library will effectively do a 'software reset' of an HD44780 driving an LCD but is apparently not resetting your device, hence the operation that you describe.
Don
Thanks for heads up. The datasheet says compatible with HD44780, KS0066 , SPLC780 , ST7066 , AIP31066 ICs and page no. 10 of datasheet says about initialization. Perhaps you can help me to create a function to reset the OLED. Attaching the datasheet.
PHC1604AW-JT.pdf (1.07 MB)
The timing looks a little less stringent and there appears to be one instruction missing from the 4-bit flowchart but it looks to me that the LiquidCrystal library should successfully reset that device. I couldn't really verify anything without having a similar display in hand.
Why don't you try the HD44780 library which is available via the library manager? It was really designed for I2C devices but it also handles the parallel interface.
Don
floresta:
The timing looks a little less stringent and there appears to be one instruction missing from the 4-bit flowchart but it looks to me that the LiquidCrystal library should successfully reset that device. I couldn't really verify anything without having a similar display in hand.Why don't you try the HD44780 library which is available via the library manager? It was really designed for I2C devices but it also handles the parallel interface.
Don
I am using the same library that is default in arduino library