Digital Signal Processing Reference
In-Depth Information
// DTMF_BIOS_RTDX.c Addtl. code to DTMF.c for RTDX version using VC++
#include <rtdx.h>
//RTDX support file
RTDX_CreateOutputChannel(ochan);
//output channel for DSK->PC
#define thresh 80000
//defines a threshold
short value = 0; short w = 0;
//used for RTDX version
.... see DTMF.c
if((weight1>thresh)&&(weight2>thresh)) //set threshold
if((choice1 == 1)&&(choice2 == 1)) { //button "1" -> 0001
DSK6713_LED_off(0);DSK6713_LED_off(1);DSK6713_LED_off(2);DSK6713_LED_on(3);
value = 1 ;
}
. . . //for button "2", "3",..., "*", "0"
if((choice1 == 4)&&(choice2 == 3)) { //button "#" -> 1100
DSK6713_LED_on(0);DSK6713_LED_on(1);DSK6713_LED_off(2);DSK6713_LED_off(3);
value = 12;
}
} //end of if > than the threshold value (see DTM
else { //weights below threshold, turn LEDs off
DSK6713_LED_off(0);DSK6713_LED_off(1);DSK6713_LED_off(2);DSK6713_LED_off(3);
value = 0;
}
w = w + 1;
if w > 50;
{
w = 0;
RTDX_write(&ochan,&value,sizeof(value));//send value to PC
}
return;
}
//end of interrupt service routine
void main()
{
. . . as in DTMF.c
comm_intr();
while(!RTDX_isOutputEnabled(&ochan))
puts("\n\n Waiting . . . "); //wait for output channel->enabled
while(1);
//infinite loop
}
( a )
( b )
FIGURE 10.3. ( a ) Core C program to detect DTMF signals with RTDX for PC-DSK inter-
face ( dtmf_BIOS_RTDX.c ); ( b ) PC screen displaying detected DTMF signals with RTDX
for PC-DSK interface.
Search WWH ::




Custom Search