nRF53840 SPI1 maximum clock rate?

Greetings,

What's the maximum clock rate supported by the SPI1 interface on an nRF52840?  My DTS overlay indicates it should use 32MHZ for one device and 8MHz for the other.  However, the first device is getting a clock at 8 instead of 32MHz.

Thanks,

Dave

Parents
  • Hi,

    On the nRF52840, not all SPI instances support a 32 MHz clock. There are two different SPI peripherals:

    1. SPI (legacy SPI, no EasyDMA): maximum 8 MHz
    2. SPIM (SPI master with EasyDMA)
      1. SPIM0 / SPIM1 / SPIM2: maximum 8 MHz
      2. SPIM3 only: supports up to 32 MHz

    So. If your device is bound to a legacy SPI peripheral, it will always be limited to 8 MHz, regardless of the DTS value. Moreover if in your DTS it is using SPIM0/SPIM1/SPIM2, it will still be limited to 8 MHz. Only SPIM3 supports 32 MHz, so to use 32 MHz the device must be connected to SPIM3, and that instance must be enabled in the devicetree. You can verify this by checking your DTS / overlay and the final generated devicetree (build/zephyr/zephyr.dts) to see which hardware block your SPI node is actually mapped to.

    Best Regards,
    Syed Maysum

Reply
  • Hi,

    On the nRF52840, not all SPI instances support a 32 MHz clock. There are two different SPI peripherals:

    1. SPI (legacy SPI, no EasyDMA): maximum 8 MHz
    2. SPIM (SPI master with EasyDMA)
      1. SPIM0 / SPIM1 / SPIM2: maximum 8 MHz
      2. SPIM3 only: supports up to 32 MHz

    So. If your device is bound to a legacy SPI peripheral, it will always be limited to 8 MHz, regardless of the DTS value. Moreover if in your DTS it is using SPIM0/SPIM1/SPIM2, it will still be limited to 8 MHz. Only SPIM3 supports 32 MHz, so to use 32 MHz the device must be connected to SPIM3, and that instance must be enabled in the devicetree. You can verify this by checking your DTS / overlay and the final generated devicetree (build/zephyr/zephyr.dts) to see which hardware block your SPI node is actually mapped to.

    Best Regards,
    Syed Maysum

Children
Related