- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to get the SCB SPI interface working with a CY8CKIT-046 because on my actual project I have to use this method rather than the regular non-SCB SPI interface. On this devkit, if I use non-SCB, I can recieve data just fine, but if I use the same pins or even a different set, and use the SCB SPI interface on both configured and unconfigured, I can't get it to receive any data packets from the other SPI device that is spamming out data every half second. What is the difference between the two interfaces?
When I follow the debugger, I notice that when it goes into SPI_1_SpiInit(&config) and then into SPI_1_SetPins, there is a section that says it disables the input buffer:
#if (SPI_1_TX_SDA_MISO_PIN)
/* Disable input buffer */
pinsInBuf |= SPI_1_TX_SDA_MISO_PIN_MASK;
and then used in
#if (SPI_1_TX_SDA_MISO_PIN)
SPI_1_SET_HSIOM_SEL(SPI_1_TX_SDA_MISO_HSIOM_REG,
SPI_1_TX_SDA_MISO_HSIOM_MASK,
SPI_1_TX_SDA_MISO_HSIOM_POS,
hsiomSel[SPI_1_TX_SDA_MISO_PIN_INDEX]);
I can't see anywhere that it is re-enabled, and I have tried editing this value at runtime to see if it makes a difference by just keeping it enabled, and whether I add the other pin masks to the value or set it all to 0, it doesn't do anything. Here is my setup configuration.
SPI_1_SPI_INIT_STRUCT conf;
memcpy(&conf,&SPI_1_configSpi,sizeof(SPI_1_SPI_INIT_STRUCT));
conf.mode = SPI_1_SPI_SLAVE;
conf.submode = SPI_1_SPI_MODE_MOTOROLA;
conf.sclkMode = SPI_1_SPI_SCLK_CPHA0_CPOL0;
conf.rxBufferSize = 32u;
conf.rxBuffer = buffer;
conf.txBufferSize = 32u;
conf.txBuffer = txbuffer;
conf.enableInterrupt = 1u;
conf.rxInterruptMask = SPI_1_INTR_RX_NOT_EMPTY | SPI_1_INTR_RX_FULL;
SPI_1_SpiInit(&conf);
Any Ideas?
Solved! Go to Solution.
- Labels:
-
ispn:39616:1:0
-
l1:314:1:0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Refer the example projects(SCB SPI) available in the creator . That will be a good starting point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Refer the example projects(SCB SPI) available in the creator . That will be a good starting point.