heyspencerb
Member
Hello!
Can you use DMA to sample from the ADC of a teensy 4.0 at a set sampling period without having to have your code hand during the period between samples, and if so does anyone have any sample code of this on a 4.0? Here is my sampling as it is:
and then I later sample again at a different sampling period. As the number of samples grows, the time spent waiting on samples is starting to grow and really slow down my program. Any help on this would be greatly appreciated!
Can you use DMA to sample from the ADC of a teensy 4.0 at a set sampling period without having to have your code hand during the period between samples, and if so does anyone have any sample code of this on a 4.0? Here is my sampling as it is:
Code:
for (int i = 0; i < samples1; i++)
{
useconds_sampling1 = micros();
int value = analogRead(A8) - 130;
vReal1[i] = value;
while (micros() < (useconds_sampling1 + sampling_period_us1))
{
//wait...
}
}