-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added support for the Nordic nRF52832 #133
Conversation
thanks - we're actually in the middle of adding generic nrf52 support so may not merge this in particular but we'll get something going and maybe you can test it :) stay tuned! |
Hi @ladyada ! We just finished our implementation using the DMA and the PWM module. To summarize the changes made:
|
We added more detalied comments to run the StrandtestBLE example and also added a skip file for it. The current travis script doesn't include support for the NRF52 based boards. We'll wait for this support to be added to remove the skip file. |
This is an interesting approach, thanks for the PR. We'll test it out locally and let you know the results. |
Hi @microbuilder, @ladyada ! I've just pushed the changes based on the comments from the discussion at: adafruit/Adafruit_nRF52_Arduino#21 To summarize the changes:
|
I merged this into a new 'develop' branch for now so that it's easier to work on, and we can move it into Master shortly. |
pixels_pattern[++pos] = 0 | (0x8000); // Seq end | ||
|
||
// Enable the PWM | ||
PWM[device]->ENABLE = |
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.
ENABLE should be set after PSEL.OUT
// operation we enable the interruption for the end of sequence | ||
// and block the execution thread until the event flag is set by | ||
// the peripheral. | ||
PWM[device]->INTEN |= |
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.
EVENTS_SEQEND[0] is generated without the need to set INTEN
// TODO: Check if disabling the device causes performance issues. | ||
PWM[device]->ENABLE &= | ||
~(PWM_ENABLE_ENABLE_Enabled << PWM_ENABLE_ENABLE_Pos); | ||
PWM[device]->PSEL.OUT[0] &= ~(PWM_PSEL_OUT_CONNECT_Connected << |
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.
bit31 is set mean disconnected
Hi @mxgxw, We are doing the merge. We notice that you are using the WS2812 (rev A) specs of timing. As far as I know, since most of our current neopixel is using WS2812 revB, we will adjust the timing to rev B chip's. Luckily, both chips will work with either one since they are well in limit range of each other. So we have no worries at all. REV B |
Hi @mxgxw , Thank you for the great pull request. We merged and add some modificaion 68a516d as follows
Please let us know if you have any suggestions regarding those modifications. If possible, please check out the merged code to see if it works with your board over there. Once it is confirmed, we will merge it to master and release it out. Thank you again for the brilliant PWM pull request 👍 |
Hi @hathach ! Great, I've just tested the changes and they appear to work perfectly! It's good to see that the final implementation only required minimum changes. We are really happy here that you found the code useful :) |
Thank you very much, version 1.1.0 that incorporates your brilliant implementation is released 👍 |
@mxgxw Thanks for the contribution. I have a qq. I'm using this with one strand and it works fine but if I add another neopixel object to control another strand using a different pin it seems to lock up during setup. Does the implementation support using more than one strip? I'm not using DWT, maybe using PWM is the issue? I appreciate any help, thanks. |
-This pull request adds support for the nRF52832 MCU, it was tested on the Sparkfun nRF52832 breakout board, however it could possibly work on any other board based on the nRF52. The implementation is based on the Teensy examples but using the syntax and registers of the NRF52DK. You'll need to add support for the board from the following URL: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/nrf5/IDE_Board_Manager/package_sparkfun_index.json
This implementation doesn't disable the interrupts when running the code. This is because enabling interrupts breaks the Bluetooth Softdevice. Currently we are working on an implementation that doesn't require disabling the interrupts. However, you can disable the interrupts using #define NRF5_DISABLE_INT. When interrupts are enabled you cannot use the Bluetooth softdevice. For more info check the comments on the lines 142 and 1210.
It was tested to work sucessfully with the "strandtest" example provided with the library. Also yo can see it working over https://www.instagram.com/teubico