Giter Site home page Giter Site logo

charkster / samd21-dma-gpio_high_time_and_period Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 28 KB

This is a re-write of my samd21-gpio_high_and_low_durations project using DMA to move the CC0 and CC1 counter values instead of software. I wanted to see if DMA would improve performance (be able to sample faster/shorter pulses). The result is that DMA has about the same overhead as a tight software ISR loop. High pulses as short as 300ns can be sampled as long as the period is 1000ns or greater. This is about identical to the ISR performance.

License: MIT License

C++ 100.00%
arduino samd21 gpio dma timer period

samd21-dma-gpio_high_time_and_period's Introduction

samd21-dma-gpio_high_time_and_period

This is a re-write of my samd21-gpio_high_and_low_durations project using DMA to move the CC0 and CC1 counter values instead of software ISR. I wanted to see if DMA would improve performance (be able to sample faster/shorter pulses). The result is that DMA has about the same overhead as a tight software ISR loop. High pulses as short as 300ns can be sampled as long as the period is 1000ns or greater. This is about identical to the software ISR performance.

DMA looks like it is great at freeing-up the software to do other tasks or to conserve on power, but does not offer really any other performance benefits. I was hoping for DMA to complete in 2-3 clock cycles for a single 32bit data read followed by a 32bit data write (from when the event tiggered). This is definitely not the case... looks like it is 16+ clock cycles.

I wish that the SAMD21 documentation had been more "up front" in describing the time it takes for a single DMA channel to complete. I was expecting a performance gain but measured none.

This project contains a good example of multi-channel DMA on the SAMD21 without using the HAL library (just individual register writes).

PIN PA7 is the input which measures a single pulse's high time and period.

samd21-dma-gpio_high_time_and_period's People

Contributors

charkster avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.