Skip to content

CPB default SPI pins incorrect #3582

@jerryneedell

Description

@jerryneedell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions