| Electronic Components Datasheet Search |
|
AN3126 Datasheet(PDF) 20 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3126 Datasheet(HTML) 20 Page - STMicroelectronics |
|
20 / 24 page ![]() Application examples AN3126 20/24 Doc ID16895 Rev 2 Figure 16. Wave Player flowchart (*) when DMA is transferring data from one RAM buffer, CPU is transferring data from the MicroSD Flash memory to the other RAM buffer. ai18315 Enable DMA,TIM6,DAC clocks WavePlayer_menuStart() Config DAC channel 1 to be triggered by TIM6 TRGO Config DMA ch3 to transfer 512 bytes from wavBuffer1 to DAC ch1 8bit DHR register Enable DAC channel 1 and DMA connection Enable DAC channel 1 output Parse the .wav file to Check if it is a Valid file and Get all needed information from the .wav header. Display Error if .wav file status OK Connect TIM6 TRGO to its update event Enable TIM6 (start the Transfer from RAM to DAC) Enable DMA channel3 Configure the TIM6 frequency to have the correct .wav sample rate Initialize WaveDataLength with .wav file audible data size if WaveDataLength!= 0 Read 512 next bytes from the .wav file and Save them in wavBuffer2 (*) If DMA transfer from wavBuffer1 to DAC ch1 is completed (*) Clear DMA channel3 flag Decrement the WaveDataLength by 512 and if WaveDataLength < 512 then WaveDataLength = 0 Disable DMA , Config DMA to transfer 512 bytes from wavBuffer2 to DAC ch1 8bit DHR register, and enable DMA Read 512 next bytes from the .wav file and Save them in wavBuffer1 (*) If DMA transfer from wavBuffer2 to DAC ch1 is completed (*) Decrement the WaveDataLength by 512 and if WaveDataLength < 512 then WaveDataLength = 0 Clear DMA channel3 flag Disable DMA, Configure DMA transfer 512 bytes from wavBuffer1 to DAC ch1 8bit DHR register, and Enable DMA Disable DMA Exit Yes Yes Yes No No No |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |