At first I'd like to thanks a lot "Great Cow Basic" developpers !!! It's a very great work :-)
Today I've tried LCD library and I get the same problem than two other people on the forum : my LCD only displays black blocks on the first raw.
I need to precise that this issue only appears on PIC reset and never after a power-up. Logicaly hardware reset of the LCD was not done again after a PIC reset.
I modified "InitLCD" function in "lcd.h" library to include soft reset of the LCD :
'------ Initialize lcd with soft reset (from HD44780 datasheet) -------'----------- LCD_IO_2 was not modified, only 4 and 8 bits partssubInitLCD#IFDEF LCD_IO 2DIRLCD_DBOUTDIRLCD_CBOUTSETLCD_DBOFFSETLCD_CBOFFWait35msSETLCD_RSOFFLCD2_NIBBLEOUT0X03Wait5msLCD2_NIBBLEOUT0X03Wait1MSLCD2_NIBBLEOUT0X03Wait1MSLCD2_NIBBLEOUT0X02Wait1MSLCDWriteByte0x28Wait1MSLCDWriteByte0x08Wait1MSLCDWriteByte0x01Wait5MSLCDWriteByte0x06WAIT1MSLCDWriteByte0x0CWAIT1MS#ENDIF#IFDEF LCD_IO 4,8DIRLCD_DB4OUTDIRLCD_DB5OUTDIRLCD_DB6OUTDIRLCD_DB7OUTDIRLCD_RSOUT#IFNDEF LCD_NO_RWDIRLCD_RWOUT#ENDIFDIRLCD_EnableOUTSETLCD_RSOFFSETLCD_RWOFFSETLCD_EnableOFFSETLCD_DB4OFFSETLCD_DB5OFFSETLCD_DB6OFFSETLCD_DB7OFF' wait for more than 15ms after power up Wait 35 ms 'Functionset(Interfaceis8bitslong.)SETLCD_DB4ONSETLCD_DB5ONPulseOutLCD_Enable,LCD_Write_DelayWait6ms' Function set (Interface is 8 bits long.) SET LCD_DB4 ON SET LCD_DB5 ON PulseOut LCD_Enable, LCD_Write_Delay Wait 6 ms 'Functionset(Interfaceis8bitslong.)SETLCD_DB4ONSETLCD_DB5ONPulseOutLCD_Enable,LCD_Write_DelayWait6ms#IFDEF LCD_IO 8LCDWriteByte(b'00111000')#ENDIF#IFDEF LCD_IO 4' set IO mode to 4bit SET LCD_DB4 OFF SET LCD_DB5 ON PulseOut LCD_Enable, LCD_Write_Delay SET LCD_RS OFF LCDWriteByte(b'00101000') 'functionset:display2lineswaitLCD_Write_Delay#ENDIFLCDWriteByte(b'00001000')' 0x08 : display off wait LCD_Write_Delay LCDWriteByte(b'00000001') '0x01:displayclearwaitLCD_Write_DelayLCDWriteByte(b'00000110')' xx06 : set entry mode (increment by 1, no shift) wait LCD_Write_Delay LCDWriteByte(b'00001100') '0x0C:displayon/cursoroffcontrolwaitLCD_Write_Delay#endifendfunction
Best regards,
Edorul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a situation when using LCD_NO_RW that still causes the display to corrupt after a watchdog reset or brown-out
to resolve it is simply a matter of calling your InitLCD subroutine in the code start / initialize area.
In the contributor section I have submitted the entire lcd.h library with your code added.
It also includes timing fixes for when using LCD_NO_RW as there seems to be a lot of confusion
and frustration with this (seperate) issue.
Also, code has been added to make the Arduino Mega (AVR 2560) work properly with the popular 5 button LCD shield.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for this code it is very useful.
When using LCD_NO_RW the LCD will corrupt.
Simply call the InitLCD subroutine in the code intializing routine to resolve this issue
For a complete solution with your code included please see the contributors section.
A new LCD routine with fixes for NO_LCD_RW has been included
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
At first I'd like to thanks a lot "Great Cow Basic" developpers !!! It's a very great work :-)
Today I've tried LCD library and I get the same problem than two other people on the forum : my LCD only displays black blocks on the first raw.
I need to precise that this issue only appears on PIC reset and never after a power-up. Logicaly hardware reset of the LCD was not done again after a PIC reset.
I modified "InitLCD" function in "lcd.h" library to include soft reset of the LCD :
Best regards,
Edorul
Thankyou for writing this code. It works well.
There is a situation when using LCD_NO_RW that still causes the display to corrupt after a watchdog reset or brown-out
to resolve it is simply a matter of calling your InitLCD subroutine in the code start / initialize area.
In the contributor section I have submitted the entire lcd.h library with your code added.
It also includes timing fixes for when using LCD_NO_RW as there seems to be a lot of confusion
and frustration with this (seperate) issue.
Also, code has been added to make the Arduino Mega (AVR 2560) work properly with the popular 5 button LCD shield.
Thanks for this code it is very useful.
When using LCD_NO_RW the LCD will corrupt.
Simply call the InitLCD subroutine in the code intializing routine to resolve this issue
For a complete solution with your code included please see the contributors section.
A new LCD routine with fixes for NO_LCD_RW has been included