How can I pull down a MOSI pin in SPI?

I am using a nRF5340 with two SPI (master) outputs configured. I am only concerned with the MOSI line on both SPIs because I am driving WS2814 Addressable LED Strips and they are driven only using SPI MOSI lines. The issue I am having is one of my MOSI lines (my_spi_master2: &spi4) default state is HIGH. So when no data is being transmitted, the MOSI pin is measuring 3.3V. I need the default pin level to be 0V to drive the LEDs. 

The other MOSI (my_spi_master: &spi1) pin is working correctly, and the pin is LOW when no data is being transmitted.

Here is my .overlay:

1122.nrf5340dk_nrf5340_cpuapp.overlay

Good MOSI - (my_spi_master: &spi1):

Bad MOSI - (my_spi_master2: &spi4)I:

Zephyr version 3.1.99

NCS version: v2.1.3

Parents
  • Hello,

    I suspect that the MOSI line is just left wherever the last bit ended. Could that be the case? Are you sending the same data when using SPI1 and SPI4?

    Perhaps you can try to attach a 0xFF or 0x00 at the end of the bytes you are trying to send? That should set it high or low, if that is the case. 

    I must admit I have not seen anyone doing this in NCS/Zephyr, but I see that there are quite a lot of posts on the nRF5 SDK + neopixel LEDs. Have you checked out any of those? I am not saying you need to use the nRF5 SDK, but perhaps you can find someone with a similar issue.

    BR,
    Edvin

Reply
  • Hello,

    I suspect that the MOSI line is just left wherever the last bit ended. Could that be the case? Are you sending the same data when using SPI1 and SPI4?

    Perhaps you can try to attach a 0xFF or 0x00 at the end of the bytes you are trying to send? That should set it high or low, if that is the case. 

    I must admit I have not seen anyone doing this in NCS/Zephyr, but I see that there are quite a lot of posts on the nRF5 SDK + neopixel LEDs. Have you checked out any of those? I am not saying you need to use the nRF5 SDK, but perhaps you can find someone with a similar issue.

    BR,
    Edvin

Children
Related