<?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>nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20612/nrf52-ppi-easydma-using-timer-and-spi</link><description>Hi, 
 I am using nrf52832 for my application. The application share same SPI module for two sensors(with sensors are selected using two chip select pins). Is it possible to implement PPI channel between a timer and this SPI module so that I can collect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Mar 2017 11:44:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20612/nrf52-ppi-easydma-using-timer-and-spi" /><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80344?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 11:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:088969c2-7d1f-4fd3-8233-646b89cafb9c</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Ok, i understand now - you want to just set different data buffer and different length so no interrupt will be needed. I don&amp;#39;t think that would work correcty, but that is worth checking.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80343?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 11:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c65dc441-587d-41ef-af46-6c28b5a76fa3</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Same pins and different modules. Suppose if I use pins 2,3,4 as MOSI,MISO and CLK. Can I assign the same pin for SPI0 and SPI1?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80342?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4072ceb4-87e4-406f-9904-5ee4dda6630d</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Ah, so different pins and modules, but same PPI? Yes, it is possible. Fork register can be used for that&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_PPI-&amp;gt;CH[PPI_CHANNEL].EEP = NRF_TIMER3-&amp;gt;EVENTS_COMPARE[0];
NRF_PPI-&amp;gt;CH[PPI_CHANNEL].TEP = NRF_SPIM0-&amp;gt;TASKS_START;
NRF_PPI-&amp;gt;CH[PPI_CHANNEL].FORK = NRF_SPIM1-&amp;gt;TASKS_START;
NRF_PPI-&amp;gt;CHENSET = (1 &amp;lt;&amp;lt; PPI_CHANNEL);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80346?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:34:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04f64c97-0da6-47b5-84d1-4066fe774636</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;I thought I would initiate SPI transfer for both the modules using same Timer compare event by connecting both the SPI tx task to the timer event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80341?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:15:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc1737e2-41b2-4c83-9996-2145e7498dae</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I don&amp;#39;t think so, but why would you want to do that...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80340?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 09:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb6210f5-b889-4f3c-9229-7ca9a5afe9cb</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Hi, Is it possible to assign the same SPI pins for two SPI modules of nrf?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80339?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 08:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7038d902-01bb-4129-9660-e917a2376662</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I don&amp;#39;t have access to any IDE right now, but it will be something like this (may not be 100% correct):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_PPI-&amp;gt;CH[PPI_CHANNEL].EEP = NRF_TIMER3-&amp;gt;EVENTS_COMPARE[0];
NRF_PPI-&amp;gt;CH[PPI_CHANNEL].TEP = NRF_SPIM0-&amp;gt;TASKS_START;
NRF_PPI-&amp;gt;CHENSET = (1 &amp;lt;&amp;lt; PPI_CHANNEL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, when TIMER3 CC0 event occurs, SPIM0 START task will be triggered. You have to configure SPIM0 before that ofc.
You may want to use PPI driver from Nordic SDK, but I don&amp;#39;t like it very much myself - but You know what to set now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80345?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 04:26:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af71b068-df14-4f32-8dc6-9ca75be097b7</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Thanks for the detailed explanation. Now I understand the difficulty. Still couldn&amp;#39;t get complete hold on PPI. I am trying to do a simple PPI between timer and SPI now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80338?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 12:33:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb1be73d-1ffa-479f-a8ea-1cb13868e472</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Ok, I&amp;#39;ll try to exaplain it differently:&lt;/p&gt;
&lt;p&gt;EasyDma gives You possibility to transfer data, ex. 20 bytes without using interrupts between them. You just start transmission, and it goes 20bytes.&lt;/p&gt;
&lt;p&gt;PPI can be used to ex. set hardware timer, it triggers PPI periodically, PPI triggers SPI START task.&lt;/p&gt;
&lt;p&gt;When SPI START is triggered, 20bytes (MAXCNT) are transmitted (thanks to EasyDMA) without using interrupts.&lt;/p&gt;
&lt;p&gt;The problem is, you want something like: SPI start -&amp;gt; transmit 75 bytes -&amp;gt; toggle pins etc -&amp;gt; transmit 5 bytes. It is not possible to change from  75 to 5 bytes without CPU intervention (ppis can only trigger transmission starts, toggling pins etc), that is why You need one interrupt there anyway.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80337?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 12:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b70ee8fe-c32d-4589-b9f0-934185a58ae2</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Forget EasyDMA part as of now.I got confused because of this different data length.
Can it be achieved with PPI? When 100ms is elapsed, one of the sensor has to be read and store the value in an array , then toggle the CS pins using GPIOTE, read the data from the second sensor and store in another array or same array. is it possible? Once if I could get control over PPI, I will try to do the rest.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80335?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 12:15:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac1881e8-d5ba-43db-8a48-2ca4bb9b881b</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I think this cannot be achieved using PPI only, as you have different lengths of data. It will be needed to change MAXCNT value after the long 75 byte transfer to transfer only 5 bytes from the second sensor. But that would be short interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80336?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 12:02:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dafe5c07-842e-474f-8f26-f52ff10ef5b6</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is a small change in my application. I have an AFE and an accelerometer, both SPI, connected to same SPI channel. My goal is to read SPI data every 100ms from both the sensors. One of the sensor reads 75 bytes of data and the other reads 5 bytes at this instant. Will it be possible by the above method as @Wojtek suggested?
The data has to be read with EasyDMA and stores in an array. Then the collected data has to send every &amp;#39;x&amp;#39; seconds(This amounts 800+ bytes).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80334?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 12:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7f17963-8051-4fe1-8bc7-06123c3f1f2e</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Sending data through BLE can be done using app_timer. I am finding some some difficulty in the PPI configuration here. I&amp;#39;ll try and update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80348?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 10:28:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6a2d349-e9ca-41d8-b321-78a49ada278c</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I don&amp;#39;t think SWI is needed, when using ArrayList feature with SPI. It may be useful though.
You should just read datasheet - operating with SPIM and PPI at register level is easier than it seems to be. I wouldn&amp;#39;t go with drivers etc here, just to simplify. nRF52 has lots of timers with lots of CC registers, so it is quite easy to synchronize everything with them. You are not able to send data via BLE with PPI only, but that should be acceptable though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80347?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 10:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88280de4-93ec-48e6-9c02-44de6ead92bc</guid><dc:creator>Vishnu Pradeep</dc:creator><description>&lt;p&gt;Thank you for shedding some light. My concern was with the toggling of CS pin.
I have to do an SPI transfer by manually making one of the CS pin low. Then initialise GPIOTE toggle for two CS pins, initialise timer PPI for SPI transfer (1ms).
&lt;strong&gt;Timer EEP -&amp;gt;SPI TEP,SPI EEP -&amp;gt; GPIOTE TEP&lt;/strong&gt;.
Can I use a software interrupt flag to store sensor readings  into respective arrays ?&lt;/p&gt;
&lt;p&gt;Yeah. It can be done simply by software app timer and I did that. But I need to reduce CPU intervention as little as possible. That is why I am planning to use both PPI and EasyDMA advantages. I am using both the features for the first time. Can you please help me with EasyDMA also? Like how can I configure EasyDMA for this application and what are the things to be considered while using EasyDMA? Is there an example code for PPI+EasyDMA available??&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; regards,
Vishnu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 PPI+EasyDMA using timer and SPI</title><link>https://devzone.nordicsemi.com/thread/80333?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2017 08:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dd13c9c-a722-4a09-969c-d86516731e8e</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Yes, it is possible. may be something like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setup spi, transmission buffers, timers etc&lt;/li&gt;
&lt;li&gt;Start 1st SPI transmission (either by timer PPI or manually by software -  every 1ms)&lt;/li&gt;
&lt;li&gt;When transmission end, toggle CS pins by gpiote (triggered by spi end ppi), start timer&lt;/li&gt;
&lt;li&gt;when timer end, start second spi transmission (buffer pointer automatically incremented by array list).&lt;/li&gt;
&lt;li&gt;Data may be moved somewhere else, or just long arraylist may be used.&lt;/li&gt;
&lt;li&gt;goto 2?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I may have skipped something, but in general, that should be doable.
It also can be achieved quite easily completely without using ppi, timers etc - just by software app_timer, as 1ms is not that high freq.&lt;/p&gt;
&lt;p&gt;About sending it by BLE every 50ms... I would just use app_timer too for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>