Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 26 to 50 of 58

Thread: how to use the ics52000 microphone with teensy 4.1

  1. #26
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    I made another attempt to test ICS-52000 with the notwired.co board with Teensy 3.6.

    In every test I tried, all 4 microphones appear to be transmitting only a worthless static. It seems to never respond to actual sound, even directly touching the PCB right at the bottom side holes where the microphones supposedly "hear".

    I even tried an experiment to extract the 32 bits and apply digital gain to hear some the low bits which are received by TDM channel 1.

    Code:
    #include <Audio.h>
    
    class micgain : public AudioStream {
      public:
        micgain() : AudioStream(2, inputQueueArray) { }
        virtual void update(void);
        audio_block_t *inputQueueArray[2];
    };
    
    void micgain::update() {
      audio_block_t *a = receiveWritable(0);
      audio_block_t *b = receiveReadOnly(1);
      if (a && b) {
        for (int i = 0; i < AUDIO_BLOCK_SAMPLES; i++) {
          int32_t n = (a->data[i] << 16) | (b->data[i] & 0xFFFF);
          a->data[i] = n / 1000;  // gain is 65536 / 1000
        }
        transmit(a);
        release(a);
        release(b);
      } else {
        if (a == nullptr) release(a);
        if (b == nullptr) release(b);
      }
    }
    
    AudioInputTDM     tdm1;
    AudioOutputTDM    tdm2;
    micgain           test1;
    AudioOutputAnalogStereo out1;
    AudioConnection   p1(tdm1, 0, test1, 0);
    AudioConnection   p2(tdm1, 1, test1, 1);
    AudioConnection   p3(test1, 0, out1, 0);
    AudioConnection   p4(test1, 0, out1, 1);
    AudioConnection   p5(test1, 0, tdm2, 0);
    
    void setup() {
      AudioMemory(40);
    }
    
    void loop() {
    }
    Click image for larger version. 

Name:	sc.jpg 
Views:	25 
Size:	86.8 KB 
ID:	25296

    I don't know why the ICS-52000 mics are transmitting worthless noise and don't seem to hear any real sound.

  2. #27
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    In a final attempt, I tried removing the 3 chips from the notwired.co board. I replaced 2 of them with just wires.

    Click image for larger version. 

Name:	sc1.jpg 
Views:	27 
Size:	11.4 KB 
ID:	25297

    Click image for larger version. 

Name:	sc2.jpg 
Views:	26 
Size:	12.4 KB 
ID:	25298

    With this change, I can get the mics to respond. But the quality is terrible. A *lot* of noise and poping sounds. But if I blow directly on the back side of the notwired.co PCB, I can hear it on the headphones I have connected (via the DACs going to a M-Audio AV40 monitor speaker with headphone output). I was running the code from msg #26.

    While the InvanSense datasheet says ICS-52000 is supposed to work up to 48 kHz sample rate and BCLK speeds up to 27.034 MHz, I'm starting to suspect this mic was meant for much lower sample rates. The specs on page 4 and elsewhere in the ICS-52000 were all measured with BCLK at 3.072 MHz.

    The notwired.co board doesn't say what clock speeds it supports, but I'm getting a pretty strong feeling they only ever used it at much slower than 44 kHz sample rate and 11.29 MHz BCLK.

  3. #28
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    I have closed many of the redundant ICS-52000 threads. This thread and the oldest one on this forum remain open.

    https://forum.pjrc.com/threads/48563...aluation/page2

    Some success using a single ICS-52000 was previously reported on this thread, which may be useful...

    https://forum.pjrc.com/threads/42894...l=1#post141742

    Please, do not create more ICS-52000 threads on this forum. We already have far too much, which only makes info harder for everyone to find.

  4. #29
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    I believe that this post also reported success:

    https://forum.pjrc.com/threads/52175...oSoundRecorder

  5. #30
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,317
    Quote Originally Posted by jonr View Post
    I believe that this post also reported success:

    https://forum.pjrc.com/threads/52175...oSoundRecorder
    but only with ICS43434, IIRC

  6. #31
    Senior Member
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    119
    Been following these threads for a while, somewhat bemused ... but a couple of (possibly dumb) questions occur to me ...
    • Does the notwired.co PCBA follow their schematic or the InvenSense datasheet one? Theirs has a 10k pull-down on SD, where the datasheet calls for 100k
    • Does / can the audio library impose the 10ms delay required at startup before WS is asserted?

    I also note the datasheet says "The part is in normal operation mode when SCK and WS are active. Clocks should not be supplied to the microphones until they are settled and stable." No clues (that I can see) telling you how long it takes the device to get "settled and stable". But hey, it's only revision 1.3 of the data sheet from 2017, I'm sure they'll get it right one day

    Cheers

    Jonathan

  7. #32
    Quote Originally Posted by PaulStoffregen View Post
    In a final attempt, I tried removing the 3 chips from the notwired.co board. I replaced 2 of them with just wires.

    Click image for larger version. 

