| Electronic Components Datasheet Search |
|
AN2394 Datasheet(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2394 Datasheet(HTML) 5 Page - STMicroelectronics |
|
5 / 13 page ![]() AN2394 Audio playback 5/13 Where: OCBR: Output Compare B register value Prescaler: Timer clock prescaler TTimer : period of the Timer clock that drives the Prescaler. The value set in the OCAR determines the duty-cycle: Ton = OCAR * Prescaler * TTimer dcycle = (Ton/ T)*100 = (OCAR / OCBR) *100 % Where: OCAR: Output Compare A register value Figure 2. Typical PWM signal waveform 2.2 Audio playback Before the audio data can be played, the header must be parsed so that the sampling rate of the data and its length can be determined. The task of reproducing audio is achieved by using sampled data (data contained in the .WAV file) to vary the duty cycle of the PWM signal who’s period is held at a constant value. The duty cycle represents the ratio of the pulse width to the pulse period, i.e. it represents the ratio of the OCAR value to the OCBR one. As the duty cycle varies according to the values of the sampled data and this data is coded in 8 bits (with values from 0 to 255), the OCBR value must be set to 255 and the OCAR value fills with the sampled data values (the OCAR value varies from 0 to 255). In this manner the duty cycle varies from 0% to 100%. The OCAR value is updated at intervals specified by the SysTimer period which is equal to the sample rate of the .WAV file. The PWM output signal is then fed to a simple RC low-pass filter to generate an output voltage directly proportional to the average time spent in the HIGH state (i.e., 50% duty cycle is equal to 1.65V when VDD = 3.3V). When this is averaged over time, we get a reasonable reproduction of the original analog signal. There are several design considerations involved in the selection of the cut-off frequency of the low-pass filter. Primarily, the filter cut-off frequency must be much lower than the PWM frequency to reduce the noise generated by PWM switching. A PWM frequency of 10 times the cut-off frequency is a generally sufficient. However, the cut-off frequency of the filter is critical to the bandwidth of the output audio. In addition, it is recommended, on the basis of the Nyquist Criterion, that the cut-off frequency of any filter used be set at half the frequency of the sample playback rate. Since in T Ton t PWM Output T Ton T Ton dcycle = 50% dcycle = 25% dcycle = 75% |
|
|
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 |