Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adc_timer_dma_oneshot.ino outputs only once after startup #79

Open
tkleiner opened this issue Sep 2, 2021 · 0 comments
Open

adc_timer_dma_oneshot.ino outputs only once after startup #79

tkleiner opened this issue Sep 2, 2021 · 0 comments

Comments

@tkleiner
Copy link

tkleiner commented Sep 2, 2021

I have probably misunderstood the expected behaviour of adc_timer_dma_oneshot.ino example.

After moving some defines below the includes, as suggested many times,

#include <ADC.h>
#include <DMAChannel.h>
#include <AnalogBufferDMA.h>

#if defined(ADC_USE_DMA) && defined(ADC_USE_TIMER)

the sketch is compiling without warnings or errors and is also running. Unfortunately, I get only one line of processed data

Setup both ADCs
before enableDMA
After enableDMA
End Setup
 0 - 1(532): 0 <= 1113 <= 1652 953  1 - 1(533): 0 <= 3 <= 10 2044 

This is not changing no matter what I enter into the Serial Monitor. I know from a simple Serial.println that the code enters

if (Serial.available()) {
...
}

Nothing is connected to the teensy 3.6 pins, and the LED is blinking. I use Teensyduino (Arduino 1.8.15) and have replaced the ADC library with the git version 9.1 (commit 6e9a359).

/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/ADC$ git describe
9.1

In AnalogBufferDMA.cpp I found that abdma1.clearCompletion(); would probably also need a abdma1.stopOnCompletion(true) somewhere. I don't know.

This is all very new to me, and I don't know how to get this running. Hints are very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant