SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By naz
#72663
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
User avatar
By leon_heller
#72664
Why not use the PC UART?

Leon
By naz
#72732
yes we can use PC UART.But give me an idea for how to send commands to GPS through microcontroller's port pin.
User avatar
By leon_heller
#72733
Just use the UART in the MCU.

Leon
By naz
#72739
We should use Software uart.
User avatar
By leon_heller
#72743
Just write the code for it, then.

Leon
By naz
#72764
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.
By naz
#72968
if anybody have some idea about software uart please guide me.
By naz
#74027
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[I] = CHARREAD;
do
{//2
if ( URCTL0 == 0)
{//3
printf("%c",STRINGREAD[I]);
I++;
while (!(IFG1 & URXIFG0));
CHARREAD = RXBUF0;
STRINGREAD[I] = 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]
By OldCow
#74067
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.
By naz
#74076
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.
By naz
#74217
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
By Roko
#74239
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...