I2S using DMA with an LPC4333

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

I2S using DMA with an LPC4333

跳至解决方案
1,502 次查看
jonathansmith
Contributor III

I want to be able to send sine wave data to an external DAC through I2S0. I have the I2S interface working (using I2S interrupts) but this is causing too much disruption to some legacy comms code, so I want to try DMA.

From what I've read, I think it should be possible to write my sine wave data to contiguous memory. Then setup a DMA transfer to the I2S peripheral to transfer the data. Once this transfer completes, then trigger the DMA interrupt where I can send the sine wave data again. Have I got the right idea? The reason I ask this is that I can't seem to be able to get it to work. Is there a better way to do this?

I'm using the 'DMA routine for DAC example' in the dac.c example code in kocopen, as a basis for my code. 

标签 (2)
0 项奖励
回复
1 解答
1,341 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jonathan Smith,

- There is a I2S-DMA demo under LPCopen, you can download it at

LPCOpen Software for LPC43XX|NXP .

- About the sequence of memory-to-peripheral DMA flow, you can  take a look at LPC43XX User Manual

"

memory-to-peripheral DMA flow,

1. Program and enable the DMA channel.
2. Wait for a DMA request.
3. The DMA Controller starts transferring data when:
– The DMA request goes active.
– The DMA stream has the highest pending priority.
– The DMA Controller is the bus master of the AHB bus.
4. If an error occurs while transferring the data, an error interrupt is generated and
disables the DMA stream, and the flow sequence ends.
5. Decrement the transfer count if the DMA Controller is performing the flow control.
6. If the transfer has completed (indicated by the transfer count reaching 0, if the DMA
Controller is performing flow control, or by the peripheral sending a DMA request, if
the peripheral is performing flow control):
– The DMA Controller responds with a DMA acknowledge.
– The terminal count interrupt is generated (this interrupt can be masked).
– If the CLLI Register is not 0, then reload the CSRCADDR, CDESTADDR, CLLI,
and CCONTROL registers and go to back to step 2.

"

- After refer to above , if still have question about this, please describe the issue in detail, DMA didn't

transfer data ? Or only transfer some of data ? Or some other problem.

Hope it helps,


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

1 回复
1,342 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jonathan Smith,

- There is a I2S-DMA demo under LPCopen, you can download it at

LPCOpen Software for LPC43XX|NXP .

- About the sequence of memory-to-peripheral DMA flow, you can  take a look at LPC43XX User Manual

"

memory-to-peripheral DMA flow,

1. Program and enable the DMA channel.
2. Wait for a DMA request.
3. The DMA Controller starts transferring data when:
– The DMA request goes active.
– The DMA stream has the highest pending priority.
– The DMA Controller is the bus master of the AHB bus.
4. If an error occurs while transferring the data, an error interrupt is generated and
disables the DMA stream, and the flow sequence ends.
5. Decrement the transfer count if the DMA Controller is performing the flow control.
6. If the transfer has completed (indicated by the transfer count reaching 0, if the DMA
Controller is performing flow control, or by the peripheral sending a DMA request, if
the peripheral is performing flow control):
– The DMA Controller responds with a DMA acknowledge.
– The terminal count interrupt is generated (this interrupt can be masked).
– If the CLLI Register is not 0, then reload the CSRCADDR, CDESTADDR, CLLI,
and CCONTROL registers and go to back to step 2.

"

- After refer to above , if still have question about this, please describe the issue in detail, DMA didn't

transfer data ? Or only transfer some of data ? Or some other problem.

Hope it helps,


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------