Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Facing Problem in PIC18F542 UART

Status
Not open for further replies.

djahmednawaz

Newbie level 3
Joined
Dec 24, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,309
I am creating a Tracker which sends GPS Location to Server Through GSM after every 15seconds.
In which i am getting string from a GPS Module (Holux M-89) and sending this string through GSM Module (SIM300DZ).
I connected the GPS TX pin to RX of PIC18f452 and GSM RX to TX of IC18F452.
GPS Module work on baud rate of 4800 and GSM Module Work on baud rate of 9600.
1st i initialize the UART with 4800 and got string from GPS. then i initialize the UART with 9600 and send through GSM.
Untill this my Simulation in ISIS-Proteus Working fine...
but when go back for getting new string from GPS (Note: I reinitialize UART at 4800) it stuck there. at while(RCIF==0);
Following Code i am using for Initializing UART at 4800 for GPS
Code:
void initGPS(void) {  
         TRISC6=0; 
         TRISC7=1;       
         PORTC=0x00;     
         TXSTA=0b10100000;       
         RCSTA=0b10010000;       
         SPBRG=(int)(20000000/(64.0*4800)-1);
 }
Following Code i am using for Initializing UART at 9600 For GSM
Code:
 void initGSM(void) {
       TRISC6=0;
       TRISC7=1;
       TXSTA=0b10100000;
       RCSTA=0b10010000;
       SPBRG=(int)(20000000/(64.0*9600)-1);
 }
Any Idea how to solve this problem..
I need to send GPS data after every 15seconds Through GSM.
Note: I am using Hi-TECH Compiler and PIC18f452
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top