<?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>How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10204/how-to-sample-an-accelerometer-at-high-rate-with-minimal-cpu-usage</link><description>To reduce power, I&amp;#39;m trying to find the best approach to minimize the cpu load when sampling an accelerometer at a high rate, e.g. 1.6Khz. Is there a way to DMA a sensors fifo buffer/output registers into ram ? Either with the nRF51 or nRF52. Any other</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Nov 2015 07:51:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10204/how-to-sample-an-accelerometer-at-high-rate-with-minimal-cpu-usage" /><item><title>RE: How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/thread/37875?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2015 07:51:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bac674f0-1a89-4dc6-b197-be957406ea44</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;If you are happy with the answer I would appreciate it if you could accept it by clicking the check mark to the left of it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/thread/37872?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 18:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d11ac1ad-1445-4e05-821a-b8d03aa227a6</guid><dc:creator>ShannonPahl</dc:creator><description>&lt;p&gt;Got it, thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/thread/37874?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 07:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afa2de1c-6755-4b17-9674-363c57523e00</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk52.v0.9.2/twi_master_with_twis_slave_example.html?cp=4_0_0_4_5_21"&gt;TWIS slave and TWI master mode drivers example&lt;/a&gt; includes an example &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk52.v0.9.0/group__nrf__twis__drv.html"&gt;TWI Slave with EasyDMA driver&lt;/a&gt;. I guess what you want is a TWI master with EasyDMA example, but hopefully you can get some inspiration from the other example. The nRF52 SDK is not final yet, and the TWIM peripheral is currently missing a driver, so you will have to handle it your self for now. If you are going to start developing now it may be easier to start using the &lt;a href="http://infocenter.nordicsemi.com/topic/nrf52.v1.7/Chunk387579460.html?cp=1_1_0_45#concept_rhy_rzp_sr"&gt;TWI peripheral&lt;/a&gt; (without DMA) and move to using the &lt;a href="http://infocenter.nordicsemi.com/topic/nrf52.v1.7/Chunk1471894297.html?cp=1_1_0_29#concept_scx_f5p_xr"&gt;TWIM peripheral&lt;/a&gt; (with DMA) later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/thread/37873?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 02:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4675b68-edb9-40f9-833d-64c3c5fbd8ff</guid><dc:creator>ShannonPahl</dc:creator><description>&lt;p&gt;Thanks for the response. Yes, the cpu is needed to process a set of samples at some point, but the cost of reading a set of samples using the cpu (timer expires, read, repeat) is comparable to the cost of computing on that sample set, so eliminating the cpu from the reading process for the entire sample set will improve battery life nicely.&lt;/p&gt;
&lt;p&gt;The sensor has one set of registers that need to be read for one sample, read either at the sensors ODR or notified by an event, or when the fifo is filling up enough (if using a fifo on the sensor).&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure how to setup a dma transfer to read a set of samples from the sensor as described (using i2c or spi). Can you point to me to something similar to get an idea ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to sample an accelerometer at high rate with minimal cpu usage</title><link>https://devzone.nordicsemi.com/thread/37871?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 14:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74b570c9-22df-4aa9-b76f-435818dd57a8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I guess you will need the CPU at some point in order to do anything with the data you collect? But other then that you should be good using DMA. Depending on which interface you have with the sensor you may need the nRF52 as it has DMA for more peripherals than the nRF51. You can have DMA with both SPI and TWI/I2C on the nRF52. Please refer to the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52.v1.0.0/chips/nrf52832_ps.html?cp=1_1_0"&gt;spec&lt;/a&gt; for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>