Name:	sc1.jpg 
Views:	27 
Size:	11.4 KB 
ID:	25297

    Click image for larger version. 

Name:	sc2.jpg 
Views:	26 
Size:	12.4 KB 
ID:	25298

    With this change, I can get the mics to respond. But the quality is terrible. A *lot* of noise and poping sounds. But if I blow directly on the back side of the notwired.co PCB, I can hear it on the headphones I have connected (via the DACs going to a M-Audio AV40 monitor speaker with headphone output). I was running the code from msg #26.

    While the InvanSense datasheet says ICS-52000 is supposed to work up to 48 kHz sample rate and BCLK speeds up to 27.034 MHz, I'm starting to suspect this mic was meant for much lower sample rates. The specs on page 4 and elsewhere in the ICS-52000 were all measured with BCLK at 3.072 MHz.

    The notwired.co board doesn't say what clock speeds it supports, but I'm getting a pretty strong feeling they only ever used it at much slower than 44 kHz sample rate and 11.29 MHz BCLK.
    That is interesting. As far as I know, Doggy is the only one who has succesfully made the TDM microphones working with Teensy.
    Doggy is not using the norwired.com board, but connecting the ICS52000 with teensy direcly, and he set the sampling frequency
    to be 10 Khz. Maybe this is the reason.


    I have contacted one engineer from Notwired. com and they are trying to use the notwired board with the teensy 3.6.
    I will inform the forum when I get their response.

  8. #33
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    Quick answers....

    Quote Originally Posted by h4yn0nnym0u5e View Post
    Does the notwired.co PCBA follow their schematic or the InvenSense datasheet one? Theirs has a 10k pull-down on SD, where the datasheet calls for 100k
    I do not believe the pulldown resistor really matters.

    I did spend quite a lot of time last night looking at the signals with my oscilloscope. It's easy to see the SD signal ramping slowly down after the 24th bit, when that last bit was a 1 (the lowest 10 bits are pretty much always random).


    Does / can the audio library impose the 10ms delay required at startup before WS is asserted?
    Yes. Technically, the startup code does this, using a 300 ms delay before C++ constructors are executed. This was added years ago because many chips, particularly MEMS motion sensors, requires a delay to start up and virtually all Arduino libraries don't implement a delay or check & retry because all of Arduino's boards have a lengthy delay at startup from their bootloaders.


    But hey, it's only revision 1.3 of the data sheet from 2017, I'm sure they'll get it right one day
    After everything that's happened, I believe it's pretty safe to conclude ICS-52000 doesn't really work at the higher speeds the datasheet claims. Then again, the datasheet only gives performance metrics with 3 MHz clock, so if microphone works even in the slightest way utterly unusable noise, the datasheet it technically true even though any rational person would call that pretty dishonest.

    I'm considering adding an admin edit to the 1st message of every ICS-52000 thread (how did we ever get so many...) to warn people that this mic doesn't really work well with Teensy.

  9. #34
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    But AFAIK, a delay before start and a delay between start of FS and start of SCK aren't the same thing. Manually connecting FS late is an easy test.


    This delay can be implemented either by enabling the WS output (FS) on the clock master at least 10 ms after the SCK_I is enabled, or by externally controlling the signals given to the ICS-52000s.

  10. #35
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,255
    Quote Originally Posted by jonr View Post
    But AFAIK, a delay before start and a delay between start of FS and start of SCK aren't the same thing. Manually connecting FS late is an easy test.


    This delay can be implemented either by enabling the WS output (FS) on the clock master at least 10 ms after the SCK_I is enabled, or by externally controlling the signals given to the ICS-52000s.
    If one wants to try that, just insert the delay(10) here : https://github.com/PaulStoffregen/Au...t_tdm.cpp#L338

  11. #36
    Administrator Paul's Avatar
    Join Date
    Oct 2012
    Posts
    415
    I've added a warning at the top of the many ICS-52000 threads. Hopefully it will help others in the future who find these many threads.

  12. #37
    @paul,

    I have connected one engineer from invensense, inc. the producer of ICS52000.
    The ICS52000 works with the ADAU1452 well.
    He told me that there maybe some issue with the Teensy board.

    Click image for larger version. 

