<?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>How to transfer data through UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8069/how-to-transfer-data-through-uart</link><description>Hi, 
 I used nrf51822- EK board. 
 GATT - s110 6.2.1 softdevice 
 I transfer data through UART for nrf51822-EK(PCA10001). 
 But this time. I used nrf51822 smart beacon kit(PCA20006). 
 PCA20006 is received data through UART. 
 But PCA20006 is not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Jul 2015 10:09:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8069/how-to-transfer-data-through-uart" /><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28933?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 10:09:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f1b6201-07c1-4492-899a-d15e8c96beac</guid><dc:creator>aworks</dc:creator><description>&lt;p&gt;Un set RTS, CTS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28931?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 08:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4993f82-dbaf-4563-80b5-62c3f411591b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;how did you solve it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28932?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 08:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc24cbda-5d18-4db1-87c4-2d56b201d326</guid><dc:creator>aworks</dc:creator><description>&lt;p&gt;I solve this problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28930?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 06:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0405758c-922f-4154-87e5-f1f9a27306a1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;you did not mention if you have connected your beacon to PC or somthing? does does it get RX characters and where does uart put TX charaters?
Also I do not understand what this below means&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PCA20006 UART
rx ------------------------- tx (OK)
tx ------------------------- rx (XX)&amp;lt;-- this problem...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;you might as well try to disable flow control and see if that works&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28929?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 05:09:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d69a2332-d840-4c6a-ba84-42ee314956cd</guid><dc:creator>aworks</dc:creator><description>&lt;p&gt;this code simple_uart.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28928?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2015 04:57:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41024036-6592-42e2-8304-c4e444d28da8</guid><dc:creator>aworks</dc:creator><description>&lt;p&gt;/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdint.h&amp;gt;

#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;simple_uart.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

uint8_t simple_uart_get(void)
{
  while (NRF_UART0-&amp;gt;EVENTS_RXDRDY != 1)
  {
    // Wait for RXD data to be received
  }
  
  NRF_UART0-&amp;gt;EVENTS_RXDRDY = 0;
  return (uint8_t)NRF_UART0-&amp;gt;RXD;
}

bool simple_uart_get_with_timeout(int32_t timeout_ms, uint8_t *rx_data)
{
  bool ret = true;
  
  while (NRF_UART0-&amp;gt;EVENTS_RXDRDY != 1)
  {
    if (timeout_ms-- &amp;gt;= 0)
    {
      // wait in 1ms chunk before checking for status
      nrf_delay_us(1000);
    }
    else
    {
      ret = false;
      break;
    }
  }  // Wait for RXD data to be received

  if (timeout_ms &amp;gt;= 0)
  {
    // clear the event and set rx_data with received byte
      NRF_UART0-&amp;gt;EVENTS_RXDRDY = 0;
      *rx_data = (uint8_t)NRF_UART0-&amp;gt;RXD;
  }

  return ret;
}

void simple_uart_put(uint8_t cr)
{
  NRF_UART0-&amp;gt;TXD = (uint8_t)cr;

  while (NRF_UART0-&amp;gt;EVENTS_TXDRDY!=1)
  {
    // Wait for TXD data to be sent
  }

  NRF_UART0-&amp;gt;EVENTS_TXDRDY=0;
}

void simple_uart_putstring(const uint8_t *str)
{
  uint_fast8_t i = 0;
  uint8_t ch = str[i++];
  while (ch != &amp;#39;\0&amp;#39;)
  {
    simple_uart_put(ch);
    ch = str[i++];
  }
}

void simple_uart_config(  uint8_t rts_pin_number,
                          uint8_t txd_pin_number,
                          uint8_t cts_pin_number,
                          uint8_t rxd_pin_number,
                          bool    hwfc)
{
/** @snippet [Configure UART RX and TX pin] */
  nrf_gpio_cfg_output(txd_pin_number);
	nrf_gpio_pin_set(txd_pin_number);
  nrf_gpio_cfg_input(rxd_pin_number, NRF_GPIO_PIN_NOPULL);  

  NRF_UART0-&amp;gt;PSELTXD = txd_pin_number;
  NRF_UART0-&amp;gt;PSELRXD = rxd_pin_number;
/** @snippet [Configure UART RX and TX pin] */
  if (hwfc)
  {
    nrf_gpio_cfg_output(rts_pin_number);
    nrf_gpio_cfg_input(cts_pin_number, NRF_GPIO_PIN_NOPULL);
    NRF_UART0-&amp;gt;PSELCTS = cts_pin_number;
    NRF_UART0-&amp;gt;PSELRTS = rts_pin_number;
    NRF_UART0-&amp;gt;CONFIG  = (UART_CONFIG_HWFC_Enabled &amp;lt;&amp;lt; UART_CONFIG_HWFC_Pos);
  }

  NRF_UART0-&amp;gt;BAUDRATE         = (UART_BAUDRATE_BAUDRATE_Baud9600 &amp;lt;&amp;lt; UART_BAUDRATE_BAUDRATE_Pos);
  NRF_UART0-&amp;gt;ENABLE           = (UART_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; UART_ENABLE_ENABLE_Pos);
  NRF_UART0-&amp;gt;TASKS_STARTTX    = 1;
  NRF_UART0-&amp;gt;TASKS_STARTRX    = 1;
  NRF_UART0-&amp;gt;EVENTS_RXDRDY    = 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transfer data through UART</title><link>https://devzone.nordicsemi.com/thread/28927?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 14:16:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2e932da-795a-4315-9097-05be0e8f4eae</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;How are you handling your simple_uart_put and simple_uart_get? is the UART on smart beacon connected to something? start your application in debugger and i would suspect that your are either stuck in one of these two functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>