EE 451

Lab 2: Sampling and Aliasing in Real Time with the Motorola DSP56002 EVM

For experimentation in real-time signal processing, we will use the following equipment:

• Motorola DSP56002 EVM, with a sampling rate of 48 kHz.

• An oscilloscope.

• A function generator.

• A source of audio (e.g., a CD player with headphones).

1. Use the 56000 assembly-language program play.asm. To assemble this, first copy the files ada_init.asm and txrx_isr.asm from the C:\EVM directory to your directory. The codec is a complicated chip, and these pre-written routines do the work necessary to sample the input signal. This will be discussed further in lab.

Assemble the program using the following command:

ASM56000 -a -b -l lab2.asm

2. Set the function generator to give a 2-volt peak-to-peak, 5 kHz sine wave. Connect the output with the mono cable to the input of the A/D converter. Connect the outputs of the D/A converter to two channels of an oscilloscope. Run the program EVM56K on the PC. Give the command load lab2, which will load the attached program into the 56002. The command disassemble $40 should show you the instructions as loaded into the 56002. go $40 will run the program. The two outputs should look the same.

3. Vary the frequency of the function generator, and observe the response of the D/A converter.

4. Connect your audio source to the input of the A/D. Listen to the output through headphones. Note the quality of the sound.

5. Stop the 56002. Modify the program to put out the left channel every sample interval, but put out the right channel only every 12th sample interval. This output of the right channel will then have a sampling rate of 4 kHz. The easiest way to do this is with a DO instruction. Set up the DO instruction to read execute the sampling code 11 times without putting the input value into Accumulator B, then add sampling code to put the input value into both A and B, and finally loop back to the DO instruction.

Connect the function generator back to the A/D, and run this modified program. Vary the frequency of the function generator, and compare the two outputs of the D/A converter. Observe aliasing for high frequencies. At what frequency does aliasing begin?

6. Modify the above program so both channels put out every 48th sample, giving a sampling frequency of 1 kHz. Connect your audio source to the input of the A/D. Listen to the output through headphones. Note the quality of the sound.

;****************************************************************************
;PLAY:
;WILL PASS AUDIO FROM LEFT CHANNEL STRAIGHT THROUGH TO
;BOTH LEFT AND RIGHT CHANNELS
;***************************************************************************

START   EQU     $40
org     p:$0
jmp     START
org     p:$000c
jsr     ssi_rx_isr      ;SSI receive data
jsr     ssi_rx_isr      ;SSI receive data with exception
jsr     ssi_tx_isr      ;SSI transmit data
jsr     ssi_tx_isr      ;SSI transmit with exception
org     p:START
movep   #$261009,x:PLL  ;these labels are defined in the
movep   #0000,x:BCR     ;ada_init.asm program
ori     #3,mr           ;mask interrupts
movec   #0,sp           ;clear hardware stack pointer
move    #0,omr          ;operating mode 0
move    #$40,r6         ; initialise stack pointer
move    #-1,m6          ; linear addressing
include 'ada_init.asm'
TONE_OUTPUT     EQU     HEADPHONE_EN+LINEOUT_EN+(4*LEFT_ATTN)+(4*RIGHT_ATTN)
TONE_INPUT      EQU     MIC_IN_SELECT+(15*MONITOR_ATTN)
loop_1
jset    #2,x:SSISR,*    ;wait for frame sync to pass
jclr    #2,x:SSISR,*    ;wait for frame sync
move    x:RX_BUFF_BASE,a        ;receive left
move    x:RX_BUFF_BASE,b        ;receive left
move    a,x:TX_BUFF_BASE        ;transmit left
move    b,x:TX_BUFF_BASE+1      ;transmit right

move    #TONE_OUTPUT,y0         ;set up control words
move    y0,x:TX_BUFF_BASE+2
move    #TONE_INPUT,y0
move    y0,x:TX_BUFF_BASE+3
nop
jmp     loop_1                  ;go back to the beginning
include 'txrx_isr.asm'
end