课程设计---基于tms320f2812dsp处理器的信号仪的设计与实现内容摘要:

void main(void) { int i,p,data。 // Step 1. Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the file. InitSysCtrl()。 // Step 2. Initalize GPIO: // This example function is found in the file and // illustrates how to set the GPIO to it39。 s default state. // InitGpio()。 // Skipped for this example // Setup only the GP I/O only for SPI functionality EALLOW。 =0x000F。 // Select GPIOs to be SPI pins // Port F MUX x000 0000 0000 1111 EDIS。 // Step 3. Clear all interrupts and initialize PIE vector table: // Disable CPU interrupts DINT。 // Initialize PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // This function is found in the file. InitPieCtrl()。 // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0x0000。 IFR = 0x0000。 // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // This will populate the entire table, even if the interrupt // is not used in this example. This is useful for debug purposes. // The shell ISR routines are found in . // This function is found in . InitPieVectTable()。 // Step 4. Initialize all the Device Peripherals: // This function is found in // InitPeripherals()。 // Not required for this example // spi_fifo_init()。 // Initialize the Spi FIFO spi_init()。 // init SPI for(i=0。 i128。 i++) { /*产生 128 个点的正弦信号波形 */ data=(int)(*(1+sin(2*pi*i/127)))。 curve[i]=data。 /*将数据打包成“从移位寄存器到 DAC A数据寄存器 */ curve1[i]=dataa。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。