cancel
Showing results for 
Search instead for 
Did you mean: 

How to feed both i2s channel with DMA

ad ho
Associate III
Posted on August 08, 2017 at 16:55

The original post was too long to process during our migration. Please click on the attachment to read the original post.
1 ACCEPTED SOLUTION

Accepted Solutions
ad ho
Associate III
Posted on August 14, 2017 at 14:30

Okay, I found the mistake, I was expecting my DMA to be 16bits as I programmed i2s so, and did not see that data bit was actually in word. I have been confused as this parameter is not in the main and forgot about it.

View solution in original post

5 REPLIES 5
Posted on August 08, 2017 at 17:58

I2S naturally contains both channels so there's something wrong in your setup.

Observe WS versus CK directly on the codec's pins.

JW

Posted on August 09, 2017 at 09:22

Hi Jan,

Yes you are right, the fact that make me think that it is a software issue is that I checked the I2S bus with a logic analyser. WS is correctly balancing left right, CK is much faster as expected and the data is corresponding to the analog value -> right a nice sinus, left wierd semi periodical signal.

But what I don't understand, if we take the problem reversly, if I had to send two different signal on the two channels, how would I proceed? 

In 

HAL_I2S_Transmit_DMA(&hi2s2, (uint16_t*) sine_table, 512); I don't see any reference about the second channel, is it suposed to be in the sine_table? I tried to put [sin0, 0, sin1, 0, sin2, 0] as if the data where [L0, R0, L1, R1, ...] but then the right channel was not clean anymore.

I think I have not totally understood the concept...

Posted on August 09, 2017 at 11:12

I tried to put [sin0, 0, sin1, 0, sin2, 0] as if the data where [L0, R0, L1, R1, ...]

Yes that's exactly how are they supposed to be.

but then the right channel was not clean anymore.

This is why I say something is wrong in your setup. Is the CODEC set properly for I2S/Philips? FMT pin?

CK is much faster

Is it exactly 16 x WS?

JW

Posted on August 09, 2017 at 11:45

I would say yes to all your comments but I will dig into those directions next week (few days off). 

Thanks for the clarification!

ad ho
Associate III
Posted on August 14, 2017 at 14:30

Okay, I found the mistake, I was expecting my DMA to be 16bits as I programmed i2s so, and did not see that data bit was actually in word. I have been confused as this parameter is not in the main and forgot about it.