Other Parts Discussed in Thread: HALCOGEN
Hello.
I'm trying to test spi loop back in analog mode. I send an 1 byte data(any value), it returns 0 always. It works well in digital mode, I can receive an exact data what I send. I need some helps. This is my test code as below. I'm using CCS 6.0 and HALCoGen 4.0.1.
spiInit();
spiEnableLoopback(spiREG2, AnaLog_Lbk);
r = SPI_send(0xFF);
unsigned char SPI_send(unsigned char outb)
{
while((spiREG2->FLG & 0x0200) == 0);
spiREG2->DAT1 = outb | 0x100D0000;
while((spiREG2->FLG & 0x0100) == 0);
return((unsigned char)spiREG2->BUF);
}