<?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>Is there any UART examples by directly accessing the registers?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48893/is-there-any-uart-examples-by-directly-accessing-the-registers</link><description>Is there any UART examples by directly accessing the registers? 
 Based on SDK15.0.2, for NRF52832 or NRF52810, higher freedom, higher memory utilization.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jun 2019 12:36:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48893/is-there-any-uart-examples-by-directly-accessing-the-registers" /><item><title>RE: Is there any UART examples by directly accessing the registers?</title><link>https://devzone.nordicsemi.com/thread/194649?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 12:36:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c816dfac-6bbd-4b69-9e6c-577744a3371b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The sample codes shows only how to transmit. I suggest that you read the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uarte.html?cp=3_0_0_5_33_2#concept_uzb_p2m_wr"&gt;UARTE Receive chapter&lt;/a&gt; to understand how you should implement the reception.&lt;/p&gt;
&lt;p&gt;regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any UART examples by directly accessing the registers?</title><link>https://devzone.nordicsemi.com/thread/194483?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 01:19:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13d5375b-ad6b-4d17-9da3-aab6ce87e287</guid><dc:creator>Hansome</dc:creator><description>&lt;p&gt;Thanks! But where is the receiving interrupt?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any UART examples by directly accessing the registers?</title><link>https://devzone.nordicsemi.com/thread/194298?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2019 10:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:906f6b90-99f0-4e52-8ef4-c145aaf898b0</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There isn&amp;#39;t one available&amp;nbsp; in the SDK for UART but here is one for&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uarte.html?cp=3_0_0_5_33"&gt;UARTE &lt;/a&gt;for nRF52840:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;nrf.h&amp;gt;

#define PIN_TXD        (6)
#define PIN_RXD        (8)

int main(void)
{
  uint8_t hello_world[] = &amp;quot;Hello World!\n&amp;quot;;
  
  // Configure the UARTE with no flow control, one parity bit and 115200 baud rate
  NRF_UARTE0-&amp;gt;CONFIG = (UART_CONFIG_HWFC_Disabled   &amp;lt;&amp;lt; UART_CONFIG_HWFC_Pos) |
                       (UART_CONFIG_PARITY_Included &amp;lt;&amp;lt; UART_CONFIG_PARITY_Pos); 
  
  NRF_UARTE0-&amp;gt;BAUDRATE = UARTE_BAUDRATE_BAUDRATE_Baud115200 &amp;lt;&amp;lt; UARTE_BAUDRATE_BAUDRATE_Pos;
  
  // Select TX and RX pins
  NRF_UARTE0-&amp;gt;PSEL.TXD = PIN_TXD;
  NRF_UARTE0-&amp;gt;PSEL.RXD = PIN_RXD;
  
  // Enable the UART (starts using the TX/RX pins)
  NRF_UARTE0-&amp;gt;ENABLE = UARTE_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; UARTE_ENABLE_ENABLE_Pos;
  
  // Configure transmit buffer and start the transfer
  NRF_UARTE0-&amp;gt;TXD.MAXCNT = sizeof(hello_world);
  NRF_UARTE0-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;hello_world[0];
  NRF_UARTE0-&amp;gt;TASKS_STARTTX = 1;
  
  // Wait until the transfer is complete
  while (NRF_UARTE0-&amp;gt;EVENTS_ENDTX == 0)
  {
  }
  
  // Stop the UART TX
  NRF_UARTE0-&amp;gt;TASKS_STOPTX = 1;
  // Wait until we receive the stopped event
  while (NRF_UARTE0-&amp;gt;EVENTS_TXSTOPPED == 0);
  
  // Disable the UARTE (pins are now available for other use)
  NRF_UARTE0-&amp;gt;ENABLE = UARTE_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; UARTE_ENABLE_ENABLE_Pos;
  
  while (1)
  {
    __WFE();
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>