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

Wrong values in g_ADigitalPinMap? #250

Closed
henrygab opened this issue Apr 11, 2019 · 2 comments
Closed

Wrong values in g_ADigitalPinMap? #250

henrygab opened this issue Apr 11, 2019 · 2 comments

Comments

@henrygab
Copy link
Collaborator

henrygab commented Apr 11, 2019

It appears that five pins are listed twice in the pin map for the Feather nRF52840 Express:

47, // D3 is LED1 on P1.15
42, // D4 is LED2 on P1.10
40, // D5 on P1.08


These pins are listed a second time at their own index:

33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47

Is this intentional? This seems like it may be a bug....

@henrygab
Copy link
Collaborator Author

henrygab commented Apr 12, 2019

A potential reason that five PORT.PIN were duplicated is now known.
The board has 48 pins, so the definition of the pin map may have started with the presumption that all 48 pins should be listed, and thus started the mapping with identity mapping (i.e., g_ADigitalPinMap[i] == i). After then editing the file to list all the pins deemed usable, the remaining entries in g_ADigitalPinMap may have been left at the identity mapping.

Here are the five PORT.PIN that are not included in the current g_ADigitalPinMap:

PORT.PIN Purpose Schematic Usable by sketches
0.00 XL1 32.768kHz crystal False
0.01 XL2 32.768kHz crystal False
0.09 NFC1 TP1 Via solderable point
0.18 RESET reset switch False
1.00 SWO SWD Debugger False
1.01 GPIO Not Connected False

Of these, only NFC1 (0.09) should likely be included in the pin map.

There are also problems with the pins listed for NFC1 and NFC2:

#define PIN_NFC1 (2)
#define PIN_NFC2 (51)

const uint32_t g_ADigitalPinMap[] =
{
25, // D0 is UART TX on P0.25
24, // D1 is UART RX on P0.24
10, // D2 is on P0.10

As can be seen, PIN_NFC1 is defined to be 2 in variant.h, and variant.cpp maps pin 2 to 0.10, but the schematic and nRF52840 specification show NFC1 to be 0.09.
As can also be seen, PIN_NFC2 is defined to be 51 in variant.h, which is beyond the valid indices of the pin map.

Fixing the variant.cpp files seems necessary for NFC (see #31).

@hathach
Copy link
Member

hathach commented Apr 16, 2019

thanks @henrygab it is indeed an issue, the header declare more pins that the board actually expose. I will check out the schematics with your PR.

hathach added a commit that referenced this issue Apr 19, 2019
Fix #250 -- wrong values for g_ADigitalPinMap
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