Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hello,
I am trying to configure my Device TMS570LS1227 as a Slave with MibSPI1, I didn't manage it yet.
I made the necessary configuration on Halcogen:
In MibSPI1 Tab:
MibSPI Global:
I Unchecked Master Mode and internal clock boxes to configure the device in slave mode.
MibSPI Port:
I Uchecked the direction boxes for CS and SIMO and CLK (Input configuration) and checked the ones for SOMI and ENA (Output configuration)
In PINMUX Tab:
I Checked MibSPI1 peripheral, and I fixed the conflict.
More information:
I am using 16 bits transmission word length, and 2 as length of transfer group, and I am using one shot transfer and Buffer mode 5.
My Master works properly after checking it with the oscilloscope.
This the main I am using in Code Composer Studio:
#include "sys_common.h"
#include "mibspi.h"
#include "system.h"
int main(void)
{
/* USER CODE BEGIN (3) */
uint16 tx[2]= {0x0077, 0x0001};
uint16 rx[2];
mibspiInit();
while (1)
{
mibspiGetData(mibspiREG1, 0, rx);
mibspiSetData(mibspiREG1, 0, tx);
mibspiTransfer(mibspiREG1, 0);
while(!(mibspiIsTransferComplete(mibspiREG1, 0)));
}
return 0;
}
The master receives nothing, and when I checked with the oscilloscope the SOMI Pin, I did't visualize any data (I was keeping the CLK and CS of the Master connected to the MCU) .
I managed very well to configure the device as a master with MibSPI1 before, but I didn't do as a slave.
Am I missing something or Have I something wrong ?
I didn't find an example for TMS570LS1227 device. the one in Halcogen for SPI looks different. If there is an example of CCS code, that would be great.
A quick reply would be highly appreciated. Thank you in advance!