<?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>hex data on UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112372/hex-data-on-uart</link><description>I want to know is there a way to send hex data via UART. I tried multiple methods but they don&amp;#39;t seem to work. 
 
 Thanks in advance</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Jun 2024 10:30:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112372/hex-data-on-uart" /><item><title>RE: hex data on UART</title><link>https://devzone.nordicsemi.com/thread/490221?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2024 10:30:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d451659e-6cbf-47dd-a10d-7b3690442a0e</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Harsh,&lt;/p&gt;
&lt;p&gt;Whenever we send&amp;nbsp;or receive data, it is in the pattern of binary numbers. I guess you are talking about displaying that data in hexadecimal format.&lt;/p&gt;
&lt;p&gt;Have you tried data formatting in C, for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int num = 30;
printf(&amp;quot;\nnum in decimal = %d&amp;quot;, num);
printf(&amp;quot;\nnum in hexa-decimal = 0x%x&amp;quot;, num);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;which would display the same data as below:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;num in decimal      = 30
num in hexa-decimal = 0x1e&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Otherwise show your code snippet and elaborate your question.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>