- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a problem programming the Superspeed Explorer Kit.
I want to send 4 buffer of 200 Byte using spi. Sometimes happen that the clock 'pause' itself for ~20us and then restart whit the correct data.
I tried different frequencies, I disabled the CyU3PDebugPrint() function and I tried to build the project in Release mode but nothing changes.
I attach the code and also an oscilloscope screenshot whit the error.
CyFxSpiInit();
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(spi_cmd,1);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_1,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_2,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_3,200);
CyU3PSpiSetSsnLine(CyTrue);
CyU3PBusyWait(200);
CyU3PSpiSetSsnLine(CyFalse);
CyU3PSpiTransmitWords(mosi_buff_4,200);
CyU3PSpiSetSsnLine(CyTrue);
Here the CyFxSpiInit() function:
CyU3PReturnStatus_t
CyFxSpiInit (void)
{
CyU3PSpiConfig_t spiConfig;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
/* Start the SPI module and configure the master. */
status = CyU3PSpiInit();
if (status != CY_U3P_SUCCESS)
{
return status;
}
CyU3PMemSet ((uint8_t *)&spiConfig, 0, sizeof(spiConfig));
spiConfig.isLsbFirst = CyFalse;
spiConfig.cpol = CyFalse;//CyTrue;
spiConfig.cpha = CyFalse;//CyTrue;
spiConfig.ssnPol = CyFalse;
spiConfig.leadTime = CY_U3P_SPI_SSN_LAG_LEAD_ONE_HALF_CLK;
spiConfig.lagTime = CY_U3P_SPI_SSN_LAG_LEAD_ONE_HALF_CLK;
spiConfig.ssnCtrl = CY_U3P_SPI_SSN_CTRL_FW;
spiConfig.clock = 8000000 ;
spiConfig.wordLen = 8;
status = CyU3PSpiSetConfig (&spiConfig, NULL);
return status;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please try using the attached library and let me know if you face the issue again. Please note that the SCK may still go to idle state, but the data loss should be avoided.
Best Regards,
Jayakrishna
Jayakrishna