Name:	Screenshot from 2021-08-20 09-37-04.png 
Views:	13 
Size:	18.7 KB 
ID:	25614

    There are several standard for the TDM interface, such as TDM2, TDM8 TDM16.

    can you check the TDM standard of ICS52000 and the Teensy?

  13. #38
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    Teensy absolutely does indeed support the proper TDM protocol. I personally confirmed the waveforms on my oscilloscope. In fact, I posted those waveforms for you, but I can not easily find them now because you started so many redundant threads. It was indeed transmitting data in the proper way, but the content of that data was not responsive to any sounds.

    Ask the engineer at Invensense if he/she as personally witnessed ICS52000 working at 44100 Hz sample rate?

    I know the specs claim it works up to 48 kHz. But I personally spent quite a lot of time working with this part (on the notwired.co boards) and every appearance it it just barely functions with essentially zero sound sensitivity when used at 44100 Hz.

  14. #39
    @paul Here is th reply from invensense.
    Code:
    
    The ICS-52000 complies to the TDM standard. The microphone datasheet pages 10-13 outline the requirements for successful microphone operation 
    i.e. for 16 microphones running at fs=48kHz, then SCK should be 512xfs = 24.576MHz, WS will be generated by host and subsequently passed through 
    each microphones WSO after they have broadcast in their TDM slot. If you are running at a lower sample rate you should scale the clk appropriately i.e. 
    44.1kHz would call for 22.579MHz for the same number of mics. The generic requirement of the host is that it can generate the appropriate SCK and WS 
    and interpret each individual TDM slot correctly. The data consists of a data word length of 24 bits/channel and the data word format is 2’s complement, 
    MSB-first. You should ensure that this has been appropriately configured on the host side.
    
     
    
    I did see the overall feature on the Teensy development board that it claimed to have TDM capability, however it should provide some kind of SDK or API 
    for configuring the TDM appropriately. Has the Teensy TDM input been validated on another TDM audio source? You could for example use an Audio Precision 
    for example to generate a TDM stream and then see if the Teensy can capture it. If you don’t have access to that you could also try creating a TDM2 or TDM4 
    or TDM8 using 2/4/8 ICS-52000 mics and scale the CLK down accordingly to see if that makes a difference – operation at higher CLK rates >10MHz can be 
    hampered by non-ideal routing.
    It seem like that the problem is the the SCK signal, which should be decided based on both the number of microphones, and the sampling frequency.

    is this the problem?

  15. #40
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,317
    @feima0011
    IMO, invensense is the wrong addressee. I understand it was demonstrated in other thread that multiple ICS52000 do work. It is the NotWired board that is not working properly.
    this board has additional logic added that may not be adequate.

  16. #41
    I have emailed NotWired, and their engineer worked the problem for over one month without any reply yet.
    Discard the NotWired board from now on.

    I tried to connect the ICS52000 directly to the teensy 4.1, with some basic circuit recommended by the ICS52000 data sheet,
    Click image for larger version. 

Name:	IMG_20210702_090906_3.jpg 
Views:	16 
Size:	48.5 KB 
ID:	25644

    but it is still not working?

    So , my boss is not happy.

  17. #42
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    Quote Originally Posted by WMXZ View Post
    I understand it was demonstrated in other thread that multiple ICS52000 do work.
    Can you give a direct link to the exact message?

    We have too many ICS52000 threads! Sadly, @feima0011 is responsible for creating such a huge mess of threads. So many threads makes finding info and helping much harder than it should be if we had only 1 thread where we could refer to every comment by its message number (as we do on so many other threads of this forum).

  18. #43
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,023
    As you can see in msg #27, I removed the other chips from the notwired.co board, so it was only the ICS52000 chips.

    The chips do transmit data within their TDM time slots. But every attempt I've made has resulted in mostly noise and little or no usable signal in that data stream.

    I do not have any other ICS52000 chips, only 2 of the notwired boards, neither of which gives usable data.

  19. #44
    , delete all other posts, and only keep this one.

    That is what are sure about now.


    The teensy does work with four ICS52000 at 10Hz sampling
    frequency, but not with the notwired board.

  20. #45
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,317
    Quote Originally Posted by PaulStoffregen View Post
    Can you give a direct link to the exact message?
    Paul,
    I was referring to https://forum.pjrc.com/threads/48563...l=1#post171455
    I just listened again to his mp3 file and it sounded OK to me

  21. #46
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    Does everyone agree with this summary?

    1) dreggory has reported the ICS-52000 working fine at 44.1Khz
    2) others have had problems with some hand wiring and the notwired.co PCB
    3) the clock frequency is high (22.579MHz) - well into the range where layout/wiring can be a problem

  22. #47
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,317
    Quote Originally Posted by jonr View Post
    Does everyone agree with this summary?

    1) dreggory has reported the ICS-52000 working fine at 44.1Khz
    2) others have had problems with some hand wiring and the notwired.co PCB
    3) the clock frequency is high (22.579MHz) - well into the range where layout/wiring can be a problem
    that is my understanding

  23. #48
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    This is for a different chip, but is it the same layout?

    https://oshpark.com/shared_projects/GiObJBkm

  24. #49
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    1,070
    Looks to be a different layout. But not hard to make a small breakout board for testing.

  25. #50
    Quote Originally Posted by WMXZ View Post
    that is my understanding

    Click image for larger version. 

Name:	Screenshot from 2021-08-25 10-37-21.png 
Views:	10 
Size:	35.4 KB 
ID:	25650

    Is the clocking signal the problem?

    Should we use the 22.6 MHz MCLK, instead of the 11.3Mhz bclk?

    Should RX be 22.6 Mbit/sec?
    Last edited by feima0011; 08-25-2021 at 01:27 AM.

Posting Permissions

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