Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

implement 2 hardware SPI

i want to implement 2 hardware SPI communication in my code. i have one already working. talking with LCD ILI9341. the functions are using spi_write /  nrf_drv_spi_transfer for a single interface.  what do i need to do to add another (4 pin) SPI interface to communicate with accelerometer. do i need to change it to SPI1 and then duplicate everything to SPI2 ?

thanks

Yuval

Parents
  • I notice I am using pull-up on MISO, not sure if that is relevant. Did you get your setup working?

    // > P0.07 ACC-INT1    CNF: 0x00000000 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Connected ] [Dir: Input ] (now 0) (no map)
    // > P0.09 ACC-MISO    CNF: 0x0000000C [Sense: Off] [Drive: Normal] [Pull: P-Up] [Input: Connected ] [Dir: Input ] (now 1) (SPI2 MISO)
    // > P0.17 ACC-SCK     CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (SPI2 SCK)
    // > P0.19 ACC-MOSI    CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (SPI2 MOSI)
    // > P0.20 ACC-CS      CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (no map)
    

Reply
  • I notice I am using pull-up on MISO, not sure if that is relevant. Did you get your setup working?

    // > P0.07 ACC-INT1    CNF: 0x00000000 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Connected ] [Dir: Input ] (now 0) (no map)
    // > P0.09 ACC-MISO    CNF: 0x0000000C [Sense: Off] [Drive: Normal] [Pull: P-Up] [Input: Connected ] [Dir: Input ] (now 1) (SPI2 MISO)
    // > P0.17 ACC-SCK     CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (SPI2 SCK)
    // > P0.19 ACC-MOSI    CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (SPI2 MOSI)
    // > P0.20 ACC-CS      CNF: 0x00000003 [Sense: Off] [Drive: Normal] [Pull: None] [Input: Disconnect] [Dir: Output] (now 0) (no map)
    

Children
No Data
Related