-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
nrf: Fix missing LED GPIO initialization #575
Conversation
led_init was never called, which means the GPIOs were never set to output and the LEDs didn't work.
Thanks - Once I figured out that P0.x on the silkscreen corresponded to PA.x in the Pin list. it works great! |
yeah, Nordic chips use the P0.xx and P1.xx way of naming pins, I guess since originally MicroPython was created for the stm32 chips, it uses PNx way of naming so do other ports. I'm not sure how much consistency between ports should be kept, otherwise we could rename the pins to match more what's on the silk of the DKs, I see that even the feather52 PCB just has numbers on the silk (the nrf52832 only has one port of 32 GPIOs total). |
Actually, @jerryneedell how did you test the code that you had to reference the pins at all? I just did:
|
I used:
|
I see, but then you don't use the LED class and my fix ;) |
oops :-( |
Sorry about that - I did not think that trough very well. I 'm just used to the digitalio interface and did not look closely at the PR. So much to learn... |
No worries, you and me both. |
@arturo182 are you wedded to Regarding pin naming, the intention is for pin names in |
I see, then we should maybe discuss how we should name pins on nRF board, because the datasheets (page 11 @ https://infocenter.nordicsemi.com/pdf/nRF51822_PS_v3.1.pdf), (page 13 @ https://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.0.pdf), (page 13 @ https://infocenter.nordicsemi.com/pdf/nRF52840_OPS_v0.5.pdf) always refer to the pins as PX.YY where X is 0 for nRF51, nRF52832 and nRF51810, and 0 or 1 for nRF52840, and YY is 00-32 for X=0 and 00-15 for X=1. Same notation is used on the DKs, for example: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/development/images/nRF52_DK_v1.1.0_Kit_content.png The feather52 seems to use function names for some silk and then just digits for other: https://cdn-shop.adafruit.com/970x728/3406-02.jpg The problem is, as I understand, that there can be no dot in the name because Python uses the dot notation to access module/class members, thereforce we couldn't have I'm not sure where would that put the feather, because the silk does not mention Hard to say which one is the best :) |
Machine is not enabled in nRF, pyb is, but probably could disable it since all the functionality is available in the new modules. But for machine, I'm not sure that's the case, so maybe we should enable it but only with the classes that are not implemented and slowly move to the new modules. |
For pin naming I think PX_YY for |
Sounds good, if you don't mind then I can unify the pin names in the nRF port in a new PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another PR sounds great! This looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This time not as adabot. :-)
led_init was never called, which means the GPIOs were never set to output and the LEDs didn't work.
Verified on pca10056 (even though this commit doesn't depend on that branch).