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

NRF52832 SPI (master) SCLK :SPI send data some byte sometimes there are only seven signals

Hi

 My English is not very good, but I encountered a problem that could not be solved. Please forgive me if there is any improper expression in grammar.

When  SPI sending data, sometimes there are only seven signals.

SDK_16.0.0.

Parents
  • Try this after init:

        APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
        // Boost drive to MOSI and MCLK to sharpen clock edges and timing
        nrf_gpio_cfg(RC522_SPI_MOSI_PIN, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
        nrf_gpio_cfg(RC522_SPI_CLK_PIN,  NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
    }

    The reason is likely that the logic analyser/'scope is hiding information from you, the edges are really not as sharp as displayed and the timing is too sloppy with S0S1 drive levels at 1MHz. I posted a similar response here strange-mosi-behaviour-on-spi2

Reply
  • Try this after init:

        APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
        // Boost drive to MOSI and MCLK to sharpen clock edges and timing
        nrf_gpio_cfg(RC522_SPI_MOSI_PIN, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
        nrf_gpio_cfg(RC522_SPI_CLK_PIN,  NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_H0H1, NRF_GPIO_PIN_NOSENSE);
    }

    The reason is likely that the logic analyser/'scope is hiding information from you, the edges are really not as sharp as displayed and the timing is too sloppy with S0S1 drive levels at 1MHz. I posted a similar response here strange-mosi-behaviour-on-spi2

Children
Related