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.
Tool/software: Code Composer Studio
Hi everyone,
I have a question concerning Simulink. Starling from MATLAB R2017b, Simulink can receive and send Nx1 vector from SPI interface, N can be 50, 100, etc but my processor's(f2808) RXFIFO and TXFIFO size is limited, which can hold 16x1 vector at one time. I verify this by checking the registers of the processor while SPI communication is happening. For instance, I send 50x1 vector from master to my slave(F2808), lets say numbers from 1 to 50 but in registers, I see the last 16 number, which are from 35 to 50. I think this is a huge problem. I am using R2018a version. I appreciate any help.
Hi,
You can use SPI Tx interrupt on the Tx FIFO to send the chunks of data inside the ISR.
For example if you have 50 data values, then you can split the data values in to 5*10.
Configure the Tx FIFO for depth of 10 and use a counter to count 5 sending 10 data values every time.
Configure the Tx FIFO for depth of 10 and use a counter to count 5 sending 10 data values every time.
-By ISR, do you mean that I should use SPIRXINT and SPITXINT?
-Will this mean to manually changing the generated code from Simulink in CCS or can I just simply configure this from Simulink model? PS:I know how to set Tx Interrupt level from Simulink model( Configuration Parameters). I just want to know if there is any way to use SPI Tx Interrupt level in the Simulink model. If there is a way, it would be really easy. If not, then I would have to manually change the code from CCS(by adding code to the model_step()).
-I understood what you try to say but wouldn't it be better first to make sure that slave side correctly receives 50x1 vector?
-Also will this mean to do 5 transmit processes against 1 receive process? But again I think I need to make sure that I receive the incoming vector correctly before transmitting something. Maybe same thought is vaild where RX Interrupt can be used and incoming vector can be read in 5 pieces as 10x1.