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

Thread: Teensy 4.0 I2S library compatibility issue

  1. #1
    Junior Member
    Join Date
    Nov 2019
    Posts
    3

    Teensy 4.0 I2S library compatibility issue

    I am trying to use a SPH0645 adafruit I2S compatible microphone with a teensy 4.0. While following the wiring directions (at https://learn.adafruit.com/adafruit-...iring-and-test) to test the mic and confirm it is working, I keep getting a incompatible error just trying to use a I2S example. All the I2S.h libraries mention that they are only for SAMD boards. Pjrc mentions that the teensy 4.0 has I2S compatibility as well as the processor is a cortex which should be compatible. How can I get the I2S libraries loaded on to my teensy?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,107
    Can you post the associated text indicating the error?

    Clicking the Adafruit link didn't quickly show the I2S lib used?

    While the ARM'ness may be similar - there are likely architectural changes that will need adjusting as the NXP CPU's are not the same.

  3. #3
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    Quote Originally Posted by defragster View Post
    Can you post the associated text indicating the error?

    Clicking the Adafruit link didn't quickly show the I2S lib used?

    While the ARM'ness may be similar - there are likely architectural changes that will need adjusting as the NXP CPU's are not the same.
    Its just any I2S enabled lib. For instance there is a lib called arduinosound.h that uses I2S i was trying to use but was getting a compiling error.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,825
    Quote Originally Posted by nahsam View Post
    Pjrc mentions that the teensy 4.0 has I2S compatibility as well as the processor is a cortex which should be compatible. How can I get the I2S libraries loaded on to my teensy?
    I2S support on Teensy is part of the Teensy Audio Library. If you've installed Teensyduino and you have Teensy selected in Tools > Boards, you can find all its examples in File > Examples > Audio.

    This 31 page tutorial covers all the essential features, including I2S which is used in every part.

    https://www.pjrc.com/store/audio_tutorial_kit.html

    You can also find a full 45 minute walkthrough video of the entire tutorial. Of course it's best to do the tutorial yourself, but if you get stuck or you just have limited time and prefer to watch Alysia and me do it, the video might help.

    One minor caveat is the tutorial was written 4 years ago with Teensy 3.2. All of it should work with Teensy 4.0, as long as you have the Rev D audio shield which works with 4.0.

    For using something other that the audio shield, you will need to adapt the examples somewhat. For most I2S chips, you'll just delete the stuff which controls the STGL5000 chip and add whatever is needed to get your chip to start working (if it doesn't just turn on automatically). One thing to consider is it's all designed for Teensy to generate the clock signals (BCLK, LRCLK, MCLK), so make sure your I2S chip takes those as inputs.

  5. #5
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    okay I will look more into that. Thank you

Posting Permissions

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