This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to make communication between nordic and msp430 by spi interfaces?

Hi Team,

I am working on a project. It requires nordic chips (slaves) to communicate with msp430 (master). I use the nordic example SPIS as the initial code of the nordic part. And use the example SPI code as the initial code on msp430. I observe they can receive signals between them. But the content is wrong totally. I don't the reasons. So, Can you provide a example how to communicate with msp430 chips by spi interfaces?

Gaosheng

Parents
  • Hello,

    What SDK (nRF5 SDK or nRF Connect SDK) are you using, and what version?

    Since you didn't mention it, I'll take a guess, and you can correct me if you are using something else.

    I assume you are using the nRF5 SDK v17.1.0. Did you check out the SPIS example from SDK\examples\peripheral\spis\pca10056\blank\<your IDE>?

    in main(), where it initalizes the spis:

        nrf_drv_spis_config_t spis_config = NRF_DRV_SPIS_DEFAULT_CONFIG;
        spis_config.csn_pin               = APP_SPIS_CS_PIN;
        spis_config.miso_pin              = APP_SPIS_MISO_PIN;
        spis_config.mosi_pin              = APP_SPIS_MOSI_PIN;
        spis_config.sck_pin               = APP_SPIS_SCK_PIN;
    		spis_config.mode = 
    
        APP_ERROR_CHECK(nrf_drv_spis_init(&spis, &spis_config, spis_event_handler));

    the nrf_drv_spis_config_t  struct has a parameter called "nrf_spis_mode_t mode". Try the different modes to see whether your master is using a different mode than the default mode used by the nRF (NRF_SPIS_MODE_0) by testing these:

    typedef enum
    {
        NRF_SPIS_MODE_0, ///< SCK active high, sample on leading edge of clock.
        NRF_SPIS_MODE_1, ///< SCK active high, sample on trailing edge of clock.
        NRF_SPIS_MODE_2, ///< SCK active low, sample on leading edge of clock.
        NRF_SPIS_MODE_3  ///< SCK active low, sample on trailing edge of clock.
    } nrf_spis_mode_t;

    If that doesn't work, what frequency is the SPI from your master using?

    Best regards,

    Edvin

  • Hi Edvin,

    I tried all modes, they all failed. In my project, the master's frequency is 16 MHz or 1 MHz.

    So, what's your advice?

    Best,

    Gaosheng

Reply Children
No Data
Related