<?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>Read 18bits from SPI?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15557/read-18bits-from-spi</link><description>Hi, 
 I&amp;#39;m using PCA10028 to communicate with ADS1131 ( www.ti.com/.../ADS1131) which outputs 18bit on SPI bus. I managed to get the data out by reading 24bits, but it feels odd doing it this way. Also the SPI example works out the amount of data to be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Aug 2016 13:45:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15557/read-18bits-from-spi" /><item><title>RE: Read 18bits from SPI?</title><link>https://devzone.nordicsemi.com/thread/59387?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 13:45:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e936b5c6-afa9-4f21-9797-921d5dbf931f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Because (by definition) the master always generates the clock, the number of bits sent by the master (on MOSI) always has to be the same as the number of bits received (on MISO).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 18bits from SPI?</title><link>https://devzone.nordicsemi.com/thread/59386?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 13:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af48cf4c-07a4-440d-bfe5-6b6792b285a1</guid><dc:creator>bx</dc:creator><description>&lt;p&gt;awneil is right, SPI does not necessarily work with bytes, and the specific ADC I am interfacing outputs 18bit, period.
Is there any other way to define the amount of data to be rx, other than setting tx string of specific lenght?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 18bits from SPI?</title><link>https://devzone.nordicsemi.com/thread/59388?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 11:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d22bca71-c898-4d3c-a5b5-01f80785979b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Err - the thing with SPI (unlike I2C, say) is that there is &lt;strong&gt;&lt;em&gt;no&lt;/em&gt;&lt;/strong&gt; standard for this stuff!&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;only&lt;/strong&gt; thing that SPI defines is the 4 wires - it says absolutely &lt;strong&gt;&lt;em&gt;nothing&lt;/em&gt;&lt;/strong&gt; about numbers of bits or anything else to do with higher-level protocols.&lt;/p&gt;
&lt;p&gt;So the question is actually about the specific peripheral implementation in the particular chip (nRF51422) - and has nothing to do with SPI itself.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus"&gt;en.wikipedia.org/.../Serial_Peripheral_Interface_Bus&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 18bits from SPI?</title><link>https://devzone.nordicsemi.com/thread/59385?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 11:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:174177cf-959d-4c3b-9602-0e735aff7fbf</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;SPI normally uses entire bytes, so it makes sense to receive 8, 16 24, 32 bits etc in each section.&lt;/p&gt;
&lt;p&gt;If everything is working for you I think it&amp;#39;s better to follow the standard and focus on keeping your code well commented for easy review.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>