Can anyone explain the flow chart or algorithm of the program attach? The program is about LCD clock but I don't know how it works. I need it by tomorrow so please help me take a look. Thanks

Sorry, too late for me tonight to pick this thing apart!

What flowchart?
The LCD is a 16x2,
The PIC uses 32 byte LCD shadow buffer in ram.

RA4 = LED L=On H=Off
RA1 = LCD Enable 1=Enable __/--\__
RA0 = RS 0=instruction 1=data

RB4...RB7 (out) are upper 4 bits of data to LCD
RB3 (in) Tens of hours Button
RB2 (in) Hours Button
RB1 (in) Tens minute Button
RB0 (in) Minutes Button

Has four buttons for setting time on PortB 0...3

Thanks, but that all the program works? It seems to be very long program. And also did the program mention about the LCD clock is in Parallel connection or Serial Connection?

It'sin parallel. The Enable pin is more like a clock, as it clocks in the data. The part I didn't see is that it has eight data lines. The upper 8-bits are connected to Port B RB4-RB7. The chip has an 8-bit and 4-bit operation, and its being used in 4-bit mode. The upper four bits are transferred first, then the lower four bits. The chip uses pin RB7 as a handshake pin to indicate that write has been completed! The chip can read and write.
I'm not sure how the chip knows its in 4-bit versus 8-bit mode! It may be related to the timing sequence. It appears that its timing based, 8-bit uses one enable pulse, and 4-bit uses two enable pulse. The falling edge is the trigger to start the operration.
The LCD has a reprogrammable 256 character generator for changing the font characters.

The code stores its hour, min, second in BCD and then convert it to ASCII and store it in the LCD shadow. Then when a change occurs, clocks the 32 character data bytes from the shadow into the LCD display buffer. You set the write data address but the chip has an auto-increment so once a memory address has been clocked, it advances to the next.

Here's a link I found to the LCD chip.

Read the specs.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.