Hello,
I am configuring transfer groups to utilize chipselect 1 for MibSPI3. I was able to get MibSPI3 with chipselect 0 working for the loopback test. When I configure transfer group 1 to utilize chipselect 1, the loopback test fails.
I configured transfer groups 0 and 1 as:
I made sure cs0 and cs1 pins are functional:
The below is that test code I am utilizing to access transfer group 1. Note: spiInit() is invoked earlier.
uint8 mibspiTest = PASS; int i; /* - creating a data chunk in system ram to start with ... */ loadDataPattern(D_SIZE,&TX_DATA[0]); /* - enabling loopback ( this is to emulate data transfer without external wires */ mibspiEnableInternalLoopback(mibspiREG3); /* - assigning dma request: channel-0 with request line - 1 */ dmaReqAssign(0,15 ); /* - configuring dma control packets */ dmaConfigCtrlPacket((uint32)(&TX_DATA),(uint32)(&(mibspiRAM3->tx[0].data)),D_SIZE); /* upto 32 control packets are supported. */ /* - setting dma control packets */ dmaSetCtrlPacket(DMA_CH0,g_dmaCTRLPKT); /* - setting the dma channel to trigger on h/w request */ dmaSetChEnable(DMA_CH0, DMA_HW); /* - configuring the mibspi dma , channel 0 , tx line -0 , rxline -1 */ /* - refer to the device data sheet dma request source for mibspi tx/rx */ mibspiDmaConfig(mibspiREG3,0,0,15); /* - enabling dma module */ dmaEnable(); /* - start the mibspi transfer tg 1 */ mibspiTransfer(mibspiREG3,1 ); /* ... wait until transfer complete */ while(!(mibspiIsTransferComplete(mibspiREG3,1))) { }; /* copy from mibspi ram to sys ram */ mibspiGetData(mibspiREG3, 1, RX_DATA); for (i = 0;i < D_SIZE; i++) { if (TX_DATA[i] != RX_DATA[i]) { mibspiTest = FAIL; } } if (mibspiTest == PASS) { sciSend (scilinREG, 48 , (unsigned char *) "\r\nMIBSPI Test Loopback .................. PASS\r\n"); } else { sciSend (scilinREG, 48 , (unsigned char *) "\r\nMIBSPI Test Loopback .................. FAIL\r\n"); }
What am I missing?