<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31226/acquiring-gps-data-through-uart-on-a-polling-basis</link><description>I&amp;#39;m able to successfully use peripheral/uart example to read the data from GPS module. I achieved the same by setting baud rate to 4800, and connecting rx and tx of GPS to pins 6 and 8 respectively. Currently I have the GPS data printed on my console</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Mar 2018 16:19:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31226/acquiring-gps-data-through-uart-on-a-polling-basis" /><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/124217?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2018 16:19:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f8cab3-f46d-4b52-b523-d09f54787de4</guid><dc:creator>sprasad</dc:creator><description>&lt;p&gt;Got it working by using&amp;nbsp;&amp;nbsp;&lt;span class="s1"&gt;NRF_UART0-&amp;gt;TASKS_STARTRX = 1 while receiving the data and then&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="s1"&gt;NRF_UART0-&amp;gt;TASKS_STOPRX = 1 and app_uart_flush() in the error handler to ignore RX overrun errors.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/124000?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 16:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a21510e7-a1f7-40a7-be43-a4ff0d9b57c1</guid><dc:creator>sprasad</dc:creator><description>&lt;p&gt;Hey Marthin, Thank you for your inputs. Here is my problem,&lt;/p&gt;
&lt;p&gt;1) I don&amp;#39;t have to rely on directive line on the GPS module because I don&amp;#39;t want to know when the data ready, all I want to do is to read the data when I&amp;#39;m ready (assuming that GPS has a valid data).&lt;/p&gt;
&lt;p&gt;2) I also do not want to receive the data at specific intervals. Again, as mentioned, I just want to read the GPS data when I need it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, my thought is as follows, let the GPS continuously&amp;nbsp;transmit data over UART. When I want the data, I would like to just go read the UART buffer and interpret the location. Isn&amp;#39;t something like that possible&amp;nbsp;at all?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/123985?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 15:04:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76dd149c-24a5-4953-908c-d910b5ff6b72</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;If the CPU is stalled while the GPS module is continuously sending data to the device, and you chose to &amp;quot;jump randomly in&amp;quot; to read data, that will cause problems. (&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52840.ps%2Fuarte.html&amp;amp;cp=2_0_0_33&amp;amp;anchor=concept_ayq_ycm_wr" target="_blank" rel="noopener noreferrer"&gt;UARTE documentation&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Anyway, &amp;quot;&lt;em&gt;I would invite you to look at the&amp;nbsp;&lt;a href="https://cdn.sparkfun.com/datasheets/GPS/EM506_um.pdf" target="_blank" rel="noopener noreferrer"&gt;GPS whitepape&lt;/a&gt;r and configure it to send a signal through the &amp;quot;Directive&amp;quot; line when the GPS data is ready, and connect that line to one the GPIOs to the nRF device. Then use that interupt to start reading the UART data from the GPS module.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I see that you can configure the GPS module to send data in intervals. &amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/123741?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 16:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61365787-d8b3-4211-aa61-0cbc33dae9f8</guid><dc:creator>sprasad</dc:creator><description>&lt;p&gt;Yes, you are right that the delay stalls the CPU, but after that, the while loop should continue and it should go ahead and read further characters through the uart&amp;nbsp;right? Why isn&amp;#39;t that happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/123726?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 14:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:113a65e4-2f14-494a-bc4f-808902febd31</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;The&amp;nbsp;&lt;em&gt;nrf_delay_ms(1000);&lt;/em&gt; stalls the CPU&amp;nbsp;for 1 sec. at that point in your while loop.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would invite you to look at the &lt;a href="https://cdn.sparkfun.com/datasheets/GPS/EM506_um.pdf" target="_blank" rel="noopener noreferrer"&gt;GPS whitepape&lt;/a&gt;r and configure it to send a signal through the &amp;quot;Directive&amp;quot; line when the GPS data is ready, and connect that line to one the GPIOs to the nRF device. Then use that interupt to start reading the UART data from the GPS module.&lt;/p&gt;
&lt;p&gt;I see that you can configure the GPS module to send data in intervals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/123674?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 12:55:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7723d38e-5e83-4096-b15c-d0400f6a8302</guid><dc:creator>sprasad</dc:creator><description>&lt;p&gt;Hello Martin,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using GPS Module EM - 506.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For my application, I only need the latitude and longitude information. So, sending AT commands and receiving the data would make it complicated. Anyhow, upon connection, GPS module sends out the data as strings with a specific format. All I have to do is parse those strings and extract Latitude/ Longitude information from them.&lt;/p&gt;
&lt;p&gt;I just want to be able to&amp;nbsp;read the rx buffer of&amp;nbsp;uart&amp;nbsp;at will and parse the data when needed. During other times, I don&amp;#39;t care what data in arriving on the UART port.&lt;/p&gt;
&lt;p&gt;I would like to perform something like this&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;// Other functions running
// Like saadc, ble advertising

if (trigger_condition) 
{
    string = read_data_coming_from_GPS_module();
    parse_string();
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Basically. I want to poll the UART module for data take whatever GPS module has transmitted.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also curious as to why would the data transmission stop on adding that&amp;nbsp;nrf_delay_ms(1000) !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Acquiring GPS data through UART on a polling basis.</title><link>https://devzone.nordicsemi.com/thread/123661?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 12:29:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a3fd2d5-c4ba-41fb-be5d-9da4505d408b</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hello Sharada,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; What type GPS are you using?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Usually you can send a command to to the GPS module and get the data when you ask for it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>