Electronic Components Datasheet Search
  English  ▼

X  

AN3126 Datasheet(PDF) 20 Page - STMicroelectronics

Part # AN3126
Description  Audio and waveform generation using the DAC in STM32 microcontrollers
PDF  24 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3126 Datasheet(HTML) 20 Page - STMicroelectronics

Back Button AN3126 Datasheet HTML 16Page - STMicroelectronics AN3126 Datasheet HTML 17Page - STMicroelectronics AN3126 Datasheet HTML 18Page - STMicroelectronics AN3126 Datasheet HTML 19Page - STMicroelectronics AN3126 Datasheet HTML 20Page - STMicroelectronics AN3126 Datasheet HTML 21Page - STMicroelectronics AN3126 Datasheet HTML 22Page - STMicroelectronics AN3126 Datasheet HTML 23Page - STMicroelectronics AN3126 Datasheet HTML 24Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 20 / 24 page
background image
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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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