Several TMS320C2X/C5X C language program development examples[Copy link]
Write a TMS320C50 program with interrupt function in C language and debug it with hardware simulator. /*This program is a serial port input and output program of TMS320C50. TMS320C50 is connected to PCM codec MC14LC5480 through serial port. The interrupt routine reads 8 bits of data from the serial port and writes it back to the serial port*/ #define VEC_ADDR(volatile int * )0x00; /*vector address*/ Fvolatile int * RCV_ADD=(volatile int *)0x20; /*C50 serial port receive register address*/ volatile int * XMT_ADD=(volatile int *)0x21; /*C50 serial port transmit register address*/ int indata; /*define global variables*/ main() { volatile int * INTVEC=VEC_ADDR; /*vector pointer*/ INTVEC[]=(volatile int)c_int5; /*set serial port receive interrupt vector*/ /*initialize serial port*/ asm("SPLK #0CH,SPC "); /*F0=FSM=1,DLB=MCM=TXM=0*/ asm("OPL #0C0H,SPC "); /*XRST=RRST=1*/ for(;;); /*Wait for interrupt*/ } void c_int5() /*Serial port receive interrupt*/ { indata=RCV_ADD[0]; XMT_ADD[0]=indata;