<?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>SPI Master high speed behavior, gapless transmission</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6139/spi-master-high-speed-behavior-gapless-transmission</link><description>Hi,
I have a few questions about the SPI master module. I&amp;#39;m using it for an application that basically needs to be gapless. After quite a bit of work, I&amp;#39;ve gotten it to work full speed at 4MHz with no gaps (outside of an ISR). However, I had to do a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Mar 2015 20:22:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6139/spi-master-high-speed-behavior-gapless-transmission" /><item><title>RE: SPI Master high speed behavior, gapless transmission</title><link>https://devzone.nordicsemi.com/thread/21499?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2015 20:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42519863-4074-4ea7-b4c1-8cf5514d9e2c</guid><dc:creator>Sam</dc:creator><description>&lt;p&gt;The 8MHz timings are holding across at least 20 words, but I&amp;#39;m not sure about production reliability (personally I think we&amp;#39;ll just stick to 4MHz if the ordering issue is safe) Someone from Nordic commented that 8MHz was &amp;quot;unusable,&amp;quot; was just wondering if this was still true for current versions of the chip:
&lt;a href="https://devzone.nordicsemi.com/question/12948/nrf51822-spi-clock-frequency/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master high speed behavior, gapless transmission</title><link>https://devzone.nordicsemi.com/thread/21498?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2015 20:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42193263-014a-4fdb-8737-df33037b3d3c</guid><dc:creator>Sam</dc:creator><description>&lt;p&gt;Yeah, got it to work gapless at 8MHz with some optimized assembler with some really sketchy stuff. Not enough clocks to actually clear the EVENT_READY flag...I just get the timings exactly right that it never over or underflows. Gotta double check some of the timings to confirm (it&amp;#39;s been a while since I&amp;#39;ve done a lot of ARM assembly, and I&amp;#39;m not as familiar with the M0 nuances). Goes without saying that if an interrupt happens, I&amp;#39;m in trouble. BTW it&amp;#39;s half duplex right now, which allows me to cheat a bit more and save an instruction. It&amp;#39;s not a standard SPI slave. I&amp;#39;ve got an older Saleae that runs at 24MHz, and it&amp;#39;s at max sample rate--it&amp;#39;s actually clear that it captures everything when you zoom in, but I think the 16MHz/24MHz clocks produce some jitter because they&amp;#39;re not multiples of each other.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI Master high speed behavior, gapless transmission</title><link>https://devzone.nordicsemi.com/thread/21497?ContentTypeID=1</link><pubDate>Fri, 20 Mar 2015 07:29:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6da4242-decb-4257-8697-2b11b3acfb0b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Order of RX and TX doesn&amp;#39;t matter. Do whichever first you wish to do first, once you get the EVENT_READY there&amp;#39;s a slot to write the TXD, that&amp;#39;s what you need. As long as you do clear the event and read RXD as well, you&amp;#39;re good - you won&amp;#39;t get another event until you do those things.&lt;/p&gt;
&lt;p&gt;8MHz is settable and is reliable if you could guarantee to feed the TX buffer at that speed. At 8MHz you have 16 CPU cycles per byte output, if you can guarantee in the worst case to read the event, get a byte, put it into TXD, clear the event, read RXD and increment your pointer all within 16 CPU cycles then 8MHz should work. With a really simple data buffer and some assembly I guess that&amp;#39;s possible, but only just. Newer chips won&amp;#39;t change that, not unless the processor frequency is increased. What would be better would be a DMA for SPI master, but there isn&amp;#39;t one, not yet.&lt;/p&gt;
&lt;p&gt;Where&amp;#39;s the requirement for gapless transmission coming from? Most (all?) SPI slaves I&amp;#39;ve so far come across are fine with gaps. You&amp;#39;ll have problems with gapless if you have anything else going on, an interrupt firing for a timer or particularly the softdevice which is going to interrupt you when it feels like it.&lt;/p&gt;
&lt;p&gt;Oh and if that&amp;#39;s a Saleae trace, try capturing at a higher sample rate, looks like you are missing occasional transitions. I can get my Saleae to capture 8MHz SPI bursts by running it at full sampling speed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>