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.

TMS470MF06607: TMS470MF06607 SPI driver

Part Number: TMS470MF06607
Other Parts Discussed in Thread: ADS1220, HALCOGEN

Hi,

i am using TMS470MF06607 microcontroller.

i am trying to do SPI communication on this controller with ADS1220 ic.

For generate the MIBSPI1 driver i am using the HALCOGEN.  There is no example for this micro.

i didn't change any default setting in the HALCOGEN. only one change i did it in MIBSPI1 GROUP 0-7   , here i changed that length of the buffer from zero to eight.

i enabled the vim channel interrupt also.

what ever the code i written for the MIBSPI1  it's not working. because i checked that clock pin. i did not get the continues pulses.

i copied my code in down side. if any problem in my program means please help to me to correct it.

otherwise if any example code is available for TMS470MF06607     spi communication ( MIBSPI1) can you please share that one to me.

program:

#include "sys_common.h"
//#include "sys_core.h"
#include "spi.h"
//#include "system.h"
//#include "sys_vim.h"

#include "sys_common.h"
#include "system.h"
#include "rti.h"

#include "sys_vim.h"

#include "esm.h"


uint16 TG0_TX_DATA[8] = {0x1000, 0x1111, 0x1222, 0x1333, 0x1444, 0x1555, 0x1666, 0x1777};
uint16 TG0_RX_DATA[8]= {0};

uint16 TG1_TX_DATA[8] = {0x2000, 0x2111, 0x2222, 0x2333, 0x2444, 0x2555, 0x2666, 0x2777};
uint16 TG1_RX_DATA[8]= {0};

uint16 TG2_TX_DATA[8] = {0x3000, 0x3111, 0x3222, 0x3333, 0x3444, 0x3555, 0x3666, 0x3777};
uint16 TG2_RX_DATA[8]= {0};

uint16 TG3_TX_DATA[8] = {0x4000, 0x4111, 0x4222, 0x4333, 0x4444, 0x4555, 0x4666, 0x4777};
uint16 TG3_RX_DATA[8]= {0};

uint32_t TG3_IS_Complete;

void main(void)
{

TG3_IS_Complete = 0x55555555;

/* Enable IRQ Interrupt in Cortex R4 CPU */
_enable_interrupts();

spiInit();


/* Enable TG 0,1,2,3 complete interrupt to INT 0 */
spiEnableGroupNotification(spiREG1,0,0);

/* Fill the transfer Groups */
spiSetData(spiREG1,0,TG0_TX_DATA);


/* Enable TG0 to start, once tickCNT triggers */
spiTransfer(spiREG1,0);


/* Configure TICKCNT *
* DATA FORMAT 0 is selected which has SPICLK set as 1000KHz *
* So tick is 0xFFFF * (1/1000KHz) = 65.5535 msec*/

spiREG1->TICKCNT = 0x8000FFFF;

/* Wait until this flag is set in TG3 ISR */
while(TG3_IS_Complete != 0xA5A5A5A5);
spiGetData(spiREG1,0,TG0_RX_DATA);


while(1);


}


#pragma WEAK(spiGroupNotification)
void spiGroupNotification(spiBASE_t *spi, uint32 group)
{

switch (group)
{
case 0 :
/* Enable TG1 to start, SW Trigger */
spiTransfer(spiREG1,1);
break;
case 1 : /* Enable TG1 to start, SW Trigger */
spiTransfer(spiREG1,2);
break;
case 2 : /* Enable TG1 to start, SW Trigger */
spiTransfer(spiREG1,3);
break;
case 3 :
TG3_IS_Complete = 0xA5A5A5A5;
break;
default :
while(1);
break;
}

}