Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4 audio - ADC input not working

  1. #1
    Junior Member
    Join Date
    Feb 2022
    Posts
    3

    Teensy 4 audio - ADC input not working

    Hi everyone,

    I got trouble to get the audio ADC input working with a teensy 4.1. I have tried the PeakMeterMono example in combination with the ADC example circuit (https://www.pjrc.com/teensy/gui/img/adccircuit.png)
    Code:
    void loop() {
     // if (fps > 24) {
        if (peak1.available()) {
          fps = 0;
          int monoPeak = peak1.read() * 30.0;
          Serial.print("|");
          for (int cnt=0; cnt<monoPeak; cnt++) {
            Serial.print(">");
          }
          Serial.println();
        }
     // }
    }
    My hardware setup works fine with this code when I use a Teensy 3.2. However, with a Teensy 4 simply nothing happens. Apparently peak1.available() is never true. I suspect the initialisation of the ADC failed somehow. Has anyone an idea how to resolve this?

    So far, I have tried a fresh Arduino 1.8.19 and Teensyduino 1.56 installation. I have read here that the "ADC does not work good", but does it work at all?

    Best regards,
    Christian

  2. #2
    Senior Member
    Join Date
    Jan 2019
    Posts
    131
    I'm also having this issue with 4.1
    Seems there is limited input audio ADC support for 4.x

  3. #3
    Junior Member
    Join Date
    Feb 2022
    Posts
    3
    I bought a few audio adaptor boards and added an electret microphone (adafruit 1064). With this setup, the PassThroughStereo example worked out of the box.

  4. #4
    Senior Member
    Join Date
    Jan 2019
    Posts
    131
    Quote Originally Posted by cmteuffel View Post
    I bought a few audio adaptor boards and added an electret microphone (adafruit 1064). With this setup, the PassThroughStereo example worked out of the box.
    Seems the i2S board you got made it work.

    There is an update to the library (beta). I'll be checking it out.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,041
    If you use the latest from github, remember to have at least 1 other input or output with "update responsibility", as the ADC input can't do that on Teensy 4. Any I2S or MQS works, even if unused.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •