how to send command to gps module in software UART

I have written code for communication between GPS module to PC through microcontroller by using software UART. Now i want to send the commands from PC to GPS module through microcontroller using software UART. Is it possible?can any one give me a correct idea about this?.

Thanks & Regards

Aruna

Why not use the PC UART?

Leon

yes we can use PC UART.But give me an idea for how to send commands to GPS through microcontroller’s port pin.

Just use the UART in the MCU.

Leon

We should use Software uart.

Just write the code for it, then.

Leon

i don’t know how to send commands to gps through software uart and how to receive acknowldgement from gps module to pc. give me an any example code.

if anybody have some idea about software uart please guide me.

hello all,

i’m using msp430f2232,it has one hardware UART.Here i’m receiving data from GPS to Pc using software UART.but i’m getting some issues on hardware uart.

This is code for hardware uart.

while(1)

{//0

CHARREAD = RXBUF0;

if(CHARREAD == ‘$’)

{//1

I=0;

NUMLINESREAD++;

STRINGREAD = CHARREAD;
do
{//2
if ( URCTL0 == 0)
{//3
printf(“%c”,STRINGREAD*);*
I++;
while (!(IFG1 & URXIFG0));
CHARREAD = RXBUF0;
STRINGREAD = CHARREAD;
} //3
} while ( CHARREAD!=CR);//2
}//1
}//0

if i give Factory Reset command($ACFRM),i’ll get only $M means first and last character. i think we can solve this problem,could u please guide on this?
[/img]

What is URCTL0? Is “if ( URCTL0 == 0) …” sometimes false?

When that is false, you ignored the UART and will miss what the UART received.

How much time is needed to do “printf(”%c",STRINGREAD*);"?*
While the CPU is doing that, you ignored the UART and will miss what the UART received.

thank you for your’s reply,

Here i’m using printf for debugging purpose only,i’m checking what data received by microcontroller.then how to check whether GPS is received that data or not.

Hello all,

I’m using msp430f2232.it has one hardware uart,

my ojective is


1.i’m receiveing data from gps to Pc through microcontroller using software uart(it’s working fine)

2.simultaneously i’m sending command(ex:factory reset=$ACFRM)from pc to gps through microcontroller using hardware uart.

3.i combined both the programs but i didn’t receive any data from GPS why?

my doubts:


1.while i’m receiving data from gps,shall i send command to gps?is it possible?

any guess or any idea?

Thanks & Regards

naz

You’ll have to check your GPS’ data sheet to find out if it’s full duplex or not. If it’s full duplex serial, it can send and receive commands at the same time. If it’s half duplex, it can only send, OR receive, but not at the same time…