to get minutes from midnight.

whats this about ????? (timeH=(timeH &$03)*10)

would it not be :-
timeH=(RTCHour>>4) 'convert the BCD format
timeH=timeH *10
timeH=timeH+(RTCHour&$0F) ' to binary hours


timeM=(RTCMin>>4) ' bcd minutes to binary minutes

timeM=timeM *10
timeM=timeM+(RTCMin&$0F)



minutes_from_midnite =(timeh*60)+timem


i'm sure its a typo but
Counter 1 var byte
counter 2 var byte
counter 3 var byte

looks a bit dodgy to have a space in a var name