'TRIMBLE GPSDO monitor program 'ver.T2.4 2018.09.28 by JA1VZV. 'Clock = 8MHz 'LED port changed B.0->B.6 'Read cycle changed 1sec > 3sec 'Send command as GPS Mask elv angle 15deg. 'Use compiler 2.0.7.1 or later version 'FREQ DIFF / FREQ FRAC indicate alternately(v.T2.4-) $regfile = "m88def.dat" $crystal = 8000000 $baud = 57600 'GPSDO default $timeout = 1000000 $hwstack = 32 $swstack = 32 $framesize = 40 '--- config port --- Config Portd = &B00000010 '0=Rd,1=Sd Config Portc = &B0111111 '0-5=LCDout Config Portb = Output '6=LED '--- port pullup --- Portd = &B11111101 Portc = &B1000000 Portb = &H00 '--- Config serial port --- Config Serialin = Buffered , Size = 80, Open "Com1:" For Binary As #1 Echo Off '---LCD port assign --- Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 Config Lcdpin = Pin , Db6 = Portc.4 , Db7 = Portc.5 Config Lcdpin = Pin , E = Portc.1 , Rs = Portc.0 'Rd/Wr is GNDed Config Lcd = 16 * 2 '---Define Variables--- Dim Rd1 As String * 80 'Rcvd data 80chr Dim Dd1 As String * 32 'Display data 16chr Dim N As Integer Dim Df As Bit '---LCD inital display --- Cursor Off Cls Upperline Lcd "GPSDO Mon. T2.4" 'Weakup display '---Main program--- Enable Interrupts Print #1 , "GPS:SAT:TRAC:EMAN 15" 'Send Elv mask 15deg ' Do Set Portb.6 'Monitor LED ON '---Get FFOM strings--- Clear Serialin 'Clear Rdx buffer Print #1 , "SYNC:FFOM?" 'Send command Input #1 , Rd1 'Discard echoback Input #1 , Rd1 'Read responce Dd1 = Mid(rd1 , 2 , 16) 'Cutout FFOM strings '---Left justify Dd1 = Dd1 + Space(16) Dd1 = Left(dd1 , 16) '---Convert "Hold over" mode strings N = Instr(dd1 , "(Hold") If N > 0 Then Dd1 = "Unlock:Hold over" End If '---Out for display Upperline Lcd Dd1 '---End get FFOM--- Waitms 100 Reset Portb.6 'Monitor LED OFF '---Get FREQ DIFF--- Clear Serialin 'Clear Rxd buffer Print #1 , "DIAG:LOOP?" 'Send command Input #1 , Rd1 'Discard echoback Input #1 , Rd1 'Discard upper line Input #1 , Rd1 'Discard item titles Input #1 , Rd1 'Read value strings Lowerline If Df = 0 Then Dd1 = Mid(rd1 , 57 , 9) 'Read F-DIFF val Lcd "DF " ; Dd1 ; Df = 1 Else Dd1 = Mid(rd1 , 68 , 9) 'Read F-FRAC val. Lcd "FR " ; Dd1 ; Df = 0 End If '---Out for display Input #1 , Rd1 'discard lower line '---End get FREQ DIFF--- Waitms 100 '---Get track count--- Clear Serialin 'Clear Rdx buffer Print #1 , "GPS:SAT:TRAC:coun?" 'Send command Input #1 , Rd1 'Discard echoback Input #1 , Rd1 'Read tracked count Dd1 = Mid(rd1 , 3 , 2) 'Cutout TC strings '---Right justify Dd1 = Rtrim(dd1) If Len(dd1) = 1 Then Dd1 = Space(1) + Dd1 End If '---Track count display Lcd "(" ; Dd1 ; ")" '---End get track count--- Wait 3 Loop End