This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
我正在尝试以10Mbps 的速率在两个 TMS320F280049C LaunchPad 之间设置 SPI 通信。 目前、我只使用一个带环回功能的插件、仅供学习、而等待第二个板交付。
我将在 SysConfig 上配置板、每次我以高于 ∼6MHz 的配置比特率运行调试器时、代码都会返回一个断言错误 (ESTOP0)。 我知道比特率不能高于 LSPCLK/4、但板上设置的 LSPCLK 为100 MHz、因此我应该能够获得最大25 MHz 的比特率。 因此、我应该能够轻松设置10MHz 比特率。 我在哪里漏了一些东西? 如何解决我的问题?
我附加了我的代码、 配置图片和错误图片:
// // Included Files // #include "driverlib.h" #include "device.h" #include "board.h" #include "c2000ware_libraries.h" // // Global Variables // uint16_t write_data = 0; uint16_t read_data = 0; // // Main // void main(void) { // // Initialize device clock and peripherals // Device_init(); // // Disable pin locks and enable internal pull-ups. // Device_initGPIO(); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // PinMux and Peripheral Initialization // Board_init(); // // C2000Ware Library initialization // C2000Ware_libraries_init(); // // Enable Global Interrupt (INTM) and real time interrupt (DBGM) // EINT; ERTM; while(1) { // TX (non blocking) SPI_writeDataNonBlocking(mySPI0_BASE, write_data); // RX (blocking nonFIFO) read_data = SPI_readDataBlockingNonFIFO(mySPI0_BASE); // Error check if (read_data != write_data) { ESTOP0; } write_data++; } }
该代码是对一个 名为"write_data"的数字的简单回送、该数字每个周期递增。 "read_data"只是 looped back 值"write_data"。
在这两个图像中、只有 SPI 外设的配置 GUI 和我的电路板的时钟树的配置 GUI。
最后一张图片介绍了调试器视图、以及我在继续代码时所处的位置。
提前感谢您的帮助。
此致、
Edoardo
Edoardo,
您是否在 SysConfig 中启用了器件支持? 如果"Generated Source"不包含 device.c 和 device.h、则 clocktree.h 设置不会生效。
图1:显示了如何启用器件支持
图2:显示了使用 SysConfig 生成的源代码中的 device.c /.h
图3:显示了从编译中排除的 device.c 和 f28004x_codestartbranch.asm
图1:
图2:
图3:
执行图1/2/3中的步骤来使项目运行。
此致、
Manoj
尊敬的 Manoj:
非常感谢!! 现在它可以工作了!
我已经和你解释的一样了。 为了向其他人澄清问题、我执行了以下步骤:
1)在 SysConfig 中激活了"设备支持"功能;
2)通过右键单击旧的"device.c"和"codestartbranch.asm"文件并选择 exclude 选项、手动从项目资源管理器中排除这些文件(如果没有此步骤、编译器会出现错误);
3) 3)构建了工程。
现在一切都像你发送的照片。
再次感谢您的帮助、祝您愉快。
此致、
Edoardo