<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>High Throughput SPI traffic part 1b - SPI without Buffers</title><link>/members-area/personalblogs/b/blog/posts/high-throughput-spi-traffic-part-1b---spi-without-buffers</link><description>We know SPI as a 4*-wire protocol. But it doesn&amp;#39;t have to be.I&amp;#39;m checking high speed SPI data transfer with buffers, DMA and parallel data lines. Let&amp;#39;s analyse what the SPI cost is of my naive implementation, where I paint pixel by pixel.&amp;amp;...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: High Throughput SPI traffic part 1b - SPI without Buffers</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/high-throughput-spi-traffic-part-1b---spi-without-buffers</link><pubDate>Thu, 19 May 2016 21:02:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:61886904-1c65-45fd-a975-bd1aebdabf9e</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a class="jive-link-external-small" href="https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/515004" rel="nofollow ugc noopener" target="_blank"&gt;Issue&lt;/a&gt; resolved in less than an hour.&lt;/p&gt;&lt;p&gt;It was pebkac. Datasheet says that we can have 128 values in our buffer.&lt;/p&gt;&lt;p&gt;I was trying to send 128 at a time and that failed.&lt;/p&gt;&lt;p&gt;The reason for this:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/1153x675/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-61886904-1c65-45fd-a975-bd1aebdabf9e/contentimage_5F00_189145.png:1153:675]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;I&amp;#39;m using 3 transfer groups.&lt;/p&gt;&lt;p&gt;1 to send single 8-bit values (for LCD commands)&lt;/p&gt;&lt;p&gt;1 to send single 16-bit values (for single pixel drawing)&lt;/p&gt;&lt;p&gt;1 to send buffered 16-bit values (for multiple pixels at the same time)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I didn&amp;#39;t get that the buffer is shared between the groups. So I can&amp;#39;t use all 128 buffer positions in group2, because 2 of the 128 available buffer positions were already taken in group0 and group1.&lt;/p&gt;&lt;p&gt;I restructured my code to reduce the buffer size, and all works (FAST &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-61886904-1c65-45fd-a975-bd1aebdabf9e/1780.contentimage_5F00_1.png:16:16]&lt;/span&gt; ).&lt;/p&gt;&lt;p&gt;I&amp;#39;ll prepare a blog tomorrow.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21678&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: High Throughput SPI traffic part 1b - SPI without Buffers</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/high-throughput-spi-traffic-part-1b---spi-without-buffers</link><pubDate>Thu, 19 May 2016 19:21:42 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:61886904-1c65-45fd-a975-bd1aebdabf9e</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I was hoping that the next step would be easy: switching to buffered SPI.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve used it before for small buffers.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m now trying to develop a design that buffers a full line of 128 16 bit values.&lt;/p&gt;&lt;p&gt;It doesn&amp;#39;t work as expected (unless - as shown above - I hack registers at debug time) , so I&amp;#39;ll have to spend some more time learning Hercules buffered SPI.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ll first try to replicate a test bed I made a year ago that works with 64 16-bit values.&lt;/p&gt;&lt;p&gt;That&amp;#39;s the consequence of working with the Hercules ARM family. Extremely powerful and safe; Equally extremely complex to work with. The good side of that is that when it works, you are a subject expert forever &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-61886904-1c65-45fd-a975-bd1aebdabf9e/contentimage_5F00_1.png:16:16]&lt;/span&gt; .&lt;/p&gt;&lt;p&gt;Hang on...&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21678&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: High Throughput SPI traffic part 1b - SPI without Buffers</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/high-throughput-spi-traffic-part-1b---spi-without-buffers</link><pubDate>Tue, 17 May 2016 22:51:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:61886904-1c65-45fd-a975-bd1aebdabf9e</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Sneak preview:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This isn&amp;#39;t a full functioning implementation yet, but by tweaking some SPI registers in debug mode, I managed to push 128 16-bit values in one go:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/881x145/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-61886904-1c65-45fd-a975-bd1aebdabf9e/contentimage_5F00_189144.png:881:145]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;82 µs for a full line. Compared to non-buffered mode where it took 360 µs, we have between 4-5 times faster throughput.&lt;/p&gt;&lt;p&gt;This is a prediction of what the non-DMA buffered mode will give us at 27.5 Mbit/sec, wih a single data line.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;My calculator says that 16 bits * 128 = 2048 bits.&lt;/p&gt;&lt;p&gt;It took me 82 µs to move them.&lt;/p&gt;&lt;p&gt;2048 / 0.000082 = 24975609.75609756.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The theoretical speed was 27.5 megabits.&lt;/p&gt;&lt;p&gt;I moved 24.975610 megabits&lt;/p&gt;&lt;p&gt;Efficiency: &lt;strong&gt;90.82%&lt;/strong&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21678&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: High Throughput SPI traffic part 1b - SPI without Buffers</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/high-throughput-spi-traffic-part-1b---spi-without-buffers</link><pubDate>Tue, 17 May 2016 18:33:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:61886904-1c65-45fd-a975-bd1aebdabf9e</guid><dc:creator>DAB</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Nice blog.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I like how you showed how to use some simple techniques to save time during the write cycle.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Back in the early days, 1970&amp;#39;s, we were always coming up with time saving techniques due to the very slow cycle time, &amp;gt;1 microsecond per instruction,&amp;nbsp; for the computers we had then.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Doing complex graphis, just 100 by 100 bits took a lot of time to read from disk and send to the output buffers.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;We seldom ran at full resolution, 400 by 400, due to the time it took to display the image.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;So your experience with SPI brings back a lot of memories for me as we waited for the technology to improve.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21678&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>