i2s parallel only works with one dma descriptor
Posted: Tue Nov 26, 2019 1:06 am
Hi,
I am developing my own i2s paralle 8 bits with dma library(static allocation memory).
When i write to the parallel port using only one descriptor(4092 uint8_t), the clock time to send, for example, 1000 uint8_t at 10 MHz is 100 microseconds(1000/10 000 000).
Apparently all ok with only one descriptor.
When i use more than one descriptor, the clock time to send, for example, 7680 uint8_t at 10 MHz is 1536 microseconds.
Should be half of this value 768 microseconds( 7680 / 10 000 000 ). I don't know why it's taking twice as long.
In annex follow an oscilloscope image of 7680 uint8_t at 10 MHz.
The yellow waveform are the clock(10MHz).
The blue waveform are the D0 channel data.
I initialize the buffer with zeros, but in D0 channel appears some weird data.
Also with only one descriptor, each time that i send the data i perform these instructions( partial code below ):
I2SX.conf.tx_start = 0; // Set this bit to start transmitting data. (R/W).
I2SX.conf.tx_reset = 1; // Set this bit to reset the transmitter. (R/W)
I2SX.conf.tx_reset = 0; // Set this bit to reset the transmitter. (R/W)
I2SX.fifo_conf.dscr_en = 0; // Set this bit to enable I2S DMA mode. (R/W).
Partial code below: VVVV
Right now i'm not using i2s module interrupt.
Could this be the problem ?
Any other suggestions is appreciated.
Thank's.
I am developing my own i2s paralle 8 bits with dma library(static allocation memory).
When i write to the parallel port using only one descriptor(4092 uint8_t), the clock time to send, for example, 1000 uint8_t at 10 MHz is 100 microseconds(1000/10 000 000).
Apparently all ok with only one descriptor.
When i use more than one descriptor, the clock time to send, for example, 7680 uint8_t at 10 MHz is 1536 microseconds.
Should be half of this value 768 microseconds( 7680 / 10 000 000 ). I don't know why it's taking twice as long.
In annex follow an oscilloscope image of 7680 uint8_t at 10 MHz.
The yellow waveform are the clock(10MHz).
The blue waveform are the D0 channel data.
I initialize the buffer with zeros, but in D0 channel appears some weird data.
Also with only one descriptor, each time that i send the data i perform these instructions( partial code below ):
I2SX.conf.tx_start = 0; // Set this bit to start transmitting data. (R/W).
I2SX.conf.tx_reset = 1; // Set this bit to reset the transmitter. (R/W)
I2SX.conf.tx_reset = 0; // Set this bit to reset the transmitter. (R/W)
I2SX.fifo_conf.dscr_en = 0; // Set this bit to enable I2S DMA mode. (R/W).
Partial code below: VVVV
Code: Select all
fill_dma_descriptor_b( (uint32_t) 4 * length ); // fill_dma_descriptor_b( length ); lenght in bytes.
I2SX.out_link.addr = (uint32_t) &dma_desc_buf_b[0];
I2SX.out_link.start = 1; // Set this bit to start outlink descriptor. (R/W).
I2SX.fifo_conf.dscr_en = 1; // Set this bit to enable I2S DMA mode. (R/W).
I2SX.conf.tx_start = 1; // Set this bit to start transmitting data. (R/W).
while ( ! ( I2SX.state.tx_idle ) ) // The status bit of the transmitter. 1: the transmitter is idle. 0: the transmitter is busy.(RO)
{ }
I2SX.conf.tx_start = 0; // Set this bit to start transmitting data. (R/W).
I2SX.conf.tx_reset = 1; // Set this bit to reset the transmitter. (R/W)
I2SX.conf.tx_reset = 0; // Set this bit to reset the transmitter. (R/W)
I2SX.fifo_conf.dscr_en = 0; // Set this bit to enable I2S DMA mode. (R/W).
Right now i'm not using i2s module interrupt.
Could this be the problem ?
Any other suggestions is appreciated.
Thank's.