Hello everyone,
I setup a 44,100 Hz timer to fill a buffer with data from an I2S microphone (SPH0645LM4H) however I get a core panic when running i2s_read_bytes() from inside the ISR, presumably it spends to much time there. Other methods I tried like running a simple task loop causes reliability issues and interferes with other parts of the program.
Can I read I2S data from the timer ISR? Or what is the preferred method for reading data continuously?
Andy
Reading I2S data in ISR
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: Reading I2S data in ISR
Don't call any functions that are non-trivial and not marked as ISR-callable (like the FreeRTOS *FromISR functions) in an ISR. Instead, handle the I2S reading in a task and use a semaphore to unblock the interrupt. (Or just spin a task to read the I2S data in the first place, i2s_read_bytes will block until there's data available so you don't actually need a timer if all you want is to read your microphone data.)
Who is online
Users browsing this forum: letter57 and 201 guests