<?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 transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33695/how-to-transmit-ten-numbers-using-uart-suggest-me-with-code</link><description>I am using nRF52832 pca10040 developement board. As I am begineer I dont know much about coding. I am using Eclipse IDE for developement. I want to transmit 1-10 numbers using UART communication. When data sent equal to data received then blink LED if</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Apr 2018 08:58:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33695/how-to-transmit-ten-numbers-using-uart-suggest-me-with-code" /><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129500?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 08:58:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd3b052b-38ed-47bc-a7ef-023280cbfcee</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Kiran,&lt;/p&gt;
&lt;p&gt;Please use the examples, test them out and see how they work. Use them as reference for you application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If something is not working you can&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32806/setting-debug-flag-in-eclipse" target="_blank" rel="noopener noreferrer"&gt;debug&amp;nbsp;y&lt;/a&gt;our application.&lt;/p&gt;
&lt;p&gt;There are several threads about similar projects on Devzone so please utilize the resources.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Good luck with your project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129475?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 07:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3df4f83f-8bce-4e53-afc6-b3e750e599ba</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;I just want to send 0-9 numbers and receive them successfully using UART communication.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129473?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 07:36:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:255b5fc1-6915-4aa2-a127-2bbfe496aea4</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;This is my code, Please do look and suggest me why it is not working. Tomorrow is the deadline to submit this project. Please rectify code and resend me. Take out your valuable time for me.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;quot;app_uart.h&amp;quot;&lt;br /&gt;#include &amp;quot;app_error.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf_delay.h&amp;quot;&lt;br /&gt;#include &amp;quot;nrf.h&amp;quot;&lt;br /&gt;#include &amp;quot;bsp.h&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;#define MAX_TEST_DATA_BYTES (15U)&lt;br /&gt;#define UART_TX_BUF_SIZE 256&lt;br /&gt;#define UART_RX_BUF_SIZE 256&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;// UART error handler function.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;void uart_error_handle(app_uart_evt_t * p_event)&lt;br /&gt;{&lt;br /&gt; if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)&lt;br /&gt; {&lt;br /&gt; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);&lt;br /&gt; }&lt;br /&gt; else if (p_event-&amp;gt;evt_type == APP_UART_FIFO_ERROR)&lt;br /&gt; {&lt;br /&gt; APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;// LED glow function: When data Transmitted is equal to data Received then LED glow up else stays off.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;void led_blink()&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;bsp_board_leds_init();&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; while (true)&lt;br /&gt; {&lt;br /&gt; for (int i = 0; i &amp;lt; 1; i++)&lt;br /&gt; {&lt;br /&gt; bsp_board_led_invert(i);&lt;br /&gt; nrf_delay_ms(500);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;// UART transmit function.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; #if ((Enable_UART_TxDecimalNumber==1) || (Enable_UART_TxFloatNumber==1))&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;void UART_Tx(uint32_t dec_no, uint8_t nod)&lt;br /&gt;{&lt;br /&gt; uint8_t i=0;&lt;/p&gt;
&lt;p&gt;printf(&amp;quot;\nEnter decimal no to transmit:&amp;quot;);&lt;br /&gt; scanf(&amp;quot;\n%d&amp;quot;, &amp;amp;dec_no);&lt;/p&gt;
&lt;p&gt;if(dec_no==0) //decimal number to transmit&lt;br /&gt; {&lt;br /&gt; for(i=0; ((i&amp;lt;nod) &amp;amp;&amp;amp; (i&amp;lt;max_dttx)); i++) //number of digits to transmit&lt;br /&gt; a[i] = 0x00; //maximum number of digits to transmit&lt;br /&gt; }&lt;br /&gt; else if&lt;br /&gt; {&lt;br /&gt; for(i=0; i&amp;lt;nod; i++)&lt;br /&gt; {&lt;br /&gt; if(dec_no!=0)&lt;br /&gt; {&lt;br /&gt; a[i] = util_GetMod32(dec_no,10);&lt;br /&gt; dec_no = dec_no/10;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; else if( (nod == dttx) || (nod &amp;gt; max_dttx)) //total numbers to transmit&lt;br /&gt; {&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; a[i]=0;&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;while(i)&lt;br /&gt; {&lt;br /&gt; UART_TxChar(util_Dec2Ascii(a[i-1])); //Convert decimal to ASCII&lt;br /&gt; i--;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;void led_blink();&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;#endif&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;// main Function.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;bsp_board_leds_init();&lt;/p&gt;
&lt;p&gt;const app_uart_comm_params_t comm_params =&lt;br /&gt; {&lt;br /&gt; RX_PIN_NUMBER,&lt;br /&gt; TX_PIN_NUMBER,&lt;br /&gt; RTS_PIN_NUMBER,&lt;br /&gt; CTS_PIN_NUMBER,&lt;br /&gt; APP_UART_FLOW_CONTROL_ENABLED,&lt;br /&gt; false,&lt;br /&gt; UART_BAUDRATE_BAUDRATE_Baud19200&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;APP_UART_FIFO_INIT(&amp;amp;comm_params,&lt;br /&gt; UART_RX_BUF_SIZE,&lt;br /&gt; UART_TX_BUF_SIZE,&lt;br /&gt; uart_error_handle,&lt;br /&gt; APP_IRQ_PRIORITY_LOWEST,&lt;br /&gt; err_code);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; UART_Tx();&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;return 0;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129469?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 07:27:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ab54090-e990-4cca-9dd4-e4b3467f3521</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;That is helpful. I will try it out.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129457?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 06:58:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1250e8ab-2f45-4570-bb34-0d6c654bd0c4</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;That&amp;#39;s no problem. The only different from my last post will be to check the &amp;quot;armgcc&amp;quot; folder and not the &amp;quot;ses&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;i.e&lt;/strong&gt;. [&amp;lt;your_sdk&amp;gt;&lt;em&gt;\examples\peripheral\blinky\pca10040\blank\armgcc&lt;/em&gt;]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129455?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 06:57:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e6d6e74-6dd1-4cc1-b802-7b754a4af52b</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;So do you have any recommandation? How I can utilise my resources efficiently.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129453?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 06:54:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40f46d00-5da6-4913-9751-859dceadfac5</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;But my concern is I work in small firm where I must use Eclipse IDE and SDKv14.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I do not have choice for other IDE.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129452?ContentTypeID=1</link><pubDate>Tue, 24 Apr 2018 06:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f74625c7-73cd-4073-ade6-300101a23eee</guid><dc:creator>kiran90</dc:creator><description>&lt;p&gt;Thanks Martin. I appericate for the answer. It is useful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit ten numbers using UART? Suggest me with code.</title><link>https://devzone.nordicsemi.com/thread/129368?ContentTypeID=1</link><pubDate>Mon, 23 Apr 2018 13:50:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae69c04-0abe-42dc-ab14-f2f3bc42483a</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Kiran,&lt;/p&gt;
&lt;p&gt;I recommend you to check out the links suggested in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30338/getting-started-for-beginners" target="_blank" rel="noopener noreferrer"&gt;thread&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I would recommend you to use SES IDE since we provide a free licence and we also have a nice &lt;a href="https://www.youtube.com/watch?v=YZouRE_Ol8g&amp;amp;list=PLx_tBuQ_KSqGHmzdEL2GWEOeix-S5rgTV" target="_blank" rel="noopener noreferrer"&gt;tutorial playlist on how to use it.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To accomplish your project you can download the &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/" target="_blank" rel="noopener noreferrer"&gt;SDK v15&lt;/a&gt;&amp;nbsp;and use the UART example found in [&amp;lt;your_sdk&amp;gt;&lt;em&gt;\examples\peripheral\uart\pca10040\blank\ses&lt;/em&gt;] as reference, and combine it with the Blinky example found in [&lt;em&gt;&amp;lt;your_sdk&amp;gt;\examples\peripheral\blinky\pca10040\blank\ses&lt;/em&gt;].&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>