After skimming through the SAMD21 datasheet I saw that the chip can support 1 I2S interface. My understanding is that the SERCOM are somewhat flexible. Can they be modified in code to get one I2S or is it completely disabled in this board?
The ATSAMD21G18 Support Inter-IC Sound (I2S) interface, from my search it also routed XIOA Board, I don’t about software support, but since XIAO have the debug port, we might can enable that.
I2S Pin list from the ATSAMD21G18 Datasheet
XIAO Schematic marked the I2S Pins.
Thank you for that information. I have been thinking about this and as you point out there is a debug port. So I wonder if the pin definitions are selected in the software kit from manufacturer and that is initialized in the bootloader. I know that if you use STM32 software to create firmware you can manipulate what interfaces to include in the design, for example do you want 2 SPI interfaces then you can deactivate other interfaces like lets say if the UART conflicts with a second SPI then you deactivate it. I have to admit I don’t have any particular need for a I2S on the XIAO but thank you again for looking into it, whoknows maybe I’ll have a real need for it later.
I would really like to use an I2S MEMS microphone with the XIAO, does anyone know if it’s possible? I don’t fully understand the posts above…
I know the chip is capable, and it looks like the I2S Pins highlighted in the XIAO schematic are connected to some GPIO, but I’m not sure if there is additional configuration needed. Any help or pointers appreciated, as there is not much information out there yet it seems.
@BrianMoseley Does this meet your requirements?
Thank you @Baozhu. I will investigate that now to see if I can make use of some of those functions.
My aim is to monitor sound pressure levels and analyse pitch using FFT, rather than record audio. Size is very important, that’s why I am interested in using the XIAO over larger boards. I currently do this with an analog input, but would much rather switch to I2S.
As always, the best starting point is example sketches, but both the Seeeduino XIAO > I2S ones return this error
\AppData\Local\Arduino15\packages\Seeeduino\hardware\samd\1.7.9\libraries\I2S\src/I2S.h:111:2: error: #error “I2S is not supported on your board!”
The I2S.h library only seems to support arduino boards, so I don’t know if there’s another that does. I will do more investigating…
@BrianMoseley If you don’t mind switching hardware, I think this one suits you better.
Thanks @Baozhu, for performance and functionality, you are absolutely correct! That looks brilliant, but unfortunately my project is miniature, so the XIAO is the board I will have to use. I already have it all up and running with analog audio, I would just rather switch to digital I2S, if possible.
I have done as much research as I can and I now have I2S enabled, pins allocated correctly and the example sketch in Arduino IDE running fine, but get nothing back from the mic. I have amended variant.h, tried changing SERCOM and the I2S library, but am way out of my depth now.
I think it probably needs someone cleverer than me to make a new I2S library that works with this board. Unless, of course, it is not possible with this hardware…
Any updates on this?
@JoDu I never did get it to work. I ended up making my own mini custom board based around the ESP-WROOM-32 module. That way I could make use of the ESP32 I2S library. It works well, but the XIAO would have been much cheaper and simpler!
Thanks for the reply - looks like I’m marching down a similar path that you were. I’ll check out that module. Take care!