Hi
I am using TMDX470MF066HDK eval board and try to use SPI for I2C control. I just write a 2 word length in buff and send it out. But I always watched 128 bit length data and clock from SPI2 pins. My source code as below:
unsigned short SPI_data[2]; for (i = 0 ; i <2 ; i++ ) { SPI_data[i]= 0xAA; }; spiSetData ( spiREG3 , 0 , SPI_data ); spiTransfer( spiREG3 , 0);
the green part is the waveform of SIMO and the red part is clock.
how do I send the 2 word only , not including the other (128 - 32) bits?
Sounds like you configure the wrong length of the transfer group 0 (TG)).
Please find the spi init routine, look for sth like:
/** - inialise transfer groups */
spiREG2->TGCTRL[0] = (1 << 30)
/* oneshot */
| (1 << 29)
/* pcurrent reset */
| (TRG_ALWAYS << 20)
/* trigger event */
| (TRG_DISABLED << 16)
/* trigger source */
| (0 << 8);
/* start buffer */
spiREG2->TGCTRL[1] = (1 << 30)
| (0 << 29)
| (8 << 8);
And please modify the red font into |2<<8)
Regards,
Haixiao
Haixiao,
Thanks, it works.
Legend