GSM and GPS Serial Communication Problem
Fri Apr 09 2010, 12:04 am
Hello Rickey,
Iam Done with my GPS programming by getting my Required string from GPS " $GPRMC...." Now i have to send it through GSM am also done with GSM at commands but the problem iam Facing is that at a same time in 89c52 GPS or GSM will work so i take a sbit P1^5 as a Mux activation bit.if its 1 then GPS data will be recieved if its 0 then GSM will transmitt and Recieve...So tell me how will i interface two RS232 with a one sbit which i have...
Thanks
Iam Done with my GPS programming by getting my Required string from GPS " $GPRMC...." Now i have to send it through GSM am also done with GSM at commands but the problem iam Facing is that at a same time in 89c52 GPS or GSM will work so i take a sbit P1^5 as a Mux activation bit.if its 1 then GPS data will be recieved if its 0 then GSM will transmitt and Recieve...So tell me how will i interface two RS232 with a one sbit which i have...
Thanks
Fri Apr 09 2010, 12:29 am
well you might need little more pins for mux purpose. take a look at CD4052 Analog MUX/DEMUX you use it for uart muxing.
Fri Apr 09 2010, 12:46 am
Try some of the posts around this post
http://www.8051projects.net/forum-t28099-120.html#post_32582
http://www.8051projects.net/forum-t28099-120.html#post_32582
Fri Apr 09 2010, 11:55 am
hey Rickey i have been through this program which is some how similar to mine..here u can c he used a single pin name mux....
void main()
{
int ddd=0
lcd_delay();
int_lcd();
clear_lcd();
while(1)
{
qq=1;
mux=1;
r4=0;
Set_Baud_Rate_For_GPS();
Receive_gps_data();
mux=0;
Set_Baud_Rate_For_Mob();
Transmit_First(); //at
delay();
Transmit_Second(); //at+cmgf=1
delay();
Send_sms_gps_data();
for(ddd=0;<26;ddd++)
{
recv[ddd]=0;
}
r4=0
if(c1==0)
{
ACC=0x4f;
lcd_write_txt();
lcd_delay();
ACC=0x4b;
lcd_write_txt();
lcd_delay();
hex_lcd();
r4=1;
}
delay();
//delay();
//delay();
Transmit_First(); //at
delay();
Transmit_Second(); //at+cmgf=1
delay();
Read_command();
qq=0
if(read[0]=='!')
car_engine=0;
if(read[1]=='!')
car_engine=0;
if(read[2]=='!')
car_engine=0;
if(read[0]=='%')
car_engine=1;
if(read[1]=='%')
car_engine=1;
if(read[2]=='%')
car_engine=1;
delay();
}
}
void main()
{
int ddd=0
lcd_delay();
int_lcd();
clear_lcd();
while(1)
{
qq=1;
mux=1;
r4=0;
Set_Baud_Rate_For_GPS();
Receive_gps_data();
mux=0;
Set_Baud_Rate_For_Mob();
Transmit_First(); //at
delay();
Transmit_Second(); //at+cmgf=1
delay();
Send_sms_gps_data();
for(ddd=0;<26;ddd++)
{
recv[ddd]=0;
}
r4=0
if(c1==0)
{
ACC=0x4f;
lcd_write_txt();
lcd_delay();
ACC=0x4b;
lcd_write_txt();
lcd_delay();
hex_lcd();
r4=1;
}
delay();
//delay();
//delay();
Transmit_First(); //at
delay();
Transmit_Second(); //at+cmgf=1
delay();
Read_command();
qq=0
if(read[0]=='!')
car_engine=0;
if(read[1]=='!')
car_engine=0;
if(read[2]=='!')
car_engine=0;
if(read[0]=='%')
car_engine=1;
if(read[1]=='%')
car_engine=1;
if(read[2]=='%')
car_engine=1;
delay();
}
}
Sun Apr 11 2010, 02:08 pm
hi shezo i am really not sure what component he is using for mux-ing uarts. so if you can come up with the circuit it would be easy to help.
Mon Apr 12 2010, 12:39 pm
Mon Apr 12 2010, 12:45 pm
Hey Rickey wot u think about this??
[ Edited Mon Apr 12 2010, 12:46 pm ]
Mon Apr 12 2010, 12:52 pm
Tue Apr 13 2010, 03:08 pm
yes that will work for sure
and using only one pin.. clever i never thought that way
and using only one pin.. clever i never thought that way
Wed Apr 14 2010, 02:01 pm
Dear Ajay and Shezo
I am doing almost the same project. I am using 89v51rd2, garming gps 15h and sim300
Please do advise me which option should i choose for connecting 2 serial devices (gps and gsm) to 89v51
1. Emulating a software UART like mentioned on the tutorials on the site
2. Using a 2:1 Mux - Quadraple
3. Do something like Shezo has done by using nand gates.
Regards
Abhishek
I am doing almost the same project. I am using 89v51rd2, garming gps 15h and sim300
Please do advise me which option should i choose for connecting 2 serial devices (gps and gsm) to 89v51
1. Emulating a software UART like mentioned on the tutorials on the site
2. Using a 2:1 Mux - Quadraple
3. Do something like Shezo has done by using nand gates.
Regards
Abhishek
Powered by e107 Forum System