Other Parts Discussed in Thread: SYSCONFIG
Hello,
I am trying to setup an SPI communication between two TMS320F280049C launchpads at 10Mbps. At the moment, I am working only on one with the loopback feature just for learning sake while I wait for the second board to be delivered.
I am configuring the board on sysconfig and I everytime I run the debugger with a configurated bitrate higher than ∼6MHz the code returns an assert error (ESTOP0). I am aware that the bit rate can't be higher than LSPCLK/4 but the LSPCLK set on the board is 100MHz and therefore I should be able to obtain maximum 25MHz of bit rate. Therefore I should be able to set easily 10MHz bit rate. Where am I missing something? How can I solve my problem?
I attach my code, the pictures of my configuration and of the error:
// // 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++; } }
The code is a simple loopback of a number called "write_data" which is incremented each cycle. The "read_data" is just the looped back value of "write_data".
In the two images there is only the configuration gui of the SPI peripheral and of the clock tree of my board.
The last picture is about the debugger view and where I am led when I resume the code.
Thank you in advance for your help .
Kind regards,
Edoardo