Hi bengchet, Ober, Idris
Tested exactly the same code, library settings as forwarded to you.
But this time, I connected the LCD, and trimpot off board. Not using SK40C LCD port.
It works perfectly ok.
So, I do not see any problems with the code and library settings.
What is puzzling to me is why it does not work when connected to SK40C LCD port.
There is no shorting between header pins, continuity check between SK40C LCD port header pins to respective 18F4550 pins shows nothing open.
The only difference I see is that you have hard ground for PIN5 of the SK40C LCD port.
But when I use off board, I do not short pin5 to ground but let the library assert the pin5 logic to 0.
Please help advice. I am having a number of students using the SK40C and would appreciate a fix for this.