hi
sorry if my original post was confusing i typed it in a rush lol
first of all i connected my gps unit directy to a pic micro then using serin2 and wait, i waited for a particular nmea sentence to parse it etc, and the pic was just waiting it never could see even a $ sign coming from the gps unit,
so then...
got rid of the pic and i connected the gps unit directly to my pc's serial port via an rs232 chip, and viewed the data via microcode studio serial communicator
but the data would only be sent to the pc when i applied and removed power to the rs232 chip repeatedly if that makes sense.
below is the basic code i created just to see if the gps unit was transmitting data to the pic.
Code:@ device pic16f870,WDT_OFF 'Watch Dog Timer Disabled @ device pic16f870,PROTECT_OFF 'Code Protect Off @ device pic16f870,XT_OSC 'Using External Oscillator @ device pic16f870,BOD_on 'Brown Out Timer Disabled @ device pic16f870,PWRT_on 'Power On Timer Disabled @ device pic16f870,LVP_OFF 'Low Voltage Programmed Disabled define OSC 20 'TRISA = %11111111 'TRISC = %00000000 'ADCON0.0=0 'ADCON1=7 ' ALL PINS SET TO DIGITAL 'Pin Assignments GPIO0 VAR PORTA.0 NC VAR PORTA.4 TX var portb.5 RX VAR PORTA.2 Reset var porta.1 GPIO4 var porta.5 'Variables gps_data var byte HIGH PORTC.0 PAUSE 200 LOW PORTC.0 PAUSE 200 SEROUT2 PORTC.1,16468,["GPS TEST$123456"] pause 500 'allow gps module to init 'if gpio4=0 then high portc.3'(red) reset_unit: low reset pause 100 high reset MAIN: serin2 TX,16468,[WAIT("$GPGGA"),str gps_data\6] PAUSE 200 HIGH PORTC.0 PAUSE 200 LOW PORTC.0 PAUSE 200 SEROUT2 PORTC.1,16468,[str gps_data\6] GOTO MAIN
Bookmarks