be. PIC18F2xJ50 Digital Clock with LCD example
LCM1602K-FL-YBS LCD is actually relatively simple to connect to a 5 V PIC18F2550 microcontroller, but it might be quite a challenge to connect it to a 3.3 V PIC18F2xJ50 microcontroller via 4-bit connection. Some might ask, why would have someone wanted to use 4-bit data connection instead of a standard 8-bit connection, but PIC18F2xJ50 microcontrollers just has 28-pins and it is not a bad idea to spare four pins for future use by other devices.
LCM1602K-FL-YBS LCD has a character generator with a two lines by 16 characters display with an inbuilt SUNPLUS SPLC780D controller. An 8-bit connection would not speed up the character display due to relatively fast SPLC780D response times.
SPLC780D can operate on 2.7 V or more, but LCM1602K-FL-YBS LCD would only work with 5 V power supply, but it has 3.3 V compatible inputs. So it can be directly connected to 3.3 V microcontroller outputs. However, a 3.3 V microcontroller can only receive data from LCM1602K-FL-YBS LCD panel via a voltage converter. One may avoid a voltage converter by connecting the LCD R/W signal to the ground. This prevents the display panel to send data and also spared one of the microcontrollers I/O pins. This way only 6 PIC18F2xJ50 pins are needed to connect the display. But proper delays must be used not to exceed the LCD response times for longer operations.
Get the Digital Clock with LCD example for PIC18F2xJ50 (PIC18F2xJ50 Digital Clock with LCD example.zip) from Downloads section for more information. The example works with PIC18F2xJ50 formware v2.5 or newer.
There is also an advanced Digital Clock example for PIC18F2xJ50 (PIC18F2xJ50 Digital Clock with LCD example v3.zip) that works with PIC18F24J50 firmware v2.6.3 or newer and PIC18F26J50 firmware v2.6.3 or newer. It enables independant LCD clock operation. See Programming Guide for more infromation on programing.
Click on the photo to enlarge it.