Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DSPLIB ADPCM WAV player example Documentation

Introduction

This is a full example of a IMA/DVI ADPCM WAV decoder.
It uses the USART as a display to show wav file information and two mixed PWM to play through a 16 bits precision sample sound.
Through this page, you can access the DSP Library documentation.

Hardware Interface

Here is the hardware interface used to mixed the two PWM, to make them act as a 16 bits DAC.

pwm_to_dac_mixer.jpg
PWM to DAC mixer

Configuration

  • To change the PWM DAC channel, first identify which pins and functions are associated with the PWM channels and then modify the defines DAC_PWM_CHANNEL_LSB, DAC_PWM_CHANNEL_LSB_PIN, DAC_PWM_CHANNEL_LSB_FUNCTION, DAC_PWM_CHANNEL_MSB, DAC_PWM_CHANNEL_MSB_PIN and DAC_PWM_CHANNEL_MSB_FUNCTION.
  • To use another audio file, copy this file into the ADPCM_WAV_PLAYER directory where the sample file is already located. Then update the line
    .incbin "enterprise_ima-dvi.wav"
    in the file "load.S" (for GCC) or update the following field in the project options for IAR:
    iar_audio_file_update.jpg
    IAR audio file update

Compilation Information

This software is written for GNU GCC for 32-bit AVRs and for IAR Embedded Workbench for Atmel 32-bit AVR. Other compilers may or may not work.

Device Information

All 32-bit AVR devices with an USART, PWM and PDCA modules can be used.

Configuration Information

To make this example works, you will need a PC and a serial cable to connect the board to the PC.
This example has been tested with the following configuration:

  • EVK1100 or EVK1101 evaluation kit;
  • CPU clock: 12 MHz;
  • USART1 connected to a PC serial port via a standard RS232 DB9 cable.