A long time a go , i interfaced an GPS receiver to an 16c74. Because the 16c74 didn't had enough ram space i picked out of the data stream from the GPS receiver only the bytes i needed. Hope this code will help you to interface your gps receiver, sorry for the Dutch comment and the not very structered way of programming. // GPS-communication & synchronisation // // prototyping void gpscom(void); void GPS1Hz_handler(void); // void transmitbuffer_empty(void); #use delay(clock=CRYSTAL) #use RS232(BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7) struct gps_data{ byte sats; long utc_year; byte utc_month; byte utc_day; byte utc_hr; byte utc_min; byte utc_sec; long utc_nsec; }; byte byte_cnt; byte word_cnt; union { byte _byte[2]; long _word; } rx; long ck_sum; long msg_id; long msg_len; struct gps_data gpd; // byte last_byte ; // voor simulatie debugging /* #int_tbe transmitbuffer_empty() { } */ #int_rda gpscom() { byte c; c = getc(); if (byte_cnt == 0) { // init structures;nieuwe message msg_id = 0; ck_sum = 0; if (c!=0xff) return; } byte_cnt++; // received bytes # if (byte_cnt & 1) // oneven bytes (eerste, derde ...) { rx._byte[0] = c; // alleen onthouden } else { word_cnt = byte_cnt >>1; rx._byte[1] = c; if (byte_cnt) ck_sum += rx._word; switch (word_cnt) { case 1 : if (rx._word != 0x81ff) byte_cnt = 0; // foute sync break; case 2 : msg_id = rx._word; break; case 3: msg_len = rx._word; break; case 5 : // header compleet. controleer checksum if (ck_sum != 0) byte_cnt =0; // niet ok --> wacht op sync break; case 6 : ck_sum = 0; // reset checksum voor data van message } if (word_cnt >= 6) // na header { if (msg_id == 1000) switch(word_cnt) { case 12: gpd.sats = rx._word; break; case 19: gpd.utc_day =rx._word; break; case 20: gpd.utc_month=rx._word; break; case 21: gpd.utc_year=rx._word; break; case 22: gpd.utc_hr =rx._word; break; case 23: gpd.utc_min =rx._word; break; case 24: gpd.utc_sec =rx._word; break; case 26: gpd.utc_nsec=rx._word; break; } if ((word_cnt - 5) == msg_len) // aantal woorden - header = msg_len ? { if (ck_sum == 0) { // alles ok. doe er wat mee. if ((msg_id == 1000) && (gpd.sats >1)) // velden uit msg 1000 geldig, >1 sat. { } } else { byte_cnt = 0; // structure is niet geldig. } } } } } #int_ext GPS1Hz_handler() { timer1_interupt_flag=off; // clear flag from previous overflow and to enable next int. set_timer1(0xbfff+ (((gpd.utc_nsec + 0x7ff)/100)*93) ); //(0xbfff + 0x83e + (gpd.utc_nsec + (73*gpd.utc_nsec)/1000) ); enable_interrupts(INT_TIMER1); } -------------------------------------------------------- Professional Audio Center / EELA Audio (email: pac@eela.nl) Parmentierweg 3 Phone: +31 40 251 04 84 5657 EH Eindhoven Fax : +31 40 257 04 82 The Netherlands homepage : http://www.eela.nl Hans Brandsma (email: hans@eela.nl)