| Electronic Components Datasheet Search |
|
AN2394 Datasheet(PDF) 4 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2394 Datasheet(HTML) 4 Page - STMicroelectronics |
|
4 / 13 page ![]() Audio playback AN2394 4/13 2 Audio playback The audio playback requires two dedicated timers: ● Timer used as system timer, SysTimer: generates an interrupt at a programmable rate (fixed by the .WAV file sample rate value). ● Timer used in PWM mode. This timer should be able to produce high frequency PWM signal. The .WAV file data can be stored in a compatible SPI-based Flash (requiring an SPI interface), in internal Flash memory (if the chosen STR7/SRT9 MCU has sufficient capacity) or on any other external memory type supported by the microcontroller . The audio playback flow is presented in the following figure: Figure 1. Audio playback flow To playback the audio, the microcontroller reads each 8-bit sample and then outputs it to a digital-to-analog converter (DAC) at the desired sample rate. The analog wave produced by the DAC is amplified and fed to a speaker to produce the sound. As the STR7/STR9 MCU doesn't have an on-chip DAC, an alternative method is used to implement 1 channel DAC. Such a method is the use of the built-in Pulse Width Modulation (PWM) module to generate a signal whose pulse width is proportional to the amplitude of the sample data. The PWM output signal is then integrated by a low-pass filter to remove high frequency components, leaving only the low-frequency content. The output of the low- pass filter provides a reasonable reproduction of the original analog signal. 2.1 STR7/STR9 PWM description This section introduces the basic concepts of the PWM mode of the STR7/STR9 TIMER (TIM). Pulse Width Modulation (PWM) consists of a signal with a fixed period whose duty cycle is variable. The duty cycle represent the ratio of ON period to the period of the signal. For the TIM, the PWM period and duty cycle are determined by the value of the OCAR and OCBR registers. The PWM output signal period is fixed by the OCBR which determines the maximum value that the counter can count before starting a new period: T = OCBR * Prescaler * TTimer STR7/STR9 PWM Low-Pass filter Audio Amplifier Speaker External Memory, example: SPI Flash .WAV .WAV Internal Flash OR |
|
|
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 |