cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

New Contributor II

I was wondering how does one play samples? The first thing I'd like to achieve is to play a sine wave from a waveform sample. I wonder if I can do that or is there a simpler way?

   

Store raw audio in EEPROM -> drive DMA with clock or PWM -> pipe DMA output to DAC 

   

If there are any examples or application notes on this, I'd really appreciate that! Also, can I play audio from external memory (as in SD card)?

0 Likes
Reply
4 Replies
Employee

Hello,

   

We do not have an example for PSoC5LP. But please have a look at the obsoleted AN regarding PSoC1, (Link:http://www.cypress.com/file/327276/download).You can follow same implementation.

   

Thanks,

   

Hima

0 Likes
Reply
New Contributor II

Excellent, thank you! I'd love to see more audio-related articles, PSoC is perfect for such tasks. 

0 Likes
Reply
New Contributor II

I figured the easiest way to do it is to read wav (raw audio) from one of the memory locations (SRAM, EEPROM, etc.), pipe it through the DMA which is triggered (request) by clock signal to DAC: memory-->DMA-->DAC. However when using the DMA Wizard, it asks for two parameters I don't know: 'length' and 'source' in the transaction descriptor. How do I define the source and the length? 

0 Likes
Reply
Honored Contributor II

You can use RAM-DMA-VDAC8 example http://www.cypress.com/comment/358351#comment-358351 The issue with DMA is max transfer length of 4095, so you have to chain DMA for long music samples (hint - at audio frequencies CPU is sufficient to play short sounds).

   

 

   

Another thread on same subject might be informative (but not instructive):

   

http://www.cypress.com/comment/344636#comment-344636

0 Likes
Reply