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

CPB default SPI pins incorrect #3582

Closed
jerryneedell opened this issue Oct 21, 2020 · 1 comment
Closed

CPB default SPI pins incorrect #3582

jerryneedell opened this issue Oct 21, 2020 · 1 comment
Milestone

Comments

@jerryneedell
Copy link
Collaborator

jerryneedell commented Oct 21, 2020

The pin definitions in mpconfigboard.h do not match those in pins.c

using board.SPI() will get the wrong pins.

https://github.com/adafruit/circuitpython/blob/main/ports/nrf/boards/circuitplayground_bluefruit/pins.c#L10

    { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_02) },
    { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_02) },
    { MP_ROM_QSTR(MP_QSTR_SCK),  MP_ROM_PTR(&pin_P0_02) },

    { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_29) },
    { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_29) },
    { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_29) },

    { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_03) },
    { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_03) },
    { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_03) },

https://github.com/adafruit/circuitpython/blob/main/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h#L62

#define DEFAULT_SPI_BUS_SCK         (&pin_P0_05)
#define DEFAULT_SPI_BUS_MOSI        (&pin_P1_03)
#define DEFAULT_SPI_BUS_MISO        (&pin_P0_29)

SDA and SCK are in conflict

#define DEFAULT_I2C_BUS_SDA         (&pin_P0_05)

#define DEFAULT_SPI_BUS_SCK         (&pin_P0_05)

SCK should be P0_02
MOSI should be P0_03

I tried changing the definitions and now board.SPI() works -- I'll submit a PR.

@jerryneedell
Copy link
Collaborator Author

Closed by #3590

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

Successfully merging a pull request may close this issue.

2 participants