include DSP 281 xDevice h DSP 281 x

  • Slides: 11
Download presentation

//---------頭文件-------------------// #include "DSP 281 x_Device. h" // DSP 281 x Headerfile Include File #include

//---------頭文件-------------------// #include "DSP 281 x_Device. h" // DSP 281 x Headerfile Include File #include "DSP 281 x_Examples. h" // DSP 281 x Examples Include File //---------主程序-------------------// void main(void) { int i; volatile unsigned int *room = (volatile unsigned int *)0 x 3 f 9020; volatile unsigned int *room 2= (volatile unsigned int *)0 x 3 f 902 F; // Initialize System Control: // PLL, Watch. Dog, enable Peripheral Clocks Init. Sys. Ctrl(); // Disable CPU interrupts DINT; // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0 x 0000; IFR = 0 x 0000;

for(; ; ) { /*xf管腳置低*/ asm(" clrc xf"); for(p=0; p<10000; p++) for(q=0; q<100; q++);

for(; ; ) { /*xf管腳置低*/ asm(" clrc xf"); for(p=0; p<10000; p++) for(q=0; q<100; q++); /*xf管腳置高*/ asm(" setc xf"); for(p=0; p<10000; p++) for(q=0; q<100; q++); } }