User`s guide

MPLAB Starter Kit for dsPIC
®
DSCs User’s Guide
DS51700A-page 10 © 2008 Microchip Technology Inc.
2.2 UNDERSTANDING THE DEMO
The dsPIC33F device on the starter kit is pre-programmed with a Speech Record and
Playback Demonstration application. The CD that accompanies the starter kit contains
the application code. As shown in Figure 2-1, this sample application uses the board to
capture an input microphone signal using the audio codec. The application program
running on the device does the following:
Reads an introductory speech message stored on the serial Flash memory and
uses the audio codec to play back the audio signal.
If speech recording is desired, the application compresses the incoming digital
signal from 16 bits to 8 bits using the G.711 μ-law encoding algorithm and stores
the encoded speech samples on the serial flash memory.
If playback is desired, the application reads the serial Flash memory device and
decodes the read samples using the G.711 μ-law decoding algorithm. The
application then uses the audio codec to play back the speech signal.
FIGURE 2-1: SPEECH RECORD AND PLAYBACK DEMO OVERVIEW
The board also features circuitry for audio playback using the Pulse-Width Modulation
technique. This technique can be used to implement a low-cost audio playback system.
For a demo of this technique, access the starter kit’s CD-ROM.
The demo program consists of three basic software elements: WM8510 Codec Driver,
G.711 Speech Encoder and Decoder, and Serial Flash Memory Driver.
2.2.1 WM8510 Codec Driver
The WM8510 Codec Driver configures the WM8510 audio codec and provides an inter-
face for reading and writing audio data to the codec. The driver is implemented in
WM8510CodecDrv.c and the interface is defined in WM8510CodecDrv.h. The driver
uses the DCI module on the dsPIC33F device module to process data and the I
2
C™
module as a codec control bus. The demo application configures the codec for a 8 KHz
sampling rate.
G.711
μ-LAW
ENCODE
DCI
dsPIC33F
STARTER KIT BOARD
AUDIO
CODEC
G.711
μ-LAW
DECODE
Serial Flash Memory
SPI
Data
Control
I
2
C™