How to connect teensy 4.1 with the ICS52000 array

Status
Not open for further replies.

feima0011

Well-known member
------------------------------------
Admin Edit: ICS-52000 microphones do not appear to work well with Teensy at 44100 Hz sample rate. The "notwired.co" board does NOT work with Teensy at 44.1 kHz!
------------------------------------



I have Teensy 4.1 and a four ICS52000 microphone array as shown in the figure
nw_aud_ics52000.png

How to connect teensy 4.1 with the ICS52000 array?

The Teensy audio design tool show the following suggestion for connection
Capture.PNG

I do not know why pin 21 of Teensy 4.1 is used both as the BCLK and FS?
 
Last edited by a moderator:
That information is a typo (aka wrong)

AFAIK:
T4.x:
MCLK 23
BCLK 21
LRCLK 20
IN1 8


Thanks for the reply.

I still do not understand, the pin configuration of a ICS52000 is shown in the figure
Capture.PNG
which shows SD, WS, SCK, not the MCLK, BLCK, LRCLK.


Should I connect the
"MCLK 23
BCLK 21
LRCLK 20
IN1 8"
to which pins of the ICS52000?
 
We have tried you suggestion, but it does not work.

Please help us figure out the connection between the ICS52000 and the teensy 4.1
 
That information is a typo (aka wrong)

Opps, yes, it is indeed a typo. I've updated the website and github to properly show pin 20 for FS on Teensy 4.x.


Please help us figure out the connection between the ICS52000 and the teensy 4.1

I want to help you, but as far as I know WMXZ's suggested connection is correct.

