//PCCOM.CPP PC - TMS320C31 COMMUNICATION TO MULTIPLY TWO NUMBERS #include "dsklib.h" //contains several header files char DSK_APP[]="C31COM.OUT"; char DSK_EXE[]="PCCOM.EXE"; void config_dsk_for_comm() { MSGS err; //enumerated message for looking up messages clrscr(); Scan_Command_line(DSK_EXE); Detect_Windows(); // Download the communications kernel for(;;) { if(Init_Communication(10000) == NO_ERR) break; if(kbhit()) exit(0); } HALT_CPU(); //load applications code if((err=Load_File(DSK_APP,LOAD))!=NO_ERR) { printf("%s %s\n",DSK_APP,Error_Strg(err)); exit(0); } RUN_CPU(); //DSK is initialized & able to communicate clrscr(); } void main() { char ch[10]; unsigned long hostdata = 0; config_dsk_for_comm(); do { clrscr(); printf("Enter a number to transmit to C31 to be multiplied by 2\n"); scanf ("%ld", &hostdata); putmem(0x809800L, 1, &hostdata); printf("The value written to the DSK is %ld. \n", hostdata); hostdata = 0; getmem(0x809801L, 1, &hostdata); printf("The value returned by the DSK is %ld. \n", hostdata); printf ("Press 'Y' to continue or 'Q' to Quit. \n"); scanf("%s", &ch); } while (toupper(ch[0]) != 'Q'); }