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

Thread: Need help and accessing sparkfun machine learning carrier board mics from teensy

  1. #1

    Need help and accessing sparkfun machine learning carrier board mics from teensy

    After exhaustive research, I can't for the life of me find out how to access the mic inputs from Teensy. The Sparkfun ML Carrier board has 2 mics, but I can not find any documentation of how to access them. Using the Artemis processor on the same board, I could processing data from one of the mics.

    Do the mics on the Sparkfun ML board work at all with Teensy? If so, how can you access them? I've tried many times using both Arduino and PlatformIO example with no luck. Has anyone been able to use the Sparkfun ML Carrier board to access mic input? Help!!!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,536
    I haven't tried to use them yet. I believe they may be wired to the wrong pins?

  3. #3
    Quote Originally Posted by PaulStoffregen View Post
    I haven't tried to use them yet. I believe they may be wired to the wrong pins?
    I suspect the same, but don't know how to change the pin assignments. I did see a technical reference that said:

    (from https://learn.sparkfun.com/tutorials...dware-overview)

    AUDIO
    The Teensy Processor supports audio using the I2S standard. The pins used are:

    AUD_OUT - GPIO pin 7, pad 56 on the MicroMod, this is the digital audio output.
    AUD_IN - GPIO pin 8, pad 54 on the MicroMod, this is the digital audio input.
    AUD_LRCLK - GPIO pin 20, pad 52 on the MicroMod. Officially called "word select", and also known as "frame sync".
    AUD_BCLK - GPIO pin 21, pad 50 on the MicroMod. Offically called "continuous serial clock, and also known as the "bit clock"

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,536
    The I2S mic is best, since it doesn't need CPU time to low pass filter the bitstream.

    This should be the required connection.

    SCK -> BCLK1 -> Arduino 21 -> M.2 pin 50
    WS -> LRCLK1 -> Arduino 20 -> M.2 pin 52
    SD -> IN1 -> Arduino 8 -> M.2 pin 54

    Looks like Sparkfun did connect the pins correctly on the ML Carrier.

    But they have 2 little locations on the board called EN1 and EN2 which connect the power to the 2 mics.

    Click image for larger version. 

Name:	mics.png 
Views:	11 
Size:	26.0 KB 
ID:	27207

    By default, the PDM mic is powered and the I2S mic is unpowered. So you probably need to but the EN1 pads apart, and then solder the EN2 pads together.

  5. #5
    Quote Originally Posted by PaulStoffregen View Post
    The I2S mic is best, since it doesn't need CPU time to low pass filter the bitstream.

    This should be the required connection.

    SCK -> BCLK1 -> Arduino 21 -> M.2 pin 50
    WS -> LRCLK1 -> Arduino 20 -> M.2 pin 52
    SD -> IN1 -> Arduino 8 -> M.2 pin 54

    Looks like Sparkfun did connect the pins correctly on the ML Carrier.

    But they have 2 little locations on the board called EN1 and EN2 which connect the power to the 2 mics.

    Click image for larger version. 

Name:	mics.png 
Views:	11 
Size:	26.0 KB 
ID:	27207

    By default, the PDM mic is powered and the I2S mic is unpowered. So you probably need to but the EN1 pads apart, and then solder the EN2 pads together.
    I modified my ML carrier board as you described, and now I can read audio input from the 2nd mic using AudioInputI2S. I tested the system using the FFT example, and at first I thought it was not working because of low signal strength, but after multiplying the fft results by 1000, the results we reasonable and tracked the sound nicely. Thanks. Here's the test code i used:

    // Teensy FFT Test (modified by David Tcheng 1/17/22)

    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    const int myInput = AUDIO_INPUT_MIC;
    AudioInputI2S audioInput; // audio shield: mic or line-in
    AudioAnalyzeFFT1024 myFFT;
    AudioConnection patchCord1(audioInput, 0, myFFT, 0);

    void setup() {
    AudioMemory(12);
    myFFT.windowFunction(AudioWindowHanning1024);
    }

    void loop() {
    float n;
    int i;

    if (myFFT.available()) {
    // each time new FFT data is available
    // print it all to the Arduino Serial Monitor
    Serial.print("FFT: ");
    for (i=0; i<256; i++) {
    n = myFFT.read(i);
    if (n >= 0.001) {
    Serial.print("#");
    } else {
    Serial.print(" "); // don't print "0.00"
    }
    }
    Serial.println();
    }
    }

Posting Permissions

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