Could you show us photos of how you've actually connected the hardware? Often when there is a mistake or misunderstanding in the wiring, usually words can't describe the problem (especially when it's a misunderstanding) but a photos sometimes can let us see what's really wrong.

Maybe also show us the (complete) program you're running. There too, certain mistakes like forgetting AudioMemory or not giving enough memory to process all 16 inputs can cause a program which otherwise should work to do nothing. We can't see your screen, so if you don't show us the code you're actually running, we're left to just blind guessing about the real cause of the problem.

With these MEMS microphones, sometimes we've seen cases where everything was "working" but seems to be dead only because the microphone's data had a very small signal with a large DC offset. The SPH0645 mic in particular had these problems, which is why the audio library has an example program to demonstrate how to get a usable signal from that particular mic.
 
Thanks for the reply. Her are our set up and code.

We connect the 4 ICS52000 microphone array from
https://www.notwired.co/products/detail/nwaudics52000-notwired-co/605574/
with the Teensy 4.1 as shown in the following figure
Ics52000_teensy41.jpg
Specifically, we connect
--------------------------------------------------------------------
Microphone array pin <-------> Teensy 4.1 Pin
1,3,5,7,9 <-------> GND
2 <-------> 3.3V
6 <--------> 8
8 <--------> 21
10 <-------> 20
-----------------------------------------------------------------------
according to the audio design tool suggestion
Screenshot from 2021-06-17 19-02-35.png

and the microphone array data sheet
Screenshot from 2021-06-17 19-03-48.png
------------------------------------------------------------------------

Here is the code, which basically record 10 second of data from
one microphone and then save the data to the SD card.

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

#define SDCARD_CS_PIN    BUILTIN_SDCARD
/////////////////////////////////////////////////////////////////////////////////
int a=0;
////////////////////////////////////////////////////////////////////////////////

unsigned int tsamplemillis = 10000;

int16_t* buffer1;
int16_t* buffer2;

File frec;

////////////////////////////////////////////////////////////////////////////////

AudioInputTDM            tdm1;   
        
AudioRecordQueue         queue1;       
AudioRecordQueue         queue2;  
     
AudioConnection          patchCord1(tdm1, 0, queue1, 0);
AudioConnection          patchCord2(tdm1, 1, queue2, 0);

////////////////////////////////////////////////////////////////////////////////

void setup() {
  Serial.begin(115200);
  AudioMemory(512);

  // Initialize the SD card

  if (!(SD.begin(SDCARD_CS_PIN))) {
    // stop here if no SD card, but print a message
    while (1) {
      Serial.println("Unable to access the SD card");
      delay(1000);
    }
  }
  while (!Serial);
  Serial.println("Begin");
}

void loop() {
    if(a<1){
    record();
    continueRecording();
    stopRecording();
    a = 1;
    }
}

void record()
{
  
  frec = SD.open("ICS52000.raw", FILE_WRITE);
  if (frec) {
    Serial.println("File Open");
  }
}

void continueRecording() {
  int data = 0, num = 0;
  elapsedMillis recordingTime = 0;
  
  queue1.begin();------------------------------------------------------------------------
------------------------------------------------------------------------

  queue2.begin();
  
  while (recordingTime < tsamplemillis)
  {
    data = queue1.available();
    if (data > 0)
    {
      buffer1 = queue1.readBuffer();     
      buffer2 = queue2.readBuffer();
      
      queue1.freeBuffer();                
      queue2.freeBuffer();
     
      for (int i = 0; i < 128; i ++)                       
      { 
        frec.write(highByte(buffer2[i])); // LSB            
        frec.write(lowByte(buffer1[i])); // Middle Byte     
        frec.write(highByte(buffer1[i])); // MSB           

        num++;
      }
    }
  }
  queue1.end();     //stop the background sampling
  queue2.end();
  
  Serial.print("num of samples written per channel:");
  Serial.println(num);

}

void stopRecording() {
  Serial.println("Finished recording.");
  queue1.end();
  queue2.end();
  queue1.clear();
  queue2.clear();

  frec.close();
   Serial.println("File close");
}

--------------------------------------------------------------------------------------------------------------------
I use a loudspeaker to play a 440 Hz sine signal close to the microphone array, I expect to witness the sine
waveform from the data.

But after I imported the data "ICS52000.raw" to the Audacity as raw data, 24 bit signed pcm, little endian ,one channel,
with sampling frequency of 44100 hz.

Here is that showed by Audacity
Screenshot from 2021-06-17 19-10-43.jpg

I can not see a sine waveform if even I zoom in to the data.
 
I have a couple of those ICS52000 boards here, part number NW-AUD-ICS52000. I believe this is the datasheet with its schematic, right?
 

Attachments

  • ds-nw-aud-ics52000.pdf
    373.3 KB · Views: 97
I tried to follow the wires in your photo, but due to the bad camera angle I just can't clearly see where each wire really connects.

I connected my ICS52000 to a Teensy 4.0 on my desk.

tdm.jpg

So far I only ran this program, just to get the waveforms.

Code:
#include <Audio.h>

AudioInputTDM            tdm1;

void setup() {
  AudioMemory(40);
}

void loop() {
}

At a very quick first test, these are the waveforms I oscilloscope sees on the 3 signals.

file1.png

file2.png

If you have a scope or logic analyzer, check if your hardware is giving these waveforms...
 
Connection

I will try the logic analyzer tomorrow.

My connection between two board are
Screenshot from 2021-06-17 21-11-04.png
Have a try the connect and my code.
 
Last edited:
I believe you should first try simple things within the audio library (like peak level analysis), before adding all the complexity of queues and handling data and adding a SD card into the list of unknowns.


My connection between two board are

If you can take better photos from an angle where I can see the connections, I will try again to follow the wires. But this description isn't helping. Real photos are needed. Before you post, please look at your photo from the perspective of someone trying to visually verify the wires. If many of the wires all cross over each other in 1 place, you need a different camera angle!
 
logic analyser results

I tried to follow the wires in your photo, but due to the bad camera angle I just can't clearly see where each wire really connects.

I connected my ICS52000 to a Teensy 4.0 on my desk.

View attachment 25056

So far I only ran this program, just to get the waveforms.

Code:
#include <Audio.h>

AudioInputTDM            tdm1;

void setup() {
  AudioMemory(40);
}

void loop() {
}

At a very quick first test, these are the waveforms I oscilloscope sees on the 3 signals.

View attachment 25057

View attachment 25058

If you have a scope or logic analyzer, check if your hardware is giving these waveforms...


I have a bitscope logic analyser, https://www.bitscope.com/product/BS05/.

I run your code and have a look at the signal on pin 20 and 21.
The connection between the bitscope and the teensy 4.1 are as follows.

IMG_20210623_110642.jpg

Here is the signal on pin 21,
Screen Shot 2021-06-23 at 11.04.40 am.jpg
here is the signal on pin 20.
Screen Shot 2021-06-23 at 11.06.10 am.jpg

Note that the time scales in the two figures are different.
The signal on pin 20 is much sparse than the signal on pin 21.

I think the TDM port on teensy should work just fine.

What is next?
 
I have done another measurement using the DS1052E DIGITAL OSCILLOSCOPE.
The results are here.
IMG_20210623_160326.jpg
Here plot 1 is the pin 20 signal, and plot 2 is the pin 21 signal.

As shown in the figure, the pin 20 signal is pulse signal with a peroid about 22.7 us,
and the pin 21 signal is approximately (square) pulse signal with a peroid about 88.6 ns.

These two clock signals are good.

What is the next for further debuggering?
 
I am suprised to find that even this simple code does not work.

I'm not :)

The documentation in the audio gui says:

USB input & output does not cause the Teensy Audio Library to update. At least one non-USB input or output object must be present for the entire library to update properly.

Best is to use I2S. You don't need to connect anything there, it's just used as internal clock source.
 
I tried to follow the wires in your photo, but due to the bad camera angle I just can't clearly see where each wire really connects.

I connected my ICS52000 to a Teensy 4.0 on my desk.

View attachment 25056

So far I only ran this program, just to get the waveforms.

Code:
#include <Audio.h>

AudioInputTDM            tdm1;

void setup() {
  AudioMemory(40);
}

void loop() {
}

At a very quick first test, these are the waveforms I oscilloscope sees on the 3 signals.

View attachment 25057

View attachment 25058

If you have a scope or logic analyzer, check if your hardware is giving these waveforms...

So,
Paul, I can confirm the same picture for the TDM, but strange enough, when sending data over USB to PC only noise is passing without acoustics.
(See other thread https://forum.pjrc.com/threads/6758...ith-teensy-4-1?p=282615&viewfull=1#post282615 for program)
 
Status
Not open for further replies.
Back
Top