Sketch downloads but doesn't execute.

I'm trying to build a digital clock. I'm not using a Reat Time Clock module
I have a Arduino Nano and a 16,2 LCD with a backpack.

I took a Arduino UNO sketch that was for a parallel driven LCD and change the
LCK to take the serial 16,2 LCD with a back pack.

Hello world works great. a digital voltmeter that I programed works great, but
the clock sketch compiles and downloads (according to all indications) but just
freezes the display that was in the old sketch. I go back to Hello world and its OK.
I do not get any errors when I compile or when I try to down load the sketch.
Any Ideas as to what is going wrong.

I would be glad to forward you the sketch.

No_2_Clock.pdf (113 KB)

Clock Schematic.pdf (4.52 KB)

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

Please post a schematic, too.

seems to work when i run it, simulating the LCD using Serial output. however, i notice you call lcd.begin() in loop() and that should only be done once in setup()

you might consider the following to format a single string that can be displayed

   char t [40];
    sprintf (t, "%2d:%02d:%02d %s", h, m, s, flag ? "PM" : "AM");
    Serial.println (t);