This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

In SPI slave, MISO doesn't work

HW environment :

  • SPI Slave : PCA10028 board, and reference source code is 'peripheral/spi_slave' in SDK9.0.0
  • SPI Master : Arduino UNO

Pin setting is below

SPIS_MISO_PIN 28 // SPI MISO signal.

SPIS_CSN_PIN 12 // SPI CSN signal.

SPIS_MOSI_PIN 25 // SPI MOSI signal.

SPIS_SCK_PIN 29 // SPI SCK signal.

I believe there was no pin wiring mistake between two board.

And I could find a code of 'p_tx_buf[i] = (uint8_t)('a' + i);' in the function of 'spi_slave_buffers_init', inside the project 'spi_slave'.

So pca10028 board is believed to send some character pattern like "abcdef...". through MISO line.

But there is no signal from MISO at all.

image description

MOSI signal is "hello' with setting of LSB, 1MHz. And it seems no problem. I've tested UNO part source code with another UNO board as a spi slave, and it had no problem.

But now it's not working. I don't understand this situation. Do I have to set the clock of spi slave? if so, how?

  • I followed your instruction(level 0 optimization), but debugging can not be activated.

    << Here I paste "compiler control string" of mine. >>

    -c --cpu Cortex-M0 -D__EVAL -D__MICROLIB -g -O0 --apcs=interwork --split_sections -I....\config -I.... -I........\bsp -I..........\components\drivers_nrf\spi_slave -I..........\components\device -I..........\components\toolchain -I..........\components\libraries\button -I..........\components\drivers_nrf\gpiote -I..........\components\drivers_nrf\config -I..........\components\libraries\util -I..........\components\drivers_nrf\common -I..........\components\drivers_nrf\hal -I..........\components\libraries\timer -I..........\components\drivers_nrf\nrf_soc_nosd -IF:\Keil_v5\ARM\Pack\ARM\CMSIS\4.3.0\CMSIS\Include --c99 -I F:\Keil_v5\ARM\RV31\INC -I F:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="515" -DBOARD_PCA10028 -DNRF51 -DSWI_DISABLE0 -o "._build*.o" --omf_browse "._build*.crf" --depend "._build*.d"

Related