Skip to content

Bug in SPI Clock Pin Configuration for the nrf #48

@T-joma

Description

@T-joma

Hello,
I assume that there is a bug in the SPI clock pin configuration for the nrf MCUs. The following pictures show the SPi settings and recorded transmission. The settings for the transmission are SPI_MODE_HIGH_FIRST = active High and Leading Edge = CPOL 0 and CPHA 0

You can see that there is a high on the clock pin before and after the transmission that should not be there.
I assume that the pin configuration in line 58 and 62 in the file "wm-sdk/mcu/nrf/common/hal/spi.c" needs to be swapped.

// Configure clock pin (depending on mode)
if (mode == SPI_MODE_LOW_FIRST || mode == SPI_MODE_LOW_SECOND)
{
nrf_gpio_pin_clear(BOARD_SPI_SCK_PIN);
}
else
{
nrf_gpio_pin_set(BOARD_SPI_SCK_PIN);
}

The picture below shows the recording of the SPI transmission with fixed clock pin configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions