$GPGGA,010142.000,,,,,0,0,,,M,,M,,*4E
$GPGLL,,,,,010142.000,V,N*7C
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$GPGSV,1,1,02,16,,,41,23,,,41*7D
$GPRMC,010142.000,V,,,,,,,101010,,,N*4A
$GPVTG,,T,,M,,N,,K,N*2C
Hi Rod_O ,
I just read your post and think that maybe this schematic may give you an opinion
https://www.electrodragon.com/wp-content/uploads/2011/12/SIM908-EVB-Schematics.pdf
Can anyone please tell me how to give power to an Active antenna in SIM908 ? in i provide 3.6V to GPS VANT IN then does that power go to GPS Antenna connected to UFL connector by default?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #include <16f887.h> #device adc=8 #include <string.h> #fuses NOWDT,XT,NOPROTECT,NOCPD,MCLR,NOLVP,NOCPD,NOBROWNOUT,NODEBUG,NOWRT #use delay(clock=4000000) #use rs232(baud=9600,parity=N,xmit=pin_c6,rcv=pin_c7,bits=8) #use fast_io (c) #use fast_io (b) #use fast_io (e) #define pwr pin_d5 #define rs pin_d6 #define e pin_d7 #define rev pin_e0 #define sen pin_e1 #define lcd output_b #define buffer_size 95 void Setup_lcd(); void data_write(unsigned char data); void command_write(unsigned char cmd); void Welcom(); void Sim908(); void erase_buffer(); void erase_local(); int1 wait_ok (void); void read_local(); void gps_lcd(); char buffer[buffer_size]; char string[20],longitude[12],latitude[11],sms_kv[24]; char kitu=0x00; int xbuff=0; //============================================================================// #INT_RDA RDA_isr() { output_high(rev); buffer[xbuff]=getc(); output_low(rev); xbuff++; if(xbuff>=buffer_size) {disable_interrupts(INT_RDA);xbuff=0;} return 0; } //============================================================================// void Setup_lcd() { output_low(e); output_low(rs); command_write(0x38); command_write(0x0c); command_write(0x01); command_write(0x06); delay_ms(2); } //============================================================================// void data_write(unsigned char data) { lcd(data); output_high(rs); output_high(e); delay_ms(2); output_low(e); delay_ms(2); } //============================================================================// void command_write(unsigned char cmd) { lcd(cmd); output_low(rs); output_high(e); delay_ms(2); output_low(e); delay_ms(2); } //============================================================================// void show(unsigned char row,unsigned char colum,char s) { switch(row) { case 1: command_write(0x80+colum); break; case 2: command_write(0xc0+colum); break; case 3: command_write(0x94+colum); break; case 4: command_write(0xd4+colum); break; } while(*s) { data_write(*s); s++; } } //============================================================================// void Welcom() { output_high(rev); output_high(sen); strcpy(string,"MY UNIVERSITY"); show(1,0,string); strcpy(string,"KHOA DIEN-DIEN TU"); show(3,2,string); output_low(rev); output_low(sen); delay_ms(2000); output_high(rev); output_high(sen); command_write(0x01); delay_ms(2); strcpy(string,"PROJECT"); show(1,2,string); strcpy(string,"SIM908"); show(3,1,string); output_low(rev); output_low(sen); delay_ms(2000); output_high(rev); output_high(sen); command_write(0x01); delay_ms(2); strcpy(string,"GUIDER"); show(1,0,string); strcpy(string,"MR.:"); show(2,8,string); strcpy(string,"CONAN"); show(4,3,string); output_low(rev); output_low(sen); delay_ms(2000); output_high(rev); output_high(sen); command_write(0x01); delay_ms(2); strcpy(string,"AUTHOR"); show(1,1,string); strcpy(string,"KAITOOKID"); show(3,0,string); output_low(rev); output_low(sen); delay_ms(2000); output_high(rev); output_high(sen); command_write(0x01); delay_ms(2); strcpy(string,"PRỌECT"); show(1,2,string); } //============================================================================// void Sim908() { output_low(rev); output_low(sen); strcpy(string,"WELCOM TO GPS SIM908"); show(2,0,string); delay_ms(3000); strcpy(string," "); show(3,0,string); strcpy(string,"CONFIG FORMATING..."); show(3,0,string); erase_buffer(); do { output_high(sen); printf("AT"); putc(13); output_low(sen); delay_ms(1000); }while(wait_ok()==0); output_high(sen); printf("ATE0"); putc(13); //Turn off Echo output_low(sen); delay_ms(1000); output_high(sen); printf("AT+CMGF=1"); putc(13); //Fomat Data output_low(sen); delay_ms(1000); erase_buffer(); output_high(sen); printf("AT+CGPSPWR=1"); putc(13); //Power on GPS output_low(sen); delay_ms(1000); erase_buffer(); output_high(sen); printf("AT+CGPSIPR=9600"); putc(13); //Set baudrate output_low(sen); delay_ms(1000); erase_buffer(); output_high(sen); printf("AT+CGPSRST=1"); putc(13); //Select mode AutoReset output_low(sen); delay_ms(1000); erase_buffer(); strcpy(string," "); show(3,0,string); strcpy(string,"SAVE CONFIGULATION"); show(3,1,string); output_high(sen); printf("AT&W"); putc(13); //Save Config output_low(sen);; delay_ms(1000); erase_buffer(); output_high(sen); printf("AT+CMGS=\"0975073549\""); putc(13); output_low(sen); delay_ms(1000); output_high(sen); printf("Sim908 ready"); putc(26); output_low(sen); delay_ms(7000); erase_buffer(); strcpy(string," "); show(2,0,string); strcpy(string," "); show(3,0,string); strcpy(string," "); show(4,0,string); strcpy(string,"LOADING..."); show(2,0,string); delay_ms(2000); strcpy(string," "); show(2,0,string); strcpy(string,"W:"); show(3,0,string); strcpy(string,"N:"); show(4,0,string); } //============================================================================// void erase_buffer() { int t; for(t=0;t<=buffer_size;t++){buffer[t]='\0';} xbuff =0; } //============================================================================// int1 wait_ok (void) { char *ptr; char r1_ok[]="OK"; ptr=strstr(buffer,r1_ok); if(strncmp(ptr,r1_ok,2)==0) { delay_ms(500); return 1; } else { return 0; } erase_buffer(); } //============================================================================// void erase_local() { int l; for(l=0;l<12;l++) {longitude[l] ='\0';} for(l=0;l<11;l++) {latitude[l] ='\0';} for(l=0;l<24;l++) {sms_kv[l] ='\0';} } //============================================================================// void read_local() { int i=0,j=0,k; output_high(rev); while(buffer[i]!=',') {i++;} i++; while(buffer[i]!=',') {i++;} i++; kitu=buffer[i]; //Check data is true??? i+=2; while(buffer[i]!=',') { latitude[j]=buffer[i]; i++;j++; } i+=3; j=0; while(buffer[i]!=',') { longitude[j] =buffer[i]; //sms_kv[k] =buffer[i]; i++;j++;//k++; } k=0; for(j=0;j<12;j++) { if(longitude[j]=='\0') {break;} sms_kv[k]=longitude[j]; k++; } sms_kv[k]=','; k++; for(j=0;j<11;j++) { if(latitude[j]=='\0') {break;} sms_kv[k]=latitude[j]; k++; } erase_buffer(); output_low(rev); } //============================================================================// void gps_lcd() { int cd; //Show Longtitude command_write(0x99); for(cd=0;cd<12;cd++) { if(longitude[cd]=='\0') {break;} data_write(longitude[cd]); } //Show latitude command_write(0xd9); for(cd=0;cd<11;cd++) { if(latitude[cd]=='\0') {break;} data_write(latitude[cd]); } strcpy(string," "); show(2,0,string); delay_ms(2000); } //============================================================================// //// MAIN PROGRAMING //// //============================================================================// void main() { int n; enable_interrupts(GLOBAL); enable_interrupts(INT_RDA); set_tris_b(0x00); set_tris_c(0x80); set_tris_d(0x00); set_tris_e(0x00); output_high(rev); output_high(sen); output_high(pwr); delay_ms(850); output_low(pwr); Setup_lcd(); output_low(rev); output_low(sen); Welcom(); Sim908(); while(1) { erase_buffer(); erase_local(); kitu =0x00; enable_interrupts(INT_RDA); delay_ms(1000); output_high(sen); printf("AT+CGPSINF=32"); putc(13); //Send comman read local output_low(sen); delay_ms(2000); read_local(); gps_lcd(); if(kitu=='V') { strcpy(string,"LOCATION UNKNOWN"); show(2,2,string); } else if(kitu=='A') { strcpy(string,"SMS SENDING..."); show(2,0,string); output_high(sen); printf("AT+CMGS=\"0975073549\""); putc(13); //Send local output_low(sen); delay_ms(1000); for(n=0;n<24;n++) { output_high(sen); if (sms_kv[n]=='\0') {break;} printf("%c",sms_kv[n]); output_low(sen); } output_high(sen); putc(26); output_low(sen); delay_ms(7000); output_high(sen); putc(13); output_low(sen); strcpy(string," "); show(2,0,string); strcpy(string,"COORDINATES SENT..."); show(2,0,string); } delay_ms(20000); }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?