WiFi Transmit Slowed by using I2S Parallel with DMA

cammiboi
Posts: 6
Joined: Tue Feb 20, 2018 6:08 am

WiFi Transmit Slowed by using I2S Parallel with DMA

Postby cammiboi » Tue Feb 20, 2018 7:43 am

Hi there,

I am using the display driver given in this example: https://esp32.com/viewtopic.php?f=17&t=3188#p14940 and github here: https://github.com/ESP32DE/I2S_parallel ... 32_display
It uses the parallel mode of the I2S driver with DMA to drive an LED display.

My problem: transmitting TCP packets is very slow (several seconds, or not at all) when the I2S parallel driver is transmitting data. Receiving packets is ok.

I have checked this by pinging the ESP32 with my PC and it has a very slow response. Wireshark shows the same. I have also tried using an example web socket server, and the packets are received by the ESP32 fine, but transmitting has this same delay.

If I never enable the I2S paralell transmit, the problem goes away (the ESP32 ping reply arrives in ~12ms).

Part of i2s_paralell.c in the example I am using, commenting out the last line fixes the issue:

Code: Select all

    
    //Start dma on front buffer
    dev->lc_conf.val=I2S_OUT_DATA_BURST_EN | I2S_OUTDSCR_BURST_EN | I2S_OUT_DATA_BURST_EN;
    dev->out_link.addr=((uint32_t)(&st->dmadesc_a[0]));
    dev->out_link.start=1;
    dev->conf.tx_start=1; //commenting out this line fixes the issue with slow TCP transmission and slow ping replies
    
Is there some way the DMA used by I2S is interfering with the lwip output buffer or the wifi transmit buffer? I have looked at the lwip functions but I am getting lost. Any help or ideas would be appreciated!

stevenpostma
Posts: 3
Joined: Wed Aug 28, 2019 4:38 pm

Re: WiFi Transmit Slowed by using I2S Parallel with DMA

Postby stevenpostma » Fri Sep 27, 2019 4:22 pm

a late answer;

could it be that your WIFI connection is disturbed by the fast switching I2D clock and data signals?
the WIFI receiver must pick up millivolts or less in the presence of hard switching logic outputs that interfere.
A sharp rectangle signal has huge harmonics at 3*f, 5*f, 7*f, 11*f;
an unterminated digital signal probably will have worse harminics due to ringing.

So I would suggest to add a series terminating resistor of about 68 Ohms on all outputs,,
to keep all discrete wires short, make twisted pairs of one signal + one ground line for all I2S signals.
Try using ferrites (although that may cause timing problems). Try shielding with aluminium tape.

Just my 2 cents...

With greetings to you,
Steven

Who is online

Users browsing this forum: Baidu [Spider] and 87 guests