no I'm still wrong, why is time so complicated

try

Code:

Code:
If(PortC.5 = 1) & (PortC.6 = 1) then Pause 1500
  If (PortC.5 = 1) & (PortC.6 = 1) then
   I2CRead SDApin,SCLpin,$D0,$02,[RTCHour]
  if RTCHour.6=1 then
       temp1 = (((RTCHour&$1f)>> 4) * 10) + (RTCHour& $0f)    ' to binary  mask off am/pm
     else
       temp1 = ((RTCHour>> 4) * 10) + (RTCHour& $0f)    ' to binary
     endif
   if RTCHour.6=1  then   ' 12h mode 
        if RTCHour.5=1then  temp1=temp1+12  ' pm
   
   else  
         if temp1 > 12 then
         temp1=temp1-12
   endif

  rtcHOUR = ((temp1 / 10) << 4) + (temp1 // 10)  ' to bcd
  

 RTCHour.6 = ! RTCHour.6  '  set/reset   24h mode

   I2cwrite SDApin,SCLpin,$D0,$02,[RTCHour]     
  endif
 endif