Hello TI Team,
I am trying to communicate between a arduino uno and TMS570LC43x development kit board through SPI.
I followed some TI tutorials on how to set up SPI over HalCogen the only difference is I am using mibspi3. I then loaded the source/include files into code composer studio.
I developed the following code in the sys_main.c file for the TI Hercules device:
#include "HL_sys_common.h"
#include "HL_gio.h"
#include "HL_sys_vim.h"
/* USER CODE BEGIN (1) */
#include "HL_mibspi.h"
/* USER CODE END */
void main(void){
/* USER CODE BEGIN (3) */
mibspiInit();//initialize SPI
uint16_t txBuffer[]={0x0000, 0x0011, 0x0022, 0x0033, 0x0044, 0x0055, 0x0066, 0x0077, 0x0088, 0x0099};
uint16_t rxBuffer[10];//this paramter was set in HalCogen
mibspiSetData(mibspiREG3,0,txBuffer);//The length of the data must match the length of the transfer group
mibspiTransfer(mibspiREG3,0);//initiates transfer for specified transfer group
while(!(mibspiIsTransferComplete(mibspiREG3,0)));//checks if the transfer from the transfer group is finished.
mibspiGetData(mibspiREG3,0,rxBuffer);//takes receive information into the recieve buffer
/* USER CODE END */
}
On the arduino side I have the following code to receive the messages and print it on the serial window. However I only have 0x0099 recieved from the arduino. I expected each of the values in the txBuffer to be transimitted over SPI. Am I missing something?