SPH0645, I2S.h Output freezing up

Standard hookup and software. MKR WiFi 1010

The SPH0645 freezes up at random, sometimes as quickly as 2 seconds sometimes as long as an hour later.
I've tried commenting out the serial.begin().
I've tried various I2S_PHILIPS_MODE setups as well.
This happens on many different SPH0645s.

Any idea what's up?

The WDT (in my production code) resets and it works fine till it locks up again and times out.

The freeze in the:
line pretty sure about that.

Locks up with this test code

#include <I2S.h>

void setup() {
// Open serial communications and wait for port to open:
// A baud rate of 115200 is used instead of 9600 for a faster data rate
// on non-native USB ports
while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only
// start I2S at 16 kHz with 32-bits per sample
if (!I2S.begin(I2S_PHILIPS_MODE, 16000, 32)) {
Serial.println("Failed to initialize I2S!");
while (1); // do nothing
void loop() {
// read a sample
int sample = I2S.read();
if ((sample == 0) || (sample == -1)) {
// convert to 18 bit signed
sample >>= 14;
// if it's non-zero print value to serial

The I2S clock out of the MKR WiFi 1010 is stopping causing the SPH0645 to go in to sleep mode.
Which causes the watch dog to time out.
So, its not an SPH0645 issue.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.