Special Vehicle Tracker provides un-compromising vehicle security within affordable cost price aimed to give complete peace of mind to our customers.
Some of the fundamental features of Special Vehicle Tracker are as follows:
1. TRACK
a. Satellite Vehicle Tracking.
b. 24/7 Vehicle Monitoring (with in GSM range).
c. Nationwide Tracking.
d. Speed Direction & movement information.
e. Car position information available in theft/snatch case.
2. MONITOR
a. System directly alerts primary user via messages & calls if door opened in secure mode.
b. System directly alerts primary user via messages & calls if vehicle switched on in secure mode.
c. Alerts primary user directly via messages & calls in case of battery tampering.
d. Switch car horron on if car switched on in secure mode.
3. CONTROL
a. Company switch off vehicle in theft/snatch case.
b. User can store primary & secondary customer no information.
c. Authenticated users can switch car in secure/insecure mode.
d. Remote immobilization/ activation.
4. ADDITIONAL FEATURES
a. Get Direct Vehicle Monitoring via your own cell phone.
b. Uncompromising system quality & maximum customer satisfaction.
c. Excellent Car Tracker system along with unique features in Affordable cost.
d. Back-up Battery feature available.
e. 2 Years Product replacement warranty.
f. Round the clock customer service available.
g. Password protected system operations.
h. Police & Ambulance assistance.
FUNCTIONS CONTROL
1. PRIMARY CUSTOMER NO.
The primary customer no. will receive all idrect alert acknowledgements from the vehicle
The alert acknowledgement message with calls includes:
a. Vehicle any door opened in secure mode.
b. Vehicle switched ON in secure mode.
c. Vehicle battery disconnected in secure/insecure mode.
Send Primary Customer Storage no. SMS message as defined in vehicle purchase invoice to your vehicle security system no. via the mobile phone of primary customer.
2. SECONDARY CUSTOMER NO.
The secondary customer no. can secure/insecure vehicle but will not receive any alert acknowledgement messages or call.
Send Secondary Customer Storage no. SMS message as defined in vehicle purchase invoice to your vehicle security system no. via the mobile phone of secondary customer.
3. SECURE MODE OPERATION:
Give Miscall on your vehicle security no. in order to active the secure mode. Vehicle will respond as acknowledgement by blinking all light twice.
In Secure mode system will transmit you alert messages directly on your cell phone in following cases:
a. Any Door is opened
b. Car switched ON
c. Car Battery disconnected
4. INSECURE MODE OPERATION:
For insecure mode transfer again give miscall on your vehicle security no. in order to active the insecure mode. Vehicle will respond as acknowledgement by blinking all light once.
During Insecure mode, system will transmit you alert messages directly on your cell phone in following cases:
a. Car Battery disconnected
Code:
SourceCode Information:
'****************************************************************
'* Name : U MONITOR & CONTROL & V Track *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 6/1/2007 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
device 16f876a
xtal 10
all_digital = true
'General Variable Declaration
'This byte stores the information whether user wants to enter or edit the Cel#
dim ask as byte
'Cel no# Acception & Comparison variables
dim ci0 as byte
dim ci1 as byte
dim ci2 as byte
dim ci3 as byte
dim ci4 as byte
dim ci5 as byte
dim ci6 as byte
dim ci7 as byte
dim ci8 as byte
dim ci9 as byte
'Cel no#1 Acception variable
dim ca0 as byte
dim ca1 as byte
dim ca2 as byte
dim ca3 as byte
dim ca4 as byte
dim ca5 as byte
dim ca6 as byte
dim ca7 as byte
dim ca8 as byte
dim ca9 as byte
'Cel no#2 Acception variable
dim cb0 as byte
dim cb1 as byte
dim cb2 as byte
dim cb3 as byte
dim cb4 as byte
dim cb5 as byte
dim cb6 as byte
dim cb7 as byte
dim cb8 as byte
dim cb9 as byte
'Cel no#3 Info from Server
dim cc0 as byte
dim cc1 as byte
dim cc2 as byte
dim cc3 as byte
dim cc4 as byte
dim cc5 as byte
dim cc6 as byte
dim cc7 as byte
dim cc8 as byte
dim cc9 as byte
'Cel no#3 Info to Server
dim cd0 as byte
dim cd1 as byte
dim cd2 as byte
dim cd3 as byte
dim cd4 as byte
dim cd5 as byte
dim cd6 as byte
dim cd7 as byte
dim cd8 as byte
dim cd9 as byte
'The byte stores the variable that decides which SMS to send
Dim smsn as byte
'SMS Receiving Variables
Dim smsi1 as byte
Dim smsi2 as byte
Dim smsid as byte
Dim portb7 as bit
Dim portb6 as bit
Dim portb5 as bit
'The variable defines the length of the SMS
Dim SMSL as byte
'This variable is used to store the secure or unsecure stage
Dim secure as bit
'GPS Variables Declaration
'Variable used to locate whether Valid or Not
dim num as byte
'Variable to accept the Position Information
dim n0 as byte
dim n1 as byte
dim n2 as byte
dim n3 as byte
dim n4 as byte
dim n5 as byte
dim n6 as byte
dim n7 as byte
dim n8 as byte
dim n9 as byte
dim n10 as byte
dim n11 as byte
dim n12 as byte
dim n13 as byte
dim n14 as byte
dim n15 as byte
dim n16 as byte
dim n17 as byte
dim n18 as byte
dim n19 as byte
dim n20 as byte
'Variable to accept Time Information
dim n21 as byte
dim n22 as byte
dim n23 as byte
Dim n24 as byte
dim n25 as byte
dim n26 as byte
'Variable to accept Speed Information
dim n27 as byte
dim n28 as byte
dim n29 as byte
dim n30 as byte
dim n31 as byte
'The variable is used to store the Supervisor Control Status
'Dim SLU as bit
'The variable is used to both send Message to Supervisor & User if car Locked/Unlocked
Dim msgn as byte
'The variable is used to limit Battery Tampering msg
Dim counta as byte
'The Variables will limit the Optocouplers Message
Dim countb as byte
dim countc as byte
'The variable is used to check Cell Phone operation
Dim check as word
'The variable is used to delete SMS
Dim smsd as byte
'MCU Stabilization & Operation verification
gosub nled
'Supervisor Control Lock
dim SLu as byte
'Geo-Fencing variables
dim glat1 as word
dim glog1 as word
Dim GfL as bit
'Wait from User for Cel# Entry
serout portC.6,16468,["Activate Cell(Y/N)?",13,10]
Serin portb.1,16468,10000,mread,[ask]
if ask = "Y" then
goto takeinput1
else goto mread
endif
TakeInput1:
'Taking Cel Info from Server
ewrite 0,[3]
ewrite 1,[0]
ewrite 2,[0]
ewrite 3,[3]
ewrite 4,[6]
ewrite 5,[4]
ewrite 6,[8]
ewrite 7,[4]
ewrite 8,[4]
ewrite 9,[1]
'Taking Cel Info to Server
ewrite 69,[3]
ewrite 70,[0]
ewrite 71,[0]
ewrite 72,[3]
ewrite 73,[6]
ewrite 74,[4]
ewrite 75,[8]
ewrite 76,[4]
ewrite 77,[4]
ewrite 78,[1]
'Moving Relay state to Normal state
ewrite 30,[0]
ewrite 31,[0]
ewrite 32,[0]
'Write 0 to the Cel#1 first value in order to properly send msg when battery is low
ewrite 10,[0]
'The bit stores the secure/unsecure state in the memory to be recalled
ewrite 33,[0]
'Writing SLU=0 so that operation starts normal i.e. Not in the control of Supervisor
ewrite 66,[0]
'Writing Geo-Fence On variable
ewrite 79,[1]
'Writing 0 to initial values of SMS counters of Optocouplers
counta=0
countb=0
countc=0
mread:
'Reading Cel# PIC Info to Server (Started from 69 because last variable is a word in Memory)
cd0 = eread 69
cd1 = eread 70
cd2 = eread 71
cd3 = eread 72
cd4 = eread 73
cd5 = eread 74
cd6 = eread 75
cd7 = eread 76
cd8 = eread 77
cd9 = eread 78
'Reading Cel# Info from Server to PIC
cc0 = eread 0
cc1 = eread 1
cc2 = eread 2
cc3 = eread 3
cc4 = eread 4
cc5 = eread 5
cc6 = eread 6
cc7 = eread 7
cc8 = eread 8
cc9 = eread 9
'Reading Cel#1 from memory
ca1 = eread 11
ca2 = eread 12
ca3 = eread 13
ca4 = eread 14
ca5 = eread 15
ca6 = eread 16
ca7 = eread 17
ca8 = eread 18
ca9 = eread 19
'Reading Cel#1 1st value from memory inorder to send Batterylow message properly
ca0= eread 10
'Reading secure status from memory
secure = eread 33
if secure = 1 then high portb.0
'Reading Geo-Fence Variable
gfl= eread 79
'Recall all the relay states from memory (System recall its last state if is switched Off & then ON)
RelayStates:
portb5 = EREAD 30
if portb5 = 1 then high portb.5
portb6 = EREAD 31
if portb6 = 1 then high portb.6
portb7 = eread 32
if portb7 = 1 then high portb.7
'Reads the Supervisor control i.e. Car ON/OFF status
slu = eread 66
'Reading data from Check variable
check = eread 67
'Switch ON Cell-Phone & Also Indicates that all Defined Settings are written in memory properly
high portb.4
delayms 3000
low portb.4
delayms 30000
'Overall System Check
CheckCel:
'Restarts the Counter to Check the System i.e Mobile System & Sends GPS Information
if check = 1650 then check = 0
'Communication b/w Cel & MCU OK
serout PORTC.3,16468,["AT",13,10]
serin PORTC.1,16468,5000,ELED,[wait("OK")]
gosub NLED
'Cell Ringer Mute
RingerLow:
serout PORTC.3,16468,["AT+CALM=1",13,10]
serin PORTC.1,16468,5000,ELED,[wait("OK")]
gosub NLED
'Cell CLI ON
onCLIP:
serout PORTC.3,16468,["AT+CLIP=1",13,10]
serin PORTC.1,16468,5000,ELED,[wait("OK")]
gosub NLED
'Delete Messages from SIM memory
gosub SMSDel
'If message is not send,then after ELED read the original data from memory
gosub gpsir
'Sends GPS Information to Server
smsn=8
ca0=3
gosub sendmsg
'Investigates all the conditions
main:
'Investigates for a call to Secure/Insecure the Car System
gosub calcheck
'Accepts the SMS if received
gosub SMSCheck
'Reads the Optocouplers
gosub scheck
'Read the Valid Values from the GPS Receiver
gosub GPSI
' serout portC.6,16468,[dec gfl,13,10]
check = check+1
ewrite 67, [check]
if check = 1650 then goto checkcel
goto main
CalCheck:
'Wait for the Cel#
serin PORTC.1,16468,10000,CalCheckEnd,[wait("CLIP: 0"),dec1 ci0,dec1 ci1,dec1 ci2,dec1 ci3,dec1 ci4,dec1 ci5,dec1 ci6,dec1 ci7,dec1 ci8,dec1 ci9]
if ci0 = ca0 then
if ci1 = ca1 then
if ci2 = ca2 then
if ci3 = ca3 then
if ci4 = ca4 then
if ci5 = ca5 then
if ci6 = ca6 then
if ci7 = ca7 then
if ci8 = ca8 then
if ci9 = ca9 then
' serout portc.6,16468,["USER#1 OK",13,10]
toggle PORTb.0
ewrite 33, [PORTb.0]
secure = eread 33
if secure = 1 then
gosub secure1
else
gosub isecure1
endif
cel1:
serin PORTC.1,16468,18000,CalCheckEnd,[wait("CLIP: ")]
goto cel1
endif
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
endif
'Checks Cell#2 for User Authentication
if ci0 = cB0 then
if ci1 = cB1 then
if ci2 = cB2 then
if ci3 = cB3 then
if ci4 = cB4 then
if ci5 = cB5 then
if ci6 = cB6 then
if ci7 = cB7 then
if ci8 = cB8 then
if ci9 = cB9 then
' serout portc.6,16468,["USER#2 OK",13,10]
toggle PORTb.0
ewrite 33, [PORTb.0]
secure = eread 33
if secure = 1 then
gosub secure1
else
gosub isecure1
endif
cel2:
serin PORTC.1,16468,18000,CalCheckEnd,[wait("CLIP: ")]
goto cel2
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
endif
endif
CalcheckEnd:
return
SMSCheck:
serout PORTC.3,16468,["AT+CMGL=0",13,10]
serin PORTC.1,16468,2000,SMSCheckEnd,[wait("GL: "),dec1 smsi1,smsi2] ' Takes the msg index no for delete function
'Label CPass to skip the SMS Transmission in case of wrong password by smsid> then condition
serin PORTC.1,16468,6000,CPass,[wait("C9129"),dec1 ci1,dec1 ci0, dec1 ci3, dec1 ci2,dec1 ci5,dec1 ci4, dec1 ci7, dec1 ci6,dec1 ci9, dec1 ci8,wait("B310883C1623"),dec1 smsid] ' Takes the smsid to active particular output
gosub NLED
'Deletes the message
DelSMS:
if smsi2 = "," then
serout PORTC.3,16468,["AT+CMGD=",DEC smsi1,13,10]
else
serout PORTC.3,16468,["AT+CMGD=",DEC smsi1,smsi2,13,10]
endif
delayms 2000
if smsid= 3 then
'Writing Cel#1 to the memory
ewrite 10,[ci0]
ewrite 11,[ci1]
ewrite 12,[ci2]
ewrite 13,[ci3]
ewrite 14,[ci4]
ewrite 15,[ci5]
ewrite 16,[ci6]
ewrite 17,[ci7]
ewrite 18,[ci8]
ewrite 19,[ci9]
gosub NLED
ca0 = eread 10
ca1 = eread 11
ca2 = eread 12
ca3 = eread 13
ca4 = eread 14
ca5 = eread 15
ca6 = eread 16
ca7 = eread 17
ca8 = eread 18
ca9 = eread 19
gosub NLED
'serout portc.6,16468,["Cell#1: ", dec ca0,DEC ca1,DEC ca2,DEC ca3,DEC ca4,DEC ca5,DEC ca6,DEC ca7,DEC ca8,DEC ca9,13,10]
smsn=6
gosub sendmsg
elseif smsid=4 then
'Writing Cel#2 to the memory
ewrite 20,[ci0]
ewrite 21,[ci1]
ewrite 22,[ci2]
ewrite 23,[ci3]
ewrite 24,[ci4]
ewrite 25,[ci5]
ewrite 26,[ci6]
ewrite 27,[ci7]
ewrite 28,[ci8]
ewrite 29,[ci9]
gOSUB NLED
cb0 = eread 20
cb1 = eread 21
cb2 = eread 22
cb3 = eread 23
cb4 = eread 24
cb5 = eread 25
cb6 = eread 26
cb7 = eread 27
cb8 = eread 28
cb9 = eread 29
'If Secondary no os entered first then pass it from Send Msg condition ca0=3 & make it off in msg5 label
ca0=3
'serout portc.6,16468,["Cell#2: ", DEC cb0,DEC cb1,DEC cb2,DEC cb3,DEC cb4,DEC cb5,DEC cb6,DEC cb7,DEC cb8,DEC cb9,13,10]
smsn=7
gosub sendmsg
'Transmits GPS Information
elseif smsid= 5 then
smsn=8
ca0=3
gosub sendmsg
'Supervisor makes Car Off Routine
elseif smsid=6 then
gosub SNCheck
'Supervisor makes Car ON Routine
elseif smsid=7 then
gosub SNCheck
'Geo-Fence Off function
elseif smsid=8 then
gosub SNCheck
'Geo Fence On function
elseif smsid=9 then
gosub SNCheck
endif
SMSCheckEnd:
return
'Verifies whether message is received from Supervisor & then Process it
SNCheck:
if ci0 = cC0 then
if ci1 = cC1 then
if ci2 = cC2 then
if ci3 = cC3 then
if ci4 = cC4 then
if ci5 = cC5 then
if ci6 = cC6 then
if ci7 = cC7 then
if ci8 = cC8 then
if ci9 = cC9 then
'In order to pass through the msg check
CA0=3
smsn=9
if smsid = 6 then
'Supervisor control Lock ON
ewrite 66,[1]
slu = eread 66
'Car Off Routine
high portb.7
ewrite 32,[portb.7]
msgN=1
goto sendmsg
elseif smsid=7 then
'Supervisor control Lock Off
ewrite 66,[0]
slu = eread 66
'Car ON Routine
low portb.7
ewrite 32,[portb.7]
msgn=2
goto sendmsg
elseif smsid=8 then
'Car Engine Off routine
low portb.7
ewrite 32,[portb.7]
'Geo-Fence OFF
gfl=0
ewrite 79,[gfl]
msgn=3
goto sendmsg
elseif smsid=9 then
'Geo-Fence ON routine
gfl=1
ewrite 79,[gfl]
msgn=4
goto sendmsg
endif
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
eNDIF
endif
endif
return
SCheck:
'Checks the Status of Battery
if porta.0=0 then
smsn=3
'To limit the Battery Tampering Alert Msg to 2
if countC<=2 then gosub sendmsg
else
countc=1
endif
'Checks the Secure/InSecure State to sense the inputs
secure = eread 33
if secure = 0 then goto SInputEnd
'Sense the Door switch Input
if porta.2=0 then
smsn=1
'Counter to limit the msgs to 2
if counta<=2 then gosub sendmsg
else
counta=1
endif
'Sense the Ignition Input
if porta.4=1 then
smsn=2
'Counter to limit the msgs to 2
if countb<=2 then gosub sendmsg
else
countb=1
endif
goto SInputEnd
'Message Sent Algorithum
SendMsg:
if ca0 = 3 then
serout PORTC.3,16468,[27,27,27,"AT",13,10]
serin PORTC.1,16468,4000,eled,[wait("OK")]
gosub NLED
serout PORTC.3,16468,["AT",13,10]
serin PORTC.1,16468,4000,eled,[wait("OK")]
gosub NLED
if smsn=1 then
smsl= 22
gosub SMSLT
goto msg1
elseif smsn=2 then
smsl=22
gosub SMSLT
goto msg2
elseif smsn=3 then
smsl=24
gosub SMSLT
goto msg3
elseif smsn=6 then
smsl = 25
gosub SMSLT
goto msg6
elseif smsn=7 then
smsl=26
gosub SMSLT
goto msg7
elseif smsn=8 then
smsl= 41
gosub SMSLT
goto msg8
elseif smsn=9 then
smsl= 16
gosub SMSLT
goto msg9
SMSLT:
'General Algo that accepts & defines the length of SMS
serout PORTC.3,16468,["AT+CMGS=",dec smsl,13,10]
delayms 2500
Return
Endif
msg1:
serout PORTC.3,16468,["0001000C9129",DEC cA1,DEC cA0, DEC cA3, DEC cA2,DEC cA5,DEC cA4, DEC cA7, DEC cA6,DEC cA9, DEC cA8,"00000AC4E7530A7A428BCE10",26]
counta=counta+1
goto m123e
msg2:
serout PORTC.3,16468,["0001000C9129",DEC cA1,DEC cA0, DEC cA3, DEC cA2,DEC cA5,DEC cA4, DEC cA7, DEC cA6,DEC cA9, DEC cA8,"00000A45E731E92C829ECE10",26]
countb=countb+1
goto m123e
msg3:
serout PORTC.3,16468,["0001000C9129",DEC cA1,DEC cA0, DEC cA3, DEC cA2,DEC cA5,DEC cA4, DEC cA7, DEC cA6,DEC cA9, DEC cA8,"00000CC220955A9466414FA33104",26]
countc=countc+1
goto m123e
'Combines the above three equal codes for optimization
M123E:
serin PORTC.1,16468,20000,ELED,[wait("OK")]
delayms 6000
gosub callp
goto sinputend
msg6:
serout PORTC.3,16468,["0001000C9129",DEC cA1,DEC cA0, DEC cA3, DEC cA2,DEC cA5,DEC cA4, DEC cA7, DEC cA6,DEC cA9, DEC cA8,"00000EC32293398A81A6D4A7B4480C01",26]
goto msgr
msg7:
'If Secondary No. enters first then it has to play an important role
ca0=eread 10
serout PORTC.3,16468,["0001000C9129",DEC cb1,DEC cb0, DEC cb3, DEC cb2,DEC cb5,DEC cb4, DEC cb7, DEC cb6,DEC cb9, DEC cb8,"00000EC32293399281A6D4A7B4480C01",26]
goto msgr
'GPS Information i.e. POS+Time+Speed
msg8:
'If Primary no. is not stored then still sends the GPS Information
ca0 = eread 10
gosub GPSPDU
serout PORTC.3,16468,["0001000C9129",dec cd1,dec cd0,dec cd3,dec cd2,dec cd5,dec cd4,dec cd7,dec cd6,dec cd9,dec cd8]
serout portc.3,16468,["000020",hex2 n0,hex2 n1,hex2 n2,hex2 n3,hex2 n4,hex2 n5,hex2 n6,hex2 n8,hex2 n9,hex2 n10,hex2 n11,hex2 n12,hex2 n13,hex2 n14,hex2 n16,hex2 n17,hex2 n18,hex2 n19,hex2 n20,hex2 n21,hex2 n22]
serout portc.3,16468,[HEX2 n24,hex2 n25,hex2 n26,hex2 n27,hex2 n28,hex2 n29,hex2 n30,26]
goto msgr
msg9:
ca0=eread 10
'CLC
if msGn=1 then
serout PORTC.3,16468,["0001000C9129",DEC cd1,DEC cd0, DEC cd3, DEC cd2,DEC cd5,DEC cd4, DEC cd7, DEC cd6,DEC cd9, DEC cd8,"00000343E610",26]
'CUC
elseif msgn=2 then
serout PORTC.3,16468,["0001000C9129",DEC cD1,DEC cD0, DEC cd3, DEC cd2,DEC cd5,DEC cD4, DEC cd7, DEC cd6,DEC cd9, DEC cd8,"000003C3EA10",26]
elseif msgn=3 then
serout PORTC.3,16468,["0001000C9129",DEC cd1,DEC cd0, DEC cd3, DEC cd2,DEC cd5,DEC cd4, DEC cd7, DEC cD6,DEC cd9, DEC cd8,"00000347260C",26]
elseif msgn=4 then
serout PORTC.3,16468,["0001000C9129",DEC cd1,DEC cd0, DEC cd3, DEC cd2,DEC cd5,DEC cd4, DEC cd7, DEC cD6,DEC cd9, DEC cd8,"00000347660C",26]
endif
goto msgr
MsgR:
serin PORTC.1,16468,20000,ELED,[wait("OK")]
gosub NLED
goto sinputend
'If ca0 is not equal then endif here
endif
SInputEnd:
return
GPSI:
serin portc.4,16780,3000,GPSIEnd,[Wait("$GPRMC,"),n21,n22,n23,n24,wait(","),num,wait(","),n0,n1,n2,n3,wait("."),n4,n5,n6,n7,wait(","),n8,wait(","),n9,n10,n11,n12,n13,wait("."),n14,n15,n16,n17,wait(","),n18]
'serin portc.0,16780,[Wait("$GPRMC,"),n21,n22,n23,n24,wait(","),num,wait(","),n0,n1,n2,n3,wait("."),n4,n5,n6,n7,wait(","),n8,wait(","),n9,n10,n11,n12,n13,wait("."),n14,n15,n16,n17,wait(","),n18]
if num = "A" then
serout portc.6,16780,["GR1"]
SRPos:
ewrite 34,[n0]
ewrite 35,[n1]
ewrite 36,[n2]
ewrite 37,[n3]
ewrite 38,[n4]
ewrite 39,[n5]
ewrite 40,[n6]
ewrite 41,[n7]
ewrite 42,[n8]
ewrite 43,[n9]
ewrite 44,[n10]
ewrite 45,[n11]
ewrite 46,[n12]
ewrite 47,[n13]
ewrite 48,[n14]
ewrite 49,[n15]
ewrite 50,[n16]
ewrite 51,[n17]
ewrite 52,[n18]
ewrite 53,[n19]
ewrite 54,[n20]
ewrite 55,[n21]
ewrite 56,[n22]
ewrite 57,[n23]
ewrite 58,[n24]
ewrite 59,[n25]
ewrite 60,[n26]
'serout portc.6,16780,[n0,n1,n2,n3,n4,n5,n6,n7,n8,13,10,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,13,10,n19,n20,n21,n22,n23,n24,n25,n26,13,10]
'delayms 1000
'gosub nled
serin portc.4,16780,3000,GPSIEnd,[Wait("$GPVTG,"),wait(","),wait(","),wait(","),wait(","),wait(","),wait(","),n28,n29,n30,wait(","),n31]
'serin portc.0,16780,[Wait("$GPVTG,"),wait(","),wait(","),wait(","),wait(","),wait(","),wait(","),n28,n29,n30,wait(","),n31]
serout portc.6,16780,["GV1"]
n27 = "S"
ewrite 61,[n27]
ewrite 62,[n28]
ewrite 63,[n29]
ewrite 64,[n30]
ewrite 65,[n31]
if slu=0 then
if gfl=1 then
serin portc.4,16780,3000,GPSIEnd,[Wait("$GPRMC,"),wait(","),wait(","),dec4 glat1,wait(","),wait(","),dec5 glog1]
'serin portc.0,16780,[Wait("$GPRMC,"),wait(","),wait(","),dec4 glat1,wait(","),wait(","),dec5 glog1]
GF:
if glat1>=2444 then
if glat1<=2502 then
if glog1>=6656 then
if glog1<=6722 then
'Checks Highway Geo-Fence
HLock:
if glat1>= 2459 then
if glat1<= 2502 then
if glog1>= 6710 then
if glog1<= 6712 then
serout portc.6,16780,["H1"]
gosub caroff
goto gpsiend
endif
endif
endif
endif
gosub caron
serout portc.6,16780,["K1"]
goto gpsiend
endif
endif
endif
endif
gosub caroff
serout portc.6,16780,["K0"]
goto gpsiend
'Geo-Fence Lock/Unlock
endif
'Supervisor Lock check=0
endif
'GPS Frame Valid/Invalid frame
endif
GPSIEnd:
return
'Reads the Stored Latitude & Longitude Position
GPSIR:
n0= eread 34
n1= eread 35
n2= eread 36
n3= eread 37
n4= eread 38
n5= eread 39
n6= eread 40
n7= eread 41
n8= eread 42
n9= eread 43
n10= eread 44
n11= eread 45
n12= eread 46
n13= eread 47
n14= eread 48
n15= eread 49
n16= eread 50
n17= eread 51
n18= eread 52
n19= eread 53
n20= eread 54
n21= eread 55
n22= eread 56
n23= eread 57
n24= eread 58
n25= eread 59
n26= eread 60
n27= eread 61
n28= eread 62
n29= eread 63
n30= eread 64
n31= eread 65
Return
'Text into PDU Conversion
GPSPDU:
'Reads Original values from EEPROM
gosub GPSIR
'Converting first 8 Characters
n0.7=n1.0
n1= n1>>1
n1.7=n2.1
n1.6=n2.0
n2= n2>>2
n2.7=n3.2
n2.6=n3.1
n2.5=n3.0
n3= n3>>3
n3.7=n4.3
n3.6=n4.2
n3.5=n4.1
n3.4=n4.0
n4 = n4>>4
n4.7=n5.4
n4.6=n5.3
n4.5=n5.2
n4.4=n5.1
n4.3=n5.0
n5= n5>>5
n5.7=n6.5
n5.6=n6.4
n5.5=n6.3
n5.4=n6.2
n5.3=n6.1
n5.2=n6.0
n6= n6>>6
n6.7=n7.6
n6.6=n7.5
n6.5=n7.4
n6.4=n7.3
n6.3=n7.2
n6.2=n7.1
n6.1=n7.0
n7 = n7>>7
'Converting second 8 Characters
n8.7 = n9.0
n9 = n9>>1
n9.7=n10.1
n9.6=n10.0
n10=n10>>2
n10.7=n11.2
n10.6=n11.1
n10.5=n11.0
n11=n11>>3
n11.7=n12.3
n11.6=n12.2
n11.5=n12.1
n11.4=n12.0
n12=n12>>4
n12.7=n13.4
n12.6=n13.3
n12.5=n13.2
n12.4=n13.1
n12.3=n13.0
n13=n13>>5
n13.7=n14.5
n13.6=n14.4
n13.5=n14.3
n13.4=n14.2
n13.3=n14.1
n13.2=n14.0
n14=n14>>6
n14.7=n15.6
n14.6=n15.5
n14.5=n15.4
n14.4=n15.3
n14.3=n15.2
n14.2=n15.1
n14.1=n15.0
n15=n15>>7
'Converting third eight Characters
n16.7=n17.0
n17=n17>>1
n17.7=n18.1
n17.6=n18.0
n18=n18>>2
n18.7=n19.2
n18.6=n19.1
n18.5=n19.0
n19=n19>>3
n19.7=n20.3
n19.6=n20.2
n19.5=n20.1
n19.4=n20.0
n20=n20>>4
n20.7=n21.4
n20.6=n21.3
n20.5=n21.2
n20.4=n21.1
n20.3=n21.0
n21=n21>>5
n21.7=n22.5
n21.6=n22.4
n21.5=n22.3
n21.4=n22.2
n21.3=n22.1
n21.2=n22.0
n22=n22>>6
n22.7=n23.6
n22.6=n23.5
n22.5=n23.4
n22.4=n23.3
n22.3=n23.2
n22.2=n23.1
n22.1=n23.0
n23=n23>>7
'Converting fourth 8 Characters
n24.7=n25.0
n25= n25>>1
n25.7=n26.1
n25.6=n26.0
n26= n26>>2
n26.7=n27.2
n26.6=n27.1
n26.5=n27.0
n27= n27>>3
n27.7=n28.3
n27.6=n28.2
n27.5=n28.1
n27.4=n28.0
n28 = n28>>4
n28.7=n29.4
n28.6=n29.3
n28.5=n29.2
n28.4=n29.1
n28.3=n29.0
n29= n29>>5
n29.7=n30.5
n29.6=n30.4
n29.5=n30.3
n29.4=n30.2
n29.3=n30.1
n29.2=n30.0
n30= n30>>6
n30.7=n31.6
n30.6=n31.5
n30.5=n31.4
n30.4=n31.3
n30.3=n31.2
n30.2=n31.1
n30.1=n31.0
n31 = n31>>7
return
'Car On Routine
CarON:
low portb.7
ewrite 32,[portb.7]
return
'Car Off Routine
CarOff:
high portb.7
ewrite 32,[portb.7]
return
'Produces Secure Light/Alarm
secure1:
high portb.6
delayms 500
low portb.6
delayms 500
high portb.6
delayms 500
low portb.6
return
'Produces Insecure Light/Alarm
isecure1:
high portb.6
delayms 500
low portb.6
return
'Normal Operation Indication
NLED:
High Portc.5
delayms 2000
low portc.5
delayms 2000
return
'Error in Operation Indication
ELED:
high portc.7
delayms 2000
low portc.7
delayms 2000
goto checkcel
'Label CPass to skip the SMS Transmission in case of wrong password by smsid> then condition
CPass:
smsid=8
goto delsms
'Call the Primary User
CallP:
serout PORTC.3,16468,["ATD0",dec ca0,DEC ca1,DEC ca2,DEC ca3,DEC ca4,DEC ca5,DEC ca6,DEC ca7,DEC ca8,DEC ca9,";",13,10]
serin PORTC.1,16468,2000,ELED,[wait("OK")]
return
'Deletes SMS from SIM card
SMSDel:
For smsd= 1 to 10 step 1
serout PORTC.3,16468,["AT+CMGD=",dec2 smsd,"",13,10]
delayms 100
next
return


Menu

Re: PIC16F1783: Erase algorithm incorrect
I am not sure this went into a reply. I logged in when I sent it, but the forum said I was not logged in.
SuddyCamp - 14th November 2025, 23:07Try again.
Thanks for the info. I sent an email to ME Labs and they responded I needed an...