Code:
'RCSTA2 = $90 ' Enable serial port & continuous receive
'TXSTA2 = $24 ' Enable transmit, BRGH = 1
'DEFINE HSER_CLROERR2 1 ' Clear overflow automatically
'SPBRG2 = 130 ' 9600 Baud @ 64MHz, -0,02%
'SPBRGH2 = 6
'BAUDCON2.3 = 1 ' Enable 16 bit baudrate generator
and for changing the baudrate and the frequency for the Second Serial,
Code:
pause 800
HSEROUT2 ["$PMTK251,38400*27",13,10] ' 38400 boundrate, check MTK manual configuration
pause 800
SPBRG2 = 160 ' 38400 Baud @ 64MHz, -0,08%
SPBRGH2 = 1
Pause 500
;HSEROUT2 ["$PMTK314,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0*29",13,10]
HSEROUT2 ["$PMTK314,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28",13,10]
pause 100
HSEROUT2 ["$PMTK220,100*2F",13,10] ' 100(millisecond)=0.1(sec)-->1/0.1= 10Hz
pause 100
I found out that on SERIAL TERMINAL on the computer of course i see the data coming from the GPS but unfortunately when i connect an LCD to PIC using the first Serial, the data cannot be displayed.
Bookmarks