Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in SPI Clock Pin Configuration for the nrf #48

Open
T-joma opened this issue Mar 23, 2022 · 1 comment
Open

Bug in SPI Clock Pin Configuration for the nrf #48

T-joma opened this issue Mar 23, 2022 · 1 comment

Comments

@T-joma
Copy link

T-joma commented Mar 23, 2022

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.

@electrokean
Copy link

Encountered the same issue.

The incorrect initial pin state causes an extra clock pulse because we are not currently using chip select.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants