<?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>Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart</link><description>I am trying to receive data from GPS L80 with the nrf52832 board but I am not able to receive anything. I connected the Rx of nrf52832 with GPS and vice versa. I also connected the grounds of both these devices together. I am hereby attaching my code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jul 2019 08:22:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart" /><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/199144?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 08:22:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb6c6da1-06ae-40f4-938c-cfab4f02bc98</guid><dc:creator>awneil</dc:creator><description>[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart/199124"]I am giving the command&amp;nbsp;&amp;nbsp;&amp;quot;$PMTK225,4*2F\r\n&amp;quot;[/quote]
&lt;p&gt;That is not what the code you posted had!&lt;/p&gt;
[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart/199124"]I think&amp;nbsp; that by using this code &amp;quot;while (app_uart_put(txBuff[i]) != NRF_SUCCESS);&amp;quot; I am not able to send the command.[/quote]
&lt;p&gt;So what &lt;em&gt;actually&lt;/em&gt; happens?&lt;/p&gt;
&lt;p&gt;What do you see coming from the UART when you run the code?&lt;/p&gt;
&lt;p&gt;Have you stepped the code in the &lt;strong&gt;debugger&lt;/strong&gt;&amp;nbsp;to see what is actually going on?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/199124?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2019 07:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80073187-d512-4811-80cd-28c6d2565d2a</guid><dc:creator>Utkarsh</dc:creator><description>&lt;p&gt;Yes sir you are right, I am giving the command&amp;nbsp;&amp;nbsp;&amp;quot;$PMTK225,4*2F\r\n&amp;quot; , this command is supposed to send the GPS L80 module in the backup mode, i.e., it should stop transmitting anything. But I think&amp;nbsp; that by using this code &amp;quot;while (app_uart_put(txBuff[i]) != NRF_SUCCESS);&amp;quot; I am not able to send the command. This statement should send the string char by char to the GPS until the controller returns NRF_SUCCESS which indicates that the whole string is sent and the GPS should go in backup mode, but it&amp;#39;s not happening and the GPS is showing no response. What should I do sir?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/199075?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 18:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56fb5662-f241-4527-a115-c4b4e1e46190</guid><dc:creator>awneil</dc:creator><description>[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart/199072"] I am not able to send the whole string at one time[/quote]
&lt;p&gt;Why not - what prevents you ?&lt;/p&gt;
&lt;p&gt;What were you &lt;em&gt;expecting&lt;/em&gt; to happen?&lt;/p&gt;
&lt;p&gt;What is &lt;em&gt;actually&lt;/em&gt; happening?&lt;/p&gt;
&lt;p&gt;Have you stepped through your code in the &lt;strong&gt;debugger&lt;/strong&gt; to see what&amp;#39;s going on?&lt;/p&gt;
&lt;p&gt;In particular, what do you think this is going to do:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;while (app_uart_put(txBuff[i]) != NRF_SUCCESS);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think your command string is correct:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;char txBuff[]=&amp;quot;$PMTK225,4*2F&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&amp;quot;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Instead of &amp;quot;&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&amp;quot; I think you mean &amp;quot;\r\n&amp;quot; ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/199072?ContentTypeID=1</link><pubDate>Wed, 17 Jul 2019 17:29:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06c5412a-442a-4175-9710-7a03a337b086</guid><dc:creator>Utkarsh</dc:creator><description>&lt;p&gt;Hi sir,&lt;/p&gt;
&lt;p&gt;I executed it and now it is working fine, but now I am trying to communicate with GPS L80 by trying to send its PMTK commands. I converted the command into a string so that&amp;nbsp; nrf52832 controller transmits the whole string at a time and the GPS can execute the command but I am not able to send the whole string at one time, I am using the ble_app_uart code please can you help me? I am attaching the code.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MCU_TX 23
#define MCU_RX 24
int main(void)
{
uint8_t rxBuff[10];
    char txBuff[]=&amp;quot;$PMTK225,4*2F&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;&amp;quot;;
    app_uart_flush();
    while (true)
    {
    for(int i=0;i&amp;lt;22;i++){
        while (app_uart_put(txBuff[i]) != NRF_SUCCESS);
        }
        nrf_delay_ms(2000);
         }
         }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198667?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 10:17:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abd94e50-a2a9-453e-a41c-70acb892750a</guid><dc:creator>Utkarsh</dc:creator><description>&lt;p&gt;&lt;span&gt;Thanks sir, I&amp;#39;ll try the same and get back to you.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198666?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 10:17:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72bb1a2f-e7f5-48d7-8b38-d333c8c88c9e</guid><dc:creator>Utkarsh</dc:creator><description>&lt;p&gt;Thanks sir, I&amp;#39;ll try the same and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198637?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 08:19:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44e81e49-3d1a-4142-a043-42e413f351d6</guid><dc:creator>awneil</dc:creator><description>[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart/198633"]The uart1 structure when running the code shows everything that I have set[/quote]
&lt;p&gt;But it doesn&amp;#39;t show how you have physically connected to your GPS unit.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart/198633"] I tried to interconnect Tx and Rx of the board to see that if I am transmitting something, am I getting that back again[/quote]
&lt;p&gt;The next step is to connect to an external USB-to-UART, and verify that you can both send and receive over that.&lt;/p&gt;
&lt;p&gt;This will prove:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;That you can correctly configure the pins&lt;/li&gt;
&lt;li&gt;That you can correctly set the baud rate&lt;/li&gt;
&lt;li&gt;That you can correctly identify which is &amp;quot;Tx&amp;quot; and which is &amp;quot;Rx&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A simple loopback doesn&amp;#39;t confirm any of those.&lt;/p&gt;
&lt;p&gt;See here for more tips on serial debugging:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.avrfreaks.net/comment/2306116#comment-2306116"&gt;https://www.avrfreaks.net/comment/2306116#comment-2306116&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.avrfreaks.net/comment/2336161#comment-2336161"&gt;https://www.avrfreaks.net/comment/2336161#comment-2336161&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Note the use of &lt;em&gt;&lt;strong&gt;two&lt;/strong&gt; &lt;/em&gt;terminals - so that you can see both Rx &amp;amp; Tx data ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198635?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 08:18:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1f9c5b6-3ad6-446e-aa89-bd2461a54a42</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The&amp;nbsp;NRF_UART_Type is a reference to the actual hardware registers for the UART peripheral. You have created a new instance, but it will reference a random location in RAM. It will show the values you assign it, but these values will not be written to the registers. Replace &amp;amp;uart1 in the function calls with the already defined instance reference,&amp;nbsp;&lt;span&gt;NRF_UART0.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198633?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 08:10:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e94826-7e09-4e6b-94bf-882b41ab5b89</guid><dc:creator>Utkarsh</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;I have run the already given UART example from examples/peripheral/uart and it seems to work fine. I tried to interconnect Tx and Rx of the board to see that if I am transmitting something, am I getting that back again. The uart1 structure when running the code shows everything that I have set i.e Tx and Rx pins that I have set manually also Tx data i.e 1 (just to check) but still I am getting getting 0 at Rx and also the buadrate is not been set. I am attaching the code as well as the snapshot of the uart1 structure when watched in watch. Please help.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 * @defgroup uart_example_main main.c
 * @{
 * @ingroup uart_example
 * @brief UART Example Application main file.
 *
 * This file contains the source code for a sample application using UART.
 *
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;app_uart.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;nrf_uart.h&amp;quot;

NRF_UART_Type uart1;

//#define ENABLE_LOOPBACK_TEST  /**&amp;lt; if defined, then this example will be a loopback test, which means that TX should be connected to RX to get data loopback. */

/*#define MAX_TEST_DATA_BYTES     (15U)                *&amp;lt; max number of test bytes to be used for tx and rx. */
#define UART_TX_BUF_SIZE 256                         *&amp;lt; UART TX buffer size. */
#define UART_RX_BUF_SIZE 256                         *&amp;lt; UART RX buffer size. */
#define uart1_rx NRF_GPIO_PIN_MAP(0,22)
#define uart1_tx NRF_GPIO_PIN_MAP(0,23)
uint8_t tx_data = 1;
uint8_t rx_data;

void uart_error_handle(app_uart_evt_t * p_event)
{
    if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
    }
    else if (p_event-&amp;gt;evt_type == APP_UART_FIFO_ERROR)
    {
        APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
    }
}



/* When UART is used for communication with the host do not use flow control.*/
#define UART_HWFC APP_UART_FLOW_CONTROL_DISABLED
#endif


/**
 * @brief Function for main application entry.
 */
int main(void)
{
    nrf_uart_enable(&amp;amp;uart1);
    nrf_uart_txrx_pins_set(&amp;amp;uart1, uart1_tx, uart1_rx);
    nrf_uart_baudrate_set(&amp;amp;uart1,NRF_UART_BAUDRATE_115200);

char UART_RX_BUF[256];
int i=0;
    while (i&amp;lt;256)
    {   
        nrf_uart_txd_set(&amp;amp;uart1,tx_data);
        rx_data = nrf_uart_rxd_get(&amp;amp;uart1);
        i++;
    }

}



&lt;/pre&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1134.Capture.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198504?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 13:48:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8daa96c0-fb09-402f-9d01-b30ca376e74e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You do not assign any useful value to&amp;nbsp;&lt;span&gt;uart1. You should rather pass the existing symbol of NRF_UART_Type that is defined in nrf52.h:&amp;nbsp;NRF_UART0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Receiving data from GPS L80 with nrf52832 via UART</title><link>https://devzone.nordicsemi.com/thread/198487?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2019 13:24:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cec840df-de77-4b5e-86f7-d48311a7c352</guid><dc:creator>awneil</dc:creator><description>[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart"]the nrf52832 board[/quote]
&lt;p&gt;&lt;em&gt;What&lt;/em&gt;&amp;nbsp;&lt;span&gt;nrf52832 board, exactly ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If it&amp;#39;s&amp;nbsp;Nordic&amp;#39;s nRF52832-DK, remember that it has a USB-to-UART converter occupying some pins ...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49703/connecting-uart-data-to-development-board-pca10040/198110#198110"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/49703/connecting-uart-data-to-development-board-pca10040/198110#198110&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart"]I am not able to receive anything.[/quote]
&lt;p&gt;&lt;span&gt;Before adding the complications of 3rd-party external devices, have you tried the UART example in the SDK, and got that working?&lt;/span&gt;&lt;/p&gt;
[quote userid="81573" url="~/f/nordic-q-a/49769/receiving-data-from-gps-l80-with-nrf52832-via-uart"]I connected the Rx of nrf52832 with GPS and vice versa[/quote]
&lt;p&gt;&lt;span&gt;How did you connect it, exactly?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Show a &lt;em&gt;&lt;strong&gt;schematic&lt;/strong&gt;&lt;/em&gt; - trying to describe connections in text highly ineffective!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How to properly post source code:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7245._5F00_Insert-Code-_2D00_-Nordic.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>