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

David Tcheng

New member
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!!! :(
 
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/micromod-teensy-processor-hookup-guide/hardware-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"
 
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.

mics.png

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.
 
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.

View attachment 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();
}
}
 
Back
Top