The result of a AT+CCLK? is for example: XX+CCLK: "21/08/18,06:39:40" (note - not the correct date/time) Approx every 50sec I call this routine to update the Hour and Minute register. The result of the above string is : 0x04 in the Hour register (should be 6dec or 0x06) 0x07 in the Minute register (should be 30+9=39dec or 0x27) for 06h39 I have attached the suspect code. Where am I going wrong? Francois Registers Hours equ 0x38 Minutes equ 0x39 D1 equ 0x40 D2 equ 0x41 D3 equ 0x42 etc. GSM_TIME_UPDATE Hours_Update movlw 0x30 ;Ascii value of zero subwf D20, w ;register location for Hour-Tens movwf Temp ;Hours Tens movlw .0 ;If Hour tens is zero then load Hour register with zero etc. subwf Temp, w btfsc STATUS, Z #movlf .0, Hours ;(macro for literal to w and then w to f) movlw .1 subwf Temp, w btfsc STATUS, Z #movlf .10, Hours movlw .2 subwf Temp, w btfsc STATUS, Z #movlf .20, Hours movlw 0x30 ;convert ascii subwf D21, w ;register location for Hour-Ones addwf Hours, f ;Add Hour-Ones Minute_Update movlw 0x30 subwf D23, w movwf Temp ;Minutes-Tens movlw .0 subwf Temp, w btfsc STATUS, Z #movlf .0, Minutes movlw .1 subwf Temp, w btfsc STATUS, Z #movlf .10, Minutes movlw .2 subwf Temp, w btfsc STATUS, Z #movlf .20, Minutes movlw .3 subwf Temp, w btfsc STATUS, Z #movlf .30, Minutes movlw .4 subwf Temp, w btfsc STATUS, Z #movlf .40, Minutes movlw .5 subwf Temp, w btfsc STATUS, Z #movlf .50, Minutes movlw 0x30 subwf D24, w ;register location for Minute-Ones addwf Minutes, f ;Add Minute-Ones goto GSM_TIME_7 GSM_TIME_6 ;Time Not Updated bcf TimeFlag return GSM_TIME_7 ;Time Updated bsf TimeFlag return -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist