# how to send command to gps module in software UART

**URL:** <https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156>\
**Category:** MicroMod\
**Tags:** msp\
**Created:** [May 13, 2009, 4:44am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156 "2009-05-13T04:44:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [May 13, 2009, 4:44am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/1 "2009-05-13T04:44:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [May 13, 2009, 5:06am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/2 "2009-05-13T05:06:40Z")

</div>

Why not use the PC UART?

Leon

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [May 14, 2009, 3:59am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/3 "2009-05-14T03:59:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [May 14, 2009, 4:18am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/4 "2009-05-14T04:18:50Z")

</div>

Just use the UART in the MCU.

Leon

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [May 14, 2009, 5:11am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/5 "2009-05-14T05:11:39Z")

</div>

We should use Software uart.

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [May 14, 2009, 7:29am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/6 "2009-05-14T07:29:32Z")

</div>

Just write the code for it, then.

Leon

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [May 14, 2009, 11:21am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/7 "2009-05-14T11:21:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [May 18, 2009, 4:15am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/8 "2009-05-18T04:15:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [June 2, 2009, 9:46am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/9 "2009-06-02T09:46:06Z")

</div>

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]_

---

<div class="post-metadata">

**Author:** ![OldCow](https://avatars.discourse-cdn.com/v4/letter/o/e274bd/32.png) [@OldCow](https://community.sparkfun.com/u/OldCow)\
**Post date:** [June 3, 2009, 1:20am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/10 "2009-06-03T01:20:47Z")

</div>

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._

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [June 3, 2009, 4:41am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/11 "2009-06-03T04:41:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![naz](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@naz](https://community.sparkfun.com/u/naz)\
**Post date:** [June 5, 2009, 6:57am UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/12 "2009-06-05T06:57:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Roko](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Roko](https://community.sparkfun.com/u/Roko)\
**Post date:** [June 5, 2009, 4:04pm UTC](https://community.sparkfun.com/t/how-to-send-command-to-gps-module-in-software-uart/11156/13 "2009-06-05T16:04:29Z")

</div>

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…
