From: Ken Horton To: 'John Becker' Subject: Canute Tide Predictor Date: 10 November 2003 08:01 John You possibly recall our correspondence at the beginning of the year (below) on the Canute Tide Predictor and a problem with incorrect tide times. The unit has been brought back from Portugal for me to look at. I have made the following changes: GETHRS: clrf STORE2 GTHRS2: incf STORE2,F ;get hours value (divide by 60) movlw 60 subwf STORE0,F btfsc STATUS,C goto GTHRS2 movlw 1 subwf STORE1,F btfsc STATUS,C goto GTHRS2 decf STORE2,F movlw 60 addwf STORE0,F ; movlw 24 ; xorwf STORE2,W ; btfsc STATUS,Z ; clrf STORE2 ; return movlw 232 ; * Ken kfh addwf STORE2,w ; * Ken kfh BTFSS STATUS,C ; * Ken kfh return ; * Ken kfh movwf STORE2 ; * Ken kfh return ; * Ken kfh GETSIN: movf INDF,W ;BYTE2 ;is angle >= 90? GS1: movwf STORE1 addlw 166 btfss STATUS,C goto GS2 ;no sublw 90 ;yes, now subtract answer from 90 ; movwf STORE1 ;and store new value goto GS1 ; * Ken kfh GS2: return There is no evidence that GETSIN is going wrong, but I thought it was a wise precaution! I have also made the following change to the graph as it was 'sticking' at one end when the duration of the low and high tides were significantly different. CHKHI: movf CLKHRS,W ;are HRS = high tide hours? xorwf NXTHI1,W btfss STATUS,Z goto CHKLO movf CLKMIN,W ;are MINS = high tide mins? xorwf NXTHI0,W btfss STATUS,Z goto CHKLO clrf TIDEUP movlw 0xBC ; * Ken kfh movwf TIDE0 ; * Ken kfh movlw 1 ; * Ken kfh movwf TIDE1 ; * Ken kfh call CLRLN1 ; * Ken kfh goto GF0 CHKLO: movf CLKHRS,W ;are HRS = low tide hours? xorwf NXTLO1,W btfss STATUS,Z goto GF3 ;no movf CLKMIN,W ;yes, are MINS = low tide mins? xorwf NXTLO0,W btfss STATUS,Z goto GF3 ;no bsf TIDEUP,0 ;yes clrf TIDE0 ; * Ken kfh clrf TIDE1 ; * Ken kfh call CLRLN1 ; * Ken kfh movlw 15 call LCDPX1 movlw '>' call LCDOUT movlw 12 ;show time of next high tide call LCDPX2 movf NXTHI1,W movwf NOWHI1 call LCDHEX movf NXTHI0,W movwf NOWHI0 call LCDHEX goto GF3 Regards Ken [...] > > > > > > ----- Original Message ----- > > From: Fay Kenward > > To: John Becker > > Sent: Monday, October 28, 2002 9:34 AM > > Subject: FW: Canute Tide Predictor > > > >[...] > > > > > > > > > Dear Mr Becker > > > > > > When the article for the Canute Tide Predictor was published, I > > > built one, and this is in continual use on an ocean going boat in > > > Portugal. > > > > > > I understand that every so often, the clock goes wrong displaying > > > 25:00 hours before locking-up. Unfortunately, I am unable to give > > > you the precise details of the error as I have not had chance to > > > witness the symptoms first hand. > > > > > > Are you aware of this error, and if so if there a fix for it? > > > > > > > > > Regards > > > > > > Kenneth Horton