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

Add new nRF port for SF MicroMod nRF52840. #4350

Merged
merged 7 commits into from
Mar 11, 2021
Merged

Add new nRF port for SF MicroMod nRF52840. #4350

merged 7 commits into from
Mar 11, 2021

Conversation

nitz
Copy link

@nitz nitz commented Mar 7, 2021

Hello my favorite purple snake folx!

I've added the SparkFun MicroMod nRF52840. I'm opening this PR as a draft, because I don't have a PID to use. Gonna try to get in touch with someone from SparkFun and see if they've got some PIDs they'd like to use for the bootloader & CircuitPython. As well, I've got a draft PR for the bootloader open here, which I'm also waiting to see if I can get PIDs from SparkFun for too.

I figured I'd go ahead and open this up here in case anyone wanted to take a peek and find where I made mistakes. (Or to help with wording in the readme.)

Hope everyone is doing well. 💖

@tannewt tannewt added board New board or update to a single board nordic labels Mar 8, 2021
@nitz nitz marked this pull request as ready for review March 9, 2021 17:55
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR update! Just a few comments. I want to make sure and get the pinout style solid since we'll end up copying this for other micromods.

@nitz
Copy link
Author

nitz commented Mar 9, 2021

So, regarding the QSPI pins, I think I'm losing some hair with how they're named.

Here's what I have in pins.c now:

    // QSPI, used by flash on this board, but is broken out on MicroMod connector.
    { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_P0_19) },  // 0.00 - IOSCK | Flash Serial Clock
    { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_P0_14) }, // 0.00 - IO0 | Flash Data 0
    { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_P0_21) }, // 0.00 - IO1 | Flash Data 1
    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_P0_23) },// 0.00 - IO2 | Flash Data 2
    { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_P1_00) },   // 0.00 - IO3 | Flash Data 3

And yeah, the data pins are named, in order: SPI_SCK1, SPI_COPI1/SDIO_CMD, SPI_CIPO1/SDIO_DATA0, **SDIO_DATA_2**, and SPI_CS1/SPI_DATA3`.

Typing that out now, I see there actually is a pin named SPI_DATA1 that is in that mix, but I missed it until just now because they didn't use DATA1 for the actual flash:

image

What makes more sense here: one of the two sets below? Not to mention it being confusing with which pins they used for the flash. Maybe it makes more sense to just not have them at all? 😅

// schematic first names	// schematic SDIO names		// Flash use
SPI_SCK1					SDIO_CLK					CLK
SPI_COPI1					SDIO_CMD					D0 (using CMD pin for D0)
SPI_CIPO1					SDIO_DATA0					D1 (using DATA0 pin for D1)
SDIO_DATA1					SDIO_DATA1					--- unused ---
SDIO_DATA2					SDIO_DATA2					D2
SPI_CS1						SDIO_DATA3					D3

Edit to add, maybe this is better? Named by the SDIO pins, with the SPI1 names as aliases, but comments at least saying this is what the pins are used for on this board?

    // QSPI, used by flash on this board, but is broken out
    // on the MicroMod connector, to to the SDIO pins.
    { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_P0_19) },  // 0.00 - SDIO SCK | Used as: QSPI flash SCK
    { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_P0_19) },  //              SPI_SCK1 alias
    { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_P0_14) },  // 0.00 - SDIO CMD | Used as: QSPI flash D0 (or SDI)
    { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_P0_14) },  //             SPI_COPI1 alias
    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_P0_21) },// 0.00 - SDIO DATA0 | Used as: QSPI flash D1 (or SDO)
    { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_P0_21) },  //             SPI_CIPO1 alias
    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_P0_22) },// 0.00 - SDIO DATA1 | Unused for flash.
    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_P0_23) },// 0.00 - SDIO DATA2 | Used as: QSPI flash D2
    { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_P1_00) },// 0.00 - SDIO DATA3 | Use das: QSPI flash D3 (or /HOLD)
    { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_P1_00) },   //              SPI_CS1 alias

@tannewt
Copy link
Member

tannewt commented Mar 10, 2021

I'd say ignore the flash use for the pin mapping and just go by the pinout names. The data pin numbering for SDIO doesn't match the mapping for QSPI because they are different things.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Let me know if you agree and then we'll merge.

@nitz
Copy link
Author

nitz commented Mar 10, 2021

I'd say ignore the flash use for the pin mapping and just go by the pinout names. The data pin numbering for SDIO doesn't match the mapping for QSPI because they are different things.

Yeah they just threw me for a loop with that kinda-but-not-really off by 1 😂 Took me far longer than I'd like to admit to figure out why it wouldn't run. 🤫

This looks good to me! Let me know if you agree and then we'll merge.

Punch it, Chewie!

@tannewt tannewt merged commit f0965b1 into adafruit:main Mar 11, 2021
@nitz nitz deleted the board-add-sparkfun-micromod-nrf52840 branch March 11, 2021 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board New board or update to a single board nordic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants