<?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>nRF51822 64 bitwise arithmetic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5797/nrf51822-64-bitwise-arithmetic</link><description>Hello.
I need to hold 64-bit timer value. I store the 32-bit hardware timer value in one variable (low DWORD) and use an additional uint32_t variable as a an upper part of 64-bit timer value (high DWORD). 
 So, I have a 64-bit unsigned integer stored</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 21 Mar 2015 20:43:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5797/nrf51822-64-bitwise-arithmetic" /><item><title>RE: nRF51822 64 bitwise arithmetic</title><link>https://devzone.nordicsemi.com/thread/20270?ContentTypeID=1</link><pubDate>Sat, 21 Mar 2015 20:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f943d173-6bb9-449e-a090-6a539dd656f3</guid><dc:creator>Alev</dc:creator><description>&lt;p&gt;Thank you for an answer. Sorry I cannot provide an example, because it&amp;#39;s a huge application with a lot of code. When I try to use a simple test program only with 64 bit arithmetic (without my app) - all looks correct. But when I use it inside my app - trouble comes.
I just want to know, that I am not missing something (in the datasheet or somewhere else) that state about NOT use a 64 bitwise. Now I know that it&amp;#39;s completely possible. One question for you - how you declare a unsigned 64-bit wise? unsigned long long, uint64_t, QWORD (I know that it is near the same, but want to know). Thank you again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 64 bitwise arithmetic</title><link>https://devzone.nordicsemi.com/thread/20271?ContentTypeID=1</link><pubDate>Sun, 01 Mar 2015 21:19:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9536ef34-f654-4634-867e-38323a890c89</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;Use &lt;code&gt;uint64_t&lt;/code&gt; after including &lt;code&gt;&amp;lt;inttypes.h&amp;gt;&lt;/code&gt;.  If you&amp;#39;re formatting it for output, use &lt;code&gt;%llu&lt;/code&gt; or &lt;code&gt;PRIu64&lt;/code&gt; or similar macros.  long long formatting is not available when using newlib nano.&lt;/p&gt;
&lt;p&gt;Be aware that getting an accurate 64-bit timer value taking into account overflow can be tricky, and some details differ depending on whether you&amp;#39;re reading from a HFCLK-synchronous TIMER or an LFCLK-synchronous RTC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 64 bitwise arithmetic</title><link>https://devzone.nordicsemi.com/thread/20268?ContentTypeID=1</link><pubDate>Sat, 28 Feb 2015 12:40:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee877b5-a044-4c9c-be9e-fa3e049a03c3</guid><dc:creator>Alev</dc:creator><description>&lt;p&gt;[UPDATE] Comment removed to the bottom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 64 bitwise arithmetic</title><link>https://devzone.nordicsemi.com/thread/20269?ContentTypeID=1</link><pubDate>Sat, 28 Feb 2015 11:25:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fc789aa-9e18-49c9-bcbc-0f9fef4642b1</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;I use 64 bit fixed point on a nrf51822 quite heavily and haven&amp;#39;t noticed any problems with gcc-arm-none-eabi-4_9-2014q4-20141203 from &lt;a href="https://launchpad.net/gcc-arm-embedded"&gt;launchpad.net/gcc-arm-embedded&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m mostly doing 32 * 32 multiplies with a 64 bit result and then &amp;gt;&amp;gt; the result right away. But looking at the compiler output it is using __aeabi_lmul() which is &amp;#39;long long&amp;#39; * &amp;#39;long long&amp;#39; -&amp;gt; &amp;#39;long long&amp;#39;.&lt;/p&gt;
&lt;p&gt;Can you provide a simple example that fails and I&amp;#39;ll try it in my setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>