This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

SDK11: SPI with CLK Output Input_Connect

Hi,

I was wondering if the SPI configuration for the p_config->sck_pin is correct. It appears that the clock is configured as output with input connected. Wouldn't this cause additional power consumption? And what is the use of such configuration?

NRF_GPIO->PIN_CNF[p_config->sck_pin] =
    (GPIO_PIN_CNF_DIR_Output        << GPIO_PIN_CNF_DIR_Pos)
  | (GPIO_PIN_CNF_INPUT_Connect     << GPIO_PIN_CNF_INPUT_Pos)
  | (GPIO_PIN_CNF_PULL_Disabled     << GPIO_PIN_CNF_PULL_Pos)
  | (GPIO_PIN_CNF_DRIVE_S0S1        << GPIO_PIN_CNF_DRIVE_Pos)
  | (GPIO_PIN_CNF_SENSE_Disabled    << GPIO_PIN_CNF_SENSE_Pos);

Thank you Marco

Parents
  • Hi Marco,

    It's explained in the comment just above the code :

    // Configure pins used by the peripheral:
    // - SCK - output with initial value corresponding with the SPI mode used:
    //   0 - for modes 0 and 1 (CPOL = 0), 1 - for modes 2 and 3 (CPOL = 1);
    //   according to the reference manual guidelines this pin and its input
    //   buffer must always be connected for the SPI to work.
    

    It's also stated section 48.1.1 in the product spec : The SCK must always be connected to a pin, and that pin's input buffer must always be connected for the SPI to work

    I'm not 100% sure reason deep inside why SPI requires that, but that what it is.

  • Good to know, however a week ago I have forced the SPI to be configured with GPIO_PIN_CNF_INPUT_Disconnect because I was concerned about the power consumption and I had no issues so far. I use it with NRF_DRV_SPI_MODE_0. It was just a bit strange to see the mismatch of GPIO_PIN_CNF_DIR_Output with GPIO_PIN_CNF_INPUT_Connect.

    Thank you.

Reply
  • Good to know, however a week ago I have forced the SPI to be configured with GPIO_PIN_CNF_INPUT_Disconnect because I was concerned about the power consumption and I had no issues so far. I use it with NRF_DRV_SPI_MODE_0. It was just a bit strange to see the mismatch of GPIO_PIN_CNF_DIR_Output with GPIO_PIN_CNF_INPUT_Connect.

    Thank you.

Children
No Data
Related