<?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 20 bits at once over SPI using nRF5 SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30692/how-to-transmit-20-bits-at-once-over-spi-using-nrf5-sdk</link><description>Hello, 
 I have found similar questions on transmitting multiple bytes over SPI, but I am still not sure how to do it. I want to communicate with a driver which needs to be configured by writing 20 bits at a time to the chip. One write value could fx</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Feb 2018 05:21:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30692/how-to-transmit-20-bits-at-once-over-spi-using-nrf5-sdk" /><item><title>RE: How to transmit 20 bits at once over SPI using nRF5 SDK</title><link>https://devzone.nordicsemi.com/thread/121610?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 05:21:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b74e3aa4-3368-4608-9862-1abe0d2507e3</guid><dc:creator>karthikeyan</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; yes this will work. but this will not represent 20 bit. it will be 24 bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit 20 bits at once over SPI using nRF5 SDK</title><link>https://devzone.nordicsemi.com/thread/121463?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 06:24:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c2a4e84-0d45-47fb-9773-79e0e1a6287a</guid><dc:creator>Jan Lundskov</dc:creator><description>&lt;p&gt;Thanks for your reply.&amp;nbsp;So will it be possible to&amp;nbsp;do it in this way?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;static uint8_t m_tx_buf[3]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;m_tx_buf[] = {0xD0, 0x50, 0x05};&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to transmit 20 bits at once over SPI using nRF5 SDK</title><link>https://devzone.nordicsemi.com/thread/121435?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 17:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f50a2174-0965-4832-8d10-c8d71cc90503</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;m_tx_buf[0] =  0xD0505;   // 20 bit value to be transmitted
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This code tries to put 20 bits into a variable that holds just 8. Please read some basic literature about the &amp;quot;C&amp;quot; programming language, this 40+ year old beast is not self-explanatory at all. Oh, you also want to turn on compiler warnings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>