ESP32-S3 I2S DMA Interrupt

bnarit
Posts: 9
Joined: Fri Dec 09, 2022 9:41 am

ESP32-S3 I2S DMA Interrupt

Postby bnarit » Fri Dec 09, 2022 9:51 am

I'm trying to get started on ESP32-S3 I2S DMA with interrupt.

I have success on ESP32-S3 I2S with polling using i2s_write. However, it doesn't ensure that the tx data is transported orderly. Interrupt would be a better option.

I have tried on ESP32 I2S successfully with DMA and Interrupt. But since the IDF 4.4+ changed the register, for ex, I cannot find any "I2S0.lc_conf", Is there any reference to this?

In IDF4.4 manual, it doesn't show any I2S interrupt example. Have anyone can provide this information or example?

Best Regard
Narit

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 I2S DMA Interrupt

Postby ESP_Sprite » Sat Dec 10, 2022 2:44 am

bnarit wrote:
Fri Dec 09, 2022 9:51 am
I have success on ESP32-S3 I2S with polling using i2s_write. However, it doesn't ensure that the tx data is transported orderly. Interrupt would be a better option.
Can you explain what you mean by that? Generally, if you use the driver, there's no need to use interrupts, so I'm wondering what issue you're running into.

bnarit
Posts: 9
Joined: Fri Dec 09, 2022 9:41 am

Re: ESP32-S3 I2S DMA Interrupt

Postby bnarit » Sat Dec 10, 2022 10:53 am

I want to use I2S to periodically generate a synthesis signal, outgoing, with high speed.

Filling the tx buffer from tasking using RTOS is workable, but I believe it is more stable to use the interrupt sending by switching between transmission queues.

RTOS can handle only 10+ ms with good stability. I have tried to reach sub-millisec but the core seems to be panicky.

In my case, the transmission must not be missed. It is not audio but the control signal, so using the interrupt as in the IDF3.x would be more stable.

So I wish we could find some mapping or any register or any example in IDF4.x+ that has I2S DMA+interrupt capability.

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 I2S DMA Interrupt

Postby ESP_Sprite » Sun Dec 11, 2022 1:58 am

Honestly, I'd use the driver. Using interrupts isn't really more stable than that, as the driver itself uses that mechanism as well to switch buffers. If you do want to use an interrupt to handle things, you could look into the functions the i2s_hal provides, but I'm not sure if this is inter-operable with the actual driver; you may need to build your own driver from scratch if you go that route.

bnarit
Posts: 9
Joined: Fri Dec 09, 2022 9:41 am

Re: ESP32-S3 I2S DMA Interrupt

Postby bnarit » Sun Dec 11, 2022 3:44 am

Yes, that was my intention.

Thx.

bnarit
Posts: 9
Joined: Fri Dec 09, 2022 9:41 am

Re: ESP32-S3 I2S DMA Interrupt

Postby bnarit » Mon Dec 26, 2022 9:26 am

We have tried the I2S Driver, but is seems to have some glitch.

What we are trying to do is use I2S to control the motor, which requires a constant time loop for feedback control.

We need an interrupt that refills and tricks periodically.

We also reference to I2SOut of FluidNC in ESP32.
Could you please suggest us, How can we implement the interrupt I2S as shown in FluidNC code in ESP32S3?

https://github.com/bdring/FluidNC/blob/ ... I2SOut.cpp

Who is online

Users browsing this forum: DrMickeyLauer and 57 guests