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.

CCS/TMS570LC4357: MIBSPI5 setup for parallel mode

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello,

I'm working on a project where we want to use the AD7266 from Analog Devices to convert two analog values at the same time and transmit them to the TMS570LC4357 via SPI. 

Therefore I'm trying to set up the Mibspi5 Channel in parallel mode but couldn't manage to get the expected results by now.

I used the generated HW-drivers from HALCoGen, but I'm not certain how the procedure in my main has to look like.

Is there an example anywhere?

I tried it like this but I think there must be something missing.

If I use DATA_FORMAT0 in mibspiPmodeSet, the value of TG0_RX_DATA is always at its maximum and if I use one of the other DATA_FORMATs I get the right result but only the one from SOMI0, no parallelism to see.I chose Data Format 0 in HALCoGen, so I think that should be rigt this way, but there has to be more to do than just executing this one funiktion...

Also I'm wondering, do I see the updated RXBUFFER value after  the shift-register is completely filled in my TG0_RX_DATA or do I have to look elsewhere? I planned to use some kind of a for loop four times triggered by the RXINT flag to get the final result splitted in four variables, would that be the right way to do this?

I would be really glad, if you can help me to solve my problem.

Thanks,

Sarah

#include "HL_sys_common.h"
#include "HL_system.h"
#include "HL_sys_dma.h"
#include "HL_mibspi.h"

uint16 TG0_RX_DATA[1];
uint16 txBuffer[] ={0};

int main(void)
{
	   /* - initializing mibspi - enabling tg 0*/
	   mibspiInit();

	   mibspiPmodeSet(mibspiREG5, PMODE_4_DATALINE, DATA_FORMAT0);		                //to get somi3 into rxbuffer 4 line parallel spi

	   
	   while(1)
	   {
		   mibspiSetData(mibspiREG5, 0, txBuffer);						//set the mibspi transfer tg 0

		   mibspiTransfer(mibspiREG5, 0);							//start the mibspi transfer tg 0


		   while(!(mibspiIsTransferComplete(mibspiREG5, 0)));			                //wait until transfer is complete

		   mibspiGetData(mibspiREG5,0, TG0_RX_DATA);						//get data from mibspi transfer group 0

	   }

    return 0;
}