<?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>UART Configuration on NRF52-DK(bare metal programming)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54522/uart-configuration-on-nrf52-dk-bare-metal-programming</link><description>Hi all, 
 I have tried to write a program for configuring and send a character data over UART,but the NRF52-DK not responding to the code,I successfully flash the code. 
 Please see the attached code, 
 #include &amp;lt;stdint.h&amp;gt; 
 #define GPIO_BASE 0x50000000</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Nov 2019 07:54:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54522/uart-configuration-on-nrf52-dk-bare-metal-programming" /><item><title>RE: UART Configuration on NRF52-DK(bare metal programming)</title><link>https://devzone.nordicsemi.com/thread/221223?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 07:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9bff1ba-94b7-485e-9dc4-1957a4f24e3e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The clock to the peripheral is always 16MHz, the baudrate is configurable through:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=4_2_0_49_9_11#register.BAUDRATE"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=4_2_0_49_9_11#register.BAUDRATE&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The 16MHz clock accuracy depend on the HFCLK source:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_2_3#register.HFCLKSTAT"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_2_3#register.HFCLKSTAT&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Configuration on NRF52-DK(bare metal programming)</title><link>https://devzone.nordicsemi.com/thread/221193?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 05:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9c8ec26-3f3e-4f51-ad1e-e5dca63cf36a</guid><dc:creator>Hari Elamadu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;how can I configure the clock for UART, I didn&amp;#39;t find any information related selection of clock for UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Configuration on NRF52-DK(bare metal programming)</title><link>https://devzone.nordicsemi.com/thread/220767?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2019 09:55:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f59146-f3cc-4d20-998e-79c49ef7d8d8</guid><dc:creator>Hari Elamadu</dc:creator><description>&lt;p&gt;I have tried the second method(without the driver) but it was not worked, the TASKS_STARTTX is it a register?&lt;/p&gt;
&lt;p&gt;I have implemented the below code please check is my understanding is correct?&lt;/p&gt;
&lt;p&gt;#define UART_BASE 0x40002000&lt;br /&gt;#define PSEL_RTS (*((uint32_t*)(UART_BASE + 0x508)))&lt;br /&gt;#define PSEL_TXD (*((uint32_t*)(UART_BASE + 0x50C)))&lt;br /&gt;#define PSEL_CTS (*((uint32_t*)(UART_BASE + 0x510)))&lt;br /&gt;#define PSEL_RXD (*((uint32_t*)(UART_BASE + 0x514)))&lt;br /&gt;#define RXD_BUFF (*((uint32_t*)(UART_BASE + 0x518)))&lt;br /&gt;#define TXD_BUFF (*((uint32_t*)(UART_BASE + 0x51C)))&lt;br /&gt;#define UART_ENABLE (*((uint32_t*)(UART_BASE + 0x500)))&lt;br /&gt;#define UART_CONFIG (*((uint32_t*)(UART_BASE + 0x56C)))&lt;br /&gt;#define UART_BAUD (*((uint32_t*)(UART_BASE + 0x524)))&lt;br /&gt;&lt;strong&gt;#define TASKS_STARTTX (*((uint32_t*)(UART_BASE + 0x008)))&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;#define EVENTS_TXDRDY (*((uint32_t*)(UART_BASE + 0x11C)&lt;/strong&gt;))&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; UART_ENABLE = 0x08;&amp;nbsp;&amp;nbsp;//enable UART_ENABLE&lt;br /&gt; EVENTS_TXDRDY &amp;amp;=~(0xFFFFFFFF);&amp;nbsp; &amp;nbsp;&lt;br /&gt; TASKS_STARTTX = 1;&lt;br /&gt; TXD_BUFF =&amp;#39;A&amp;#39;;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Configuration on NRF52-DK(bare metal programming)</title><link>https://devzone.nordicsemi.com/thread/220560?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2019 12:29:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5363decf-8fe1-4550-a43f-10f5419b2878</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Have you considered using the UART driver instead?&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_uart.html?cp=6_1_2_0_19"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_uart.html?cp=6_1_2_0_19&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to use the driver, then make sure that you use the STARTTX task to start transfers and clear TXDRY events as shown in the UART transmission figure:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=4_2_0_49_3#concept_xpv_ftw_sr"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uart.html?cp=4_2_0_49_3#concept_xpv_ftw_sr&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>