<?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 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12193/nrf52-twi-easydma-feature</link><description>Hi, 
 I want to know that if the TWI easyDMA in nRF52 can help in achieving this task: 
 
 
 we want to read from TWI each 10msec based on a timer interrupt and write the values in an array, e.g., A 
 
 
 meanwhile we want to transfer an array</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Mar 2016 10:40:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12193/nrf52-twi-easydma-feature" /><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46143?ContentTypeID=1</link><pubDate>Fri, 11 Mar 2016 10:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90dd953f-fb8b-4363-9774-94009dd61602</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;There are some new MPU examples &lt;a href="https://github.com/Martinsbl/nrf5-mpu-examples"&gt;here&lt;/a&gt;. The examples are showing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to set up EasyDMA with the SDK drivers or simply using the nRF52 registers. The examples only use one buffer though, but using two buffers should just be a matter of defining two buffers, A and B, and then switch between them whenever you want. This should enable you to transfer old data while at the same reading new data.&lt;/li&gt;
&lt;li&gt;How to send accelerometer data over BLE using a simple service.&lt;/li&gt;
&lt;li&gt;How to use MPU data ready interrupts. With this example you can set up the MPU to sample every 10 ms and generate an interrupt when data is ready. Then you don&amp;#39;t need a timer on the nRF52, just some GPIO to sense the interrupt.&lt;/li&gt;
&lt;li&gt;How to use MPU free fall interrupts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Tested on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MPU9255&lt;/li&gt;
&lt;li&gt;MPU9150&lt;/li&gt;
&lt;li&gt;nRF51 DK (PCA10028)&lt;/li&gt;
&lt;li&gt;nRF52 DK (PCA10040)&lt;/li&gt;
&lt;li&gt;SDK 11.0.0&lt;/li&gt;
&lt;li&gt;SoftDevice S132 V2.0.0 and S130 V2.0.0.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However no guarantees or warranties are provided.&lt;/p&gt;
&lt;p&gt;Older SDKs and Softdevices will not be supported. If you want to use other SDKs you will have to do the porting yourself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46142?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2016 05:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a58f0b1c-8216-4f45-88d8-0c5db550a44e</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You are not getting better answer then &amp;quot;yes it could work&amp;quot; because 1) you won&amp;#39;t get it until you code quick demo and try it and 2) your requirements aren&amp;#39;t precise enough (e.g. to code that demo) anyway. Luckily you know what exactly you want so it should be easy to get there with PPI and TWI (with EasyDMA) examples from SDK. I suppose you need to have some tolerance/threshold on that 10ms timer and based on that you can assess resulting demo. Just to be clear: with Nordic stack once there is some scheduled radio event it will get always priority and delays all application SW processing. In case you wouldn&amp;#39;t be able to achieve your goal with PPI and &amp;quot;cached&amp;quot; TWI transaction handled autonomously by EasyDMA then you would only need custom stack (very very costly) or some &amp;quot;cache and forward&amp;quot; auxilary MCU (this is easy and even relatively cheap).&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46141?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2016 03:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0a47513-8e00-4dd7-a29b-4e42803713f7</guid><dc:creator>FA</dc:creator><description>&lt;p&gt;Still for the case of PPI vs easyDMA I&amp;#39;m not getting my answer, and about the example I made: when I say 100msec we need the radio it means no other interrupts can be handled. The reason: timing of reading from TWI is important, so any delay cause by the radio is not acceptable. So, which method will make it possible to not miss the 10 samples in this example and still be able to transmit? To make it clear: whenever the timer interrupts for 10msec, we HAVE TO service it ASAP, no matter if the radio is active or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46140?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 22:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0f9ad5-9c57-4858-a561-d3e5edcefb03</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Of course you need to use PPI for precise timing only if you want to be 100% safe against postponed interrupts due to radio activity (because BLE stack will always have priority and can postpone actual processing by several ms - extreme case when you have connection events with up to 6 packets). If you are fine with going few ms here and there then you can handle it with existing drivers without big problems (because 10ms is lot of time and you will definitely get some slot there to process incoming data and be ready for next TWI transfer). So the fact that you are going to use radio for &amp;quot;only 100 ms&amp;quot; is pretty much irrelevant (at least for Nordic BLE stack) because what matters are actual intervals and &amp;quot;free slots&amp;quot; for application processing...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46139?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 20:58:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20f41e80-67ac-43a1-ac12-114348a19334</guid><dc:creator>FA</dc:creator><description>&lt;p&gt;Well, I don&amp;#39;t think the case is really complicated knowing the capability of PPI and easyDMA, which I don&amp;#39;t have full knowledge yet. Again, the only thing needed is storing in RAM. Reading is always the same in terms of bytes, we are storing all in one array. The timer handler just does this, nothing else. At some point, we want the radio to work for let&amp;#39;s say 100 msec. This means 10 TWI reads. We don&amp;#39;t want to miss these reads due to radio being active.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46138?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 20:27:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2591c58b-71d3-4bed-9a40-abf1ede621bc</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Btw. this is exactly that kind of use case which cannot be solved on paper. Simply get nRF51 or nRF52 DK and do simple PoC. It will take probably 1-2 weeks but if your product needs this strange feature then it&amp;#39;s time and money well spent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46137?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 20:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b663e1bb-2b49-4847-bcab-72ea7ac7c88d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;PPI means that you can pre-program to launch some task upon some (HW) event. In your case you would hook timer compare to start task of the TWI. However this won&amp;#39;t help you if you want to do any kind of data pre or post processing (e.g. if you want change I2C TX data, if you want to do something with Rx data etc.) So this will solve your case only if you simply repeat the same static transaction (Tx and Rx length known in advance) and then you will process the data before they will be replaced during next transaction (assuming you run timer indefinitely with clearing during compare or something like that).&lt;/p&gt;
&lt;p&gt;From other side if you are running classic BLE radio stack then you will be safe because you will always have reasonable time slot for processing at app level (so if you really insist on very precise timing of I2C &amp;quot;polling&amp;quot; then try it with PPI and the rest in SW interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46136?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 19:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b16567d-1c40-4bfb-9a7f-bdfb01c7432d</guid><dc:creator>FA</dc:creator><description>&lt;p&gt;Can PPI access the RAM without CPU interruption too? What do you mean by management in the app?&lt;/p&gt;
&lt;p&gt;To be more clear, let&amp;#39;s say we are sampling data and storing in RAM, meanwhile anytime our radio might start working and accessing another part of the RAM. We want these two tasks do not interrupt each other at all. So, after setting the timer, timer must not interrupt radio (or actually radio must not delay the timer) and TWI reading should not interrupt any tasks. Right now I&amp;#39;m more into seeing even if this is possible or not for potential switch to nRF52. If PPI in nRF51 can do the job, then it would be much better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46135?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 09:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ee26e40-180f-40cb-ac88-88b43b35aeec</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I guess it&amp;#39;s not EasyDMA (alone) but rather PPI (see the description &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.0/ppi.html?cp=1_2_0_20#concept_sxf_21l_1s"&gt;here&lt;/a&gt;). It should be possible to launch TWI transfer upon Timer end event (all that purely in HW without need to wake or interrupt CPU) but still you will probably need some management in your app. I did similar with PWM and SPI just by using NRF drivers from SDK 10/11 (they use EasyDMA and I&amp;#39;ve used two rotating 128-byte buffers to keep the PWM continuous, you are limited to 255B for single transfer on SPI and TWI anyway). It worked with interrupts at 1ms range, so 10ms shouldn&amp;#39;t be a problem.&lt;/p&gt;
&lt;p&gt;Cheers Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 TWI easyDMA feature</title><link>https://devzone.nordicsemi.com/thread/46134?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2016 04:51:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c128dfa9-4bc9-45bf-95a1-2bdc84801f51</guid><dc:creator>FA</dc:creator><description>&lt;p&gt;Can someone please comment on this topic?!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>