<?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>nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13760/nrf51-dk-16-bit-spi-runtime-error</link><description>Hi guys I&amp;#39;m sending data from an nexys 4 fpga through an spi to my nRF51 (pca10028) I have the fpga set as the master and I&amp;#39;m able to read data sent to the nRF51 through my tera term when I have my spi.format set to (8,2)... but for some reason when I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Jul 2016 09:14:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13760/nrf51-dk-16-bit-spi-runtime-error" /><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52598?ContentTypeID=1</link><pubDate>Wed, 13 Jul 2016 09:14:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cc324bf-3d07-41be-987a-47c6cd575ebd</guid><dc:creator>ksrc</dc:creator><description>&lt;p&gt;Hi Martin, Sorry about this question being so late is there a way for me to basically let the ss run for 16 frames using interrupts to decide when it goes from high to low? I don&amp;#39;t need to send all 16 bits over bluetooth but i just need to figure out how to get the data onto the nrf and then afterwards i can figure out what bits i want to send via bluetooth.&lt;/p&gt;
&lt;p&gt;Thank you again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52597?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2016 10:30:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5119d280-f475-44da-88ab-4f163b8541ec</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Unfortunately not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52596?ContentTypeID=1</link><pubDate>Wed, 01 Jun 2016 09:54:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4ed67a1-411c-41f2-9360-bc06e8e923fc</guid><dc:creator>ksrc</dc:creator><description>&lt;p&gt;Thanks for the help again. I already looked but there are no Nordic modules that support 16 bit frames correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52595?ContentTypeID=1</link><pubDate>Tue, 31 May 2016 08:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c2f265-4fe8-4d24-a607-8f6614471ab1</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;As mentioned, I&amp;#39;m not very familiar with mbed, but if you look in &amp;quot;/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/&amp;quot; in the repository you linked to you will find spi_api.c. This file contains the function definitions that are actually being used. In the function spi_format() you will find the following check:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (bits != 8) {
    error(&amp;quot;Only 8bits SPI supported&amp;quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;prohibiting you from using any other bit widths than 8 bits.&lt;/p&gt;
&lt;p&gt;The SPI library in mbed tries to cover many MCUs, but not all MCUs have similar SPI capabilities. Some of them support various bit widths, but unfortunately nRF51 is one of those who don&amp;#39;t. I was not able to find this documented in the mbed drivers, but as you can see in the function definition in spi_format() you will get an error if you use something else than 8 bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52594?ContentTypeID=1</link><pubDate>Tue, 31 May 2016 07:13:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f57a0e87-d5ec-4b41-9bdc-904617baaab8</guid><dc:creator>ksrc</dc:creator><description>&lt;p&gt;Hi Martin, Thanks again for replying. I really appreciate your help. I also noticed that if I set it to bit widths smaller than 8 as well I get a run time error. Here&amp;#39;s &lt;a href="https://developer.mbed.org/users/mbed_official/code/mbed-src/"&gt;the driver I&amp;#39;m using&lt;/a&gt; I&amp;#39;m looking at the SPI.h line 83 and there&amp;#39;s a commented line saying 4-16 should work. I saw this at one point before which is the reason why I thought I shouldn&amp;#39;t have any problems.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52592?ContentTypeID=1</link><pubDate>Mon, 30 May 2016 09:20:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d69f094-7323-4da5-95b0-ae61aca0bf1b</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Do you have a link to the driver? Could it be that the nRF51 mbed SPI driver does not support 16-bits format? For example I found &lt;a href="https://github.com/ARMmbed/mbed-hal-nrf51822-mcu/blob/master/source/spi_api.c"&gt;this driver&lt;/a&gt; and it returns an error if you try to use any other bit widths than 8 bits.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52593?ContentTypeID=1</link><pubDate>Sun, 29 May 2016 11:28:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27e613e6-9796-4268-9c5b-f104c326d970</guid><dc:creator>ksrc</dc:creator><description>&lt;p&gt;Hi Martin , Thanks for the reply. I&amp;#39;m wondering when you mean the nRF51 only supports 8 bit you are talking about the Bluetooth? I should still be able to send 16bit frames to the board right? What I have coming from the FPGA is in 16 bit but I really only need to broadcast a certain portion of that 16 bits. This should be possible right? Sorry for the vague question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 dk 16 bit spi runtime error</title><link>https://devzone.nordicsemi.com/thread/52591?ContentTypeID=1</link><pubDate>Tue, 24 May 2016 13:50:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c73d806d-b5ec-45bc-b32b-386a7c2f828f</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi, sorry for the delayed response. I&amp;#39;m not familiar with the mbed SPI drivers, but are you trying to send 16-bit frames? The nRF51 only supports 8 bit.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>