Hey there!
I am having a little trouble with my teensy 3.1 project.
Hopefully my description is clear enough
the teensy is used in a synthesizer, it generates the sound.
In the loop() function, which a sound sample is computed and thensaved in a variable.
An interrupt running at 40 kHz reads this sample and outputs it to the dac.
Now, during the loop(), I want it to read analog values from some potmeters.
This is where I get stuck:
without analogRead the loop takes around 7 us to complete.
with only one analogRead the loop already takes 16 us to complete.
This is too much, as I am not even halfway building, and the loop is limited at 25 us to complete (because of the 40 kHz sample rate).
So, the question is:
is it possible to speed up the analog reading?
if so, how is this done?
Thanks in advance,
Roel
I am having a little trouble with my teensy 3.1 project.
Hopefully my description is clear enough
the teensy is used in a synthesizer, it generates the sound.
In the loop() function, which a sound sample is computed and thensaved in a variable.
An interrupt running at 40 kHz reads this sample and outputs it to the dac.
Code:
void loop()
{
analogRead(A0); //using analog reads to read potmeters through a multiplexer
usbMIDI.read(); //reads usb Midi
Voice1.Run(); //generates the output sample of one Voice
}
Now, during the loop(), I want it to read analog values from some potmeters.
This is where I get stuck:
without analogRead the loop takes around 7 us to complete.
with only one analogRead the loop already takes 16 us to complete.
This is too much, as I am not even halfway building, and the loop is limited at 25 us to complete (because of the 40 kHz sample rate).
So, the question is:
is it possible to speed up the analog reading?
if so, how is this done?
Thanks in advance,
Roel