How to play a tone cyclically through SAI channel

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to play a tone cyclically through SAI channel

801 Views
BlackTurbo
Contributor III

Hi, I have a question about how to cyclically play a tone wav through SAI channel. Currently I'm using a RT1062 for my GUI application, one of the tone requirement is to play a beep sound continuousely once I keep a button pressed. But I don't know how to cyclically play the beep. Could someone help with it?

Thanks.

@markruthenbeck 

0 Kudos
3 Replies

796 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @BlackTurbo 

   Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

   If you want to cyclically play a tone wav, you can use the timer, when the time is reach, then you can trigger the SAI transfer.

   About the SAI transfer code, you can refer to the RT SDK:

SDK_2_10_0_EVK-MIMXRT1060\boards\evkmimxrt1060\driver_examples\sai\edma_transfer

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos

794 Views
BlackTurbo
Contributor III

Is the Scatter/gather feature (through eDMA TCD config) applied for this application?

0 Kudos

780 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @BlackTurbo ,

   Why you need to use the scatter/gather function?

   From the DMA scatter/gather function, you can see:

Scatter/gather is the process of automatically loading a new TCD into a channel. It allows
a DMA channel to use multiple TCDs; this enables a DMA channel to scatter the DMA
data to multiple destinations or gather it from multiple sources.

   But to you, your destination is the same SAI data buffer, not the multiple destination.

  So, you can refer to the SDK DMA SAI code, and transfer your SAI data, then in the other time(you can use timer to define your needed time), periodically send the data.

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos