<?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>Baud rate for SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53376/baud-rate-for-spi</link><description>Hi, 
 I have a question regarding the frequency of the SPI peripheral of the nrf52. 
 According to the Product Specification v1.4, the minimum value for the frequency is 125kbps, setting the register to 0x02000000 
 
 We have made a test with lower values</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Mar 2020 15:59:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53376/baud-rate-for-spi" /><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/240703?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 15:59:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6ba79fa-70de-4acf-a065-9b20cb94f970</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi Jev,&lt;/p&gt;
&lt;p&gt;thanks for the feedback.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/240702?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 15:57:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0477998a-f91b-442b-91e4-bca99e00d509</guid><dc:creator>jev</dc:creator><description>&lt;p&gt;Well, I ended up using SPIM at almost 9600 bps, coding 1 bit in a SPI byte transfer. The spec says +/- 10% timing is allowed and I&amp;#39;m 1.5% fast so no worries there. Needed to add an IDLE bit before the start of the transfer because SPI starts clocking rather late. Prolly some optimizations still possible.&lt;/p&gt;
&lt;p&gt;Receiving is quite a bit more complicated since that is asynchronous. For now, it seems to work.&lt;/p&gt;
&lt;p&gt;The one thing it won&amp;#39;t do is collision detection. O well...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/238678?ContentTypeID=1</link><pubDate>Sun, 08 Mar 2020 16:41:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:072635a4-04b6-451f-a325-b2cce00aad9f</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi jev,&lt;/p&gt;
&lt;p&gt;at the end it was possible to set lower speed than the ones reported in the manual (regarding the SPI peripheral), but note that there is a kind of approximation. I do not remember exactly the value of that (might be &lt;span&gt;rounded_value = (value + 0x800) &amp;amp; 0xFFFFF000&lt;/span&gt;), so the consequence was that in my case i could not reach the SPI baudrate i wanted (9600 bit/sec).&lt;/p&gt;
&lt;p&gt;So, as you said, I tried the SPI slave feeding the clock with another pin of the Nordic configured as GPIO controlled with a TIMER (PPI approach). In order to control the Chip Select of the SPI I used to activate the its pull-down.&lt;/p&gt;
&lt;p&gt;I did a couple of test and it seems to work properly. In our product we did not adopt the SPI slave then, so I did not perform further and thorough tests. But I hope this could help you to give a try.&lt;/p&gt;
&lt;p&gt;Let me know if it works :)&lt;/p&gt;
&lt;p&gt;Riccardo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/238669?ContentTypeID=1</link><pubDate>Sun, 08 Mar 2020 15:22:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c015f8d2-91ba-40c4-9f10-bdbaa98412c1</guid><dc:creator>jev</dc:creator><description>&lt;p&gt;Did you get this low speed clocking issue solved?&lt;br /&gt;&lt;br /&gt;I am trying to solve the same problem; was thinking to use SPIS instead of SPIM. SCK could be fed&amp;nbsp;from a timer (possibly externally connected), which is costing me 2 extra pins. Don&amp;#39;t know how that&amp;#39;ll work for input though since we would need the clock to start from GPIO or continuously monitor if there&amp;#39;s any data coming in from SPI.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If that won&amp;#39;t work I&amp;#39;ll just have to go with a PPI based GPIO / timer solution where a pin change triggers a timer value to be written into memory. Bit extra software required, should work for input but not for output. I don&amp;#39;t think it&amp;#39;s possible to drive GPIO from DMA, so I needed to come up with another clever solution there.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215672?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 10:53:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6acc8019-e234-47f5-96b3-b52fe8f1e4c2</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;ok, thanks again for the support.&lt;/p&gt;
&lt;p&gt;KR&lt;/p&gt;
&lt;p&gt;riccardo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215661?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 08:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dbf5909-0de3-4881-ab58-aad91b3d896e</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;SPI and TWI share address space and some registers, but they&amp;#39;re different peripherals. I don&amp;#39;t know the internals, one can suppose that they&amp;#39;re clocked from different PCLK sources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215652?ContentTypeID=1</link><pubDate>Fri, 18 Oct 2019 08:20:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa48fb40-4e73-4d29-9bcd-0a16ac72e232</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;Once more thing.&lt;/p&gt;
&lt;p&gt;I noticed that the Frequency register of the SPI is shared with TWI (I2C) one. But the values reported in the&amp;nbsp;&lt;span&gt;Product Specification v1.4 (see the image below) are different from the ones I obtained from the formula in the &lt;a title="Baudrate formula" href="https://devzone.nordicsemi.com/f/nordic-q-a/391/uart-baudrate-register-values#post-id-1194" rel="noopener noreferrer" target="_blank"&gt;post&lt;/a&gt;. Are they computed with a different formula or am I doing something wrong ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1571386398358v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Values obtained through the formula in the &lt;a title="Baudrate formula" href="https://devzone.nordicsemi.com/f/nordic-q-a/391/uart-baudrate-register-values#post-id-1194" rel="noopener noreferrer" target="_blank"&gt;post&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1571386721808v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you kindly give your feedback on those values please ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks in advance !&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;KR&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Riccardo&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215611?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 21:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf8dde8-0cbb-4eba-9035-d7fc368d9bb9</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;Ok. Actually my goal it would be to use the spi peripheral at 2400 bps to implement a driver for the DALI protocol. So, if there are no official restrictions about lower baudarate, I might give a try.&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;
&lt;p&gt;Kind Regards&lt;/p&gt;
&lt;p&gt;Riccardo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215610?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 21:03:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:110853cf-7afa-4e03-8c22-39c519958221</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;I didn&amp;#39;t find it in official documents.. just can say that I used it to turn SPI interface into a simple tx-only UART, and it worked at 115200.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215609?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 20:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecb0e96c-03aa-4f66-b62c-82192b450360</guid><dc:creator>Riccardo78</dc:creator><description>&lt;p&gt;Hi Dmitry,&lt;/p&gt;
&lt;p&gt;Thansk so much for the prompt reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is the formula described in the post also available in some official documents ?&lt;/p&gt;
&lt;p&gt;Is there any problem/issue if we use a peripheral with a lower baudarate ?&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Baud rate for SPI</title><link>https://devzone.nordicsemi.com/thread/215605?ContentTypeID=1</link><pubDate>Thu, 17 Oct 2019 19:28:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:573686a6-b9a5-4a61-a3fa-1ef13dba8e2f</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi Riccardo,&lt;/p&gt;
&lt;p&gt;you can find the formula in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/391/uart-baudrate-register-values#post-id-1194"&gt;this&lt;/a&gt;&amp;nbsp;thread, it&amp;#39;s the same for SPI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>