Hi,
I want to use SPI1 in 4-pin master mode in transmit operation. I use the PSP drivers (v1.20) together with the OMAP-L137 EVM from Spectrum Digital. PINMUX and PSC should be correctly configured. On the scope I see the clock and the data correctly, but no chip select.
Did I forget to configure something or did I configure something wrong? Could you please help? Thank you very much. I need some urgent help.
Here's what I do...
static void spi_initParams(void) {
spiParams = Spi_PARAMS;
spiParams.hwiNumber = 8;
spiParams.spiHWCfgData.intrLevel = FALSE;
spiParams.opMode = Spi_OpMode_DMAINTERRUPT;
spiParams.outputClkFreq = 1000000;
spiParams.loopbackEnabled = FALSE;
spiParams.edmaHandle = NULL;
spiParams.spiHWCfgData.pinOpModes = Spi_PinOpMode_SPISCS_4PIN;
spiParams.spiHWCfgData.configDatafmt[0].charLength = 16; /* 8bit Addr + 8bit Data */
spiParams.spiHWCfgData.configDatafmt[1].charLength = 16;
spiParams.spiHWCfgData.configDatafmt[0].clkHigh = TRUE ;
spiParams.spiHWCfgData.configDatafmt[0].lsbFirst = FALSE;
spiParams.spiHWCfgData.configDatafmt[0].oddParity = FALSE;
spiParams.spiHWCfgData.configDatafmt[0].parityEnable = FALSE ;
spiParams.spiHWCfgData.configDatafmt[0].phaseIn = FALSE ;
spiParams.spiHWCfgData.configDatafmt[0].waitEnable = FALSE;
//spiParams.spiHWCfgData.configDatafmt[0].wdelay = 0;
spiParams.spiHWCfgData.intrLevel = TRUE;
/* power on the spi device in the Power sleep controller */
Psc_ModuleClkCtrl(Psc_DevId_1, PSC_LPSC_SPI1, TRUE);
}
static void start_spi() {
GIO_Attrs gioAttrs = GIO_ATTRS;
Spi_ChanParams chanParams;
//...
edmaResult = edma3init();
//...
chanParams.hEdma = hEdma;
/* create SPI channel for transmission */
spiHandle = GIO_create("/Spi1",IOM_INOUT,NULL,&chanParams,&gioAttrs);
//...
return;
}
static Int spi_fpga_send_serial() {
Spi_DataParam dataparam;
size_t size = 0;
// clear the input and output buffers
memset(loopWrite, 0x00, sizeof(loopWrite));
// clear the spi params data structure
memset(&dataparam,0x00, sizeof(Spi_DataParam));
loopWrite[0] = 0x92;
dataparam.bufLen = 0x01;
dataparam.inBuffer = NULL;
dataparam.outBuffer = &loopWrite[0];
dataparam.dataFormat = Spi_DataFormat_0;
size = dataparam.bufLen;
// write program to FPGA
GIO_write(spiHandle, &dataparam, &size);
return 0;
}