2019-02-10 07:57 AM
Can you explain how to play wav file using internal DAC and how to set the frequency for wav file using timer.Since I am a beginner any help from you guys will be a great boon for me guys
2019-02-10 09:19 AM
Perhaps start by outputting a wave form, say a sine wave via the DAC. Create a table containing samples.
The TIM divides down an APB clock
OUTCLK = (TIMCLK / P) / Q; where Prescaler = P-1, and Period = Q-1
You should be able to factor this where the APB clock is say 40 MHz and you want 8 KHz sample clock.
40,000,000 / 8,000 = 5,000
P = 1, Q= 5000
Prescaler = 0, Period = 4999
If you sine table has 20 samples, a DAC triggered at 8000 Hz would give you a 400 Hz sine wave
Learn to do the simpler tasks, and then combine into more complicated ones.