Ok i have right now:
1. TX port which is connected to ulcd. Baudrate : 38400
Example code:
Code:
pause 2000
serout2 LCD,6,[$55] ' uOLED Initialize this is the 'U' character of autoband rate to LCD
pause 500
serout2 LCD,6,[$56,$01] ' this is the Version info
pause 500
serout2 LCD,6,[$45] ' clear the lcd
pause 100
2. RX port from GPS module. Baudrate : 9600
Example code:
Code:
;serin2 gps_tx,84,timeout,lostcable,[wait("$GNRMC"),_ ;we wait for $GNRMC
The GPS at the moment is locked at 9600. Via the serial terminal GPS software i set it to 19200 and accepts the command. But only for the time the module is connected to the power. When we disconnect the power from GPS, the default commands are set.
I dont mind for that right now as i found out that i can communicate with PIC at 19200 with GPS and receive the commands on the display.
The setting for the Clock Speed is 8Mhz.
Now if i increase the speed of the baudrate with GPS and goes up to 38400 then i cannot display anything.
I did an experiment and added an external Crystal of 16 Mhz. For my surprise values presented on the display.
I have a question now. something i dont like with the following code:
Code:
@ ERRORLEVEL -306 ; this command prevents the compiler to give you a notice of
; crossing page boundary - make sure bits are set
#CONFIG
__config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
#ENDCONFIG
Include "MODEDEFS.BAS"
DEFINE OSC 8
OSCCON=%01110000 '8 Mhz
Why should i need to add both of the lines?
Code:
DEFINE OSC 8
OSCCON=%01110000 '8 Mhz
In case i remove any of these, it compiles ok, but program is not working.
I need to specify that this is an internal OSC, but above in the configuration bits i have put _HS_OSC (if i remember that must be set from the manual)
Is it right?
thanks a lot for your help once again.
Bookmarks