<?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>Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55810/low-level-uart-using-the-registers</link><description>Hi, 
 I am trying to write my own uart init and irq handler routines by accessing the registers directly as per the data sheet. I also referred to https://devzone.nordicsemi.com/f/nordic-q-a/48107/low-level-uart-and-timer-drivers this query on devzone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Dec 2019 02:30:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55810/low-level-uart-using-the-registers" /><item><title>RE: Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/thread/226459?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 02:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4212664b-a9c0-48bf-8968-c719189c58e7</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Here is a simple low-level function for Tx&amp;nbsp;&lt;a href="https://github.com/andenore/NordicSnippets/blob/master/examples/uart/main.c"&gt;uart/main.c&lt;/a&gt;. Rx is always more involved, unless you accept simple character-by-character reception. I don&amp;#39;t have an example to hand&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/thread/226392?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2019 13:50:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93dcdd35-9695-4dba-996a-114c270a358a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you considered using the&amp;nbsp;&lt;a title="UART" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_uart.html?cp=7_1_2_0_19"&gt;UART&lt;/a&gt;&amp;nbsp;driver instead? It should be a lot easier to set-up, so that&amp;nbsp;is what I would recommend.&lt;/p&gt;
[quote user="PoojaK"]But I dont know how am I supposed to send data bytes on TXD line.[/quote]
&lt;p&gt;&amp;nbsp;You need to set up a RAM buffer with the TX data you want to send, then load the pointer to that buffer into .TXD.PTR and the buffer size into TXD.AMOUNT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/thread/226316?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2019 09:52:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93c9a943-5310-4e90-b56d-48e203a7640b</guid><dc:creator>PoojaK</dc:creator><description>&lt;p&gt;It is compiling without any errors now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But now I am not getting how to transmit my data using TXD and receive using RXD . Because the data sheet only specifies .PTR .MAXCOUNT and .AMOUNT&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where do I write my actual data to be transmitted and received.&lt;/p&gt;
&lt;p&gt;The data sheet says:&lt;/p&gt;
&lt;p&gt;The first step of a DMA transmission is storing bytes in the transmit buffer and configuring EasyDMA. This&lt;br /&gt;is achieved by writing the initial address pointer to TXD.PTR, and the number of bytes in the RAM buffer to&lt;br /&gt;TXD.MAXCNT. The UARTE transmission is started by triggering the STARTTX task.&lt;br /&gt;&amp;quot;After each byte has been sent over the TXD line, a TXDRDY event will be generated.&amp;quot;&lt;br /&gt;When all bytes in the TXD buffer, as specified in the TXD.MAXCNT register, have been transmitted, the&lt;br /&gt;UARTE transmission will end automatically and an ENDTX event will be generated.&lt;br /&gt;A UARTE transmission sequence is stopped by triggering the STOPTX task, a TXSTOPPED event will be&lt;br /&gt;generated when the UARTE transmitter has stopped.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But I dont know how am I supposed to send data bytes on TXD line.&lt;/p&gt;
&lt;p&gt;There is no register that will do NRF_UARTE0-&amp;gt;TXD = 0xAA (or any other data that I want to transmit)&lt;/p&gt;
&lt;p&gt;Please help me out with this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/thread/226300?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2019 09:02:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e01d7f67-872b-40d4-aa45-4c765ea12527</guid><dc:creator>PoojaK</dc:creator><description>&lt;p&gt;Okay Great! Now I am not getting any errors for my irq.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now I will try my own code.&lt;/p&gt;
&lt;p&gt;Thanks a Lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low level UART using the Registers</title><link>https://devzone.nordicsemi.com/thread/226247?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2019 03:09:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1daeb5f-198d-4f7b-89b8-5ad04b1d285c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Try simply disabling all the library uart code; search for &amp;quot;&lt;em&gt;_ENABLED 1&lt;/em&gt;&amp;quot; and check all the hits in sdk_config.h; then change them all to &amp;#39;0&amp;#39;. Some examples&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define UART_ENABLED 1
#define UART_0_ENABLED 1
#define NRFX_UART_ENABLED 1
#define NRFX_UARTE_ENABLED 1

change to

#define UART_ENABLED 0
#define UART_0_ENABLED 0
#define NRFX_UART_ENABLED 0
#define NRFX_UARTE_ENABLED 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There are a lot, depending on where the file came from; there are also multiple instances in some files. The goal is then to use the handler defined as weak so it will be eclipsed by your handler&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void UARTE0_UART0_IRQHandler(void)
{
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The nrf and nrfx uart files can also be removed from the build as they will no longer be used&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>