This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLDC PWM on nRF52DK

Hi,

I am currently working on a project that requires the control of a BLDC and i am new to the nRF microcontroller is there anyone how can give me some sort of guide and help please?

in the future, i would like to implement some sort of speed control and feedback from the BLDC sensors.

Thanks in advance

Parents
  • Hello,

    i am new to the nRF microcontroller

    Welcome!

    I am currently working on a project that requires the control of a BLDC and i am new to the nRF microcontroller is there anyone how can give me some sort of guide and help please?

    Have you had a look at the Getting Started with Product development and Getting started with software development guide?
    Before you may begin, you must set up your toolchain, so that you are ready to start developing. If you already have done this, we may proceed to the development part!

    After having set up your development environment, it sounds like you might want to take a look at the PWM driver example and PWM Library example from the SDK. Both these examples demonstrate how you may go about generating a PWM signal on your nRF52 DK.
    Following this, you could begin looking into one of the BLE examples, to see how you may go about transmitting commands to / from your device, and have that produce the necessary PWM waveforms.
    I would then start working out of one of the BLE peripheral examples in the SDK, and add your own PWM / motor control functionality to that - this way, you will not have to write the code for configuring and starting the BLE procedures yourself.

    There are tons of posts on the forum here and github repositories already dedicated to controlling BLDC motors through a BLE connection, so I highly recommend checking out some of those as well for inspiration.

    Please do not hesitate to ask if you should encounter any issues or questions, or if anything should be unclear!

    Best regards,
    Karl

  • Thanks for your quick response.

    yes i have looked into both PWM library and driver examples and i managed to play around but i still need to fully understand everything that's going on.

    I was also wondering if it would be easier to work with the registers directly as i have used microchip and even arm cortex MCUs during the previous year and I always used registers or cmisis. but I would like to upgrade and use the nRF52832 for my final year project.

    Are there any examples that i could find using Cmsis or the registers directly please? :)

  • NikTheNordicUser said:
    Thanks for your quick response.

    No problem at all, I am happy to help!

    NikTheNordicUser said:
    yes i have looked into both PWM library and driver examples and i managed to play around but i still need to fully understand everything that's going on.

    Great! Then you are off to a good start already.

    NikTheNordicUser said:
    I was also wondering if it would be easier to work with the registers directly as i have used microchip and even arm cortex MCUs during the previous year and I always used registers or cmisis. but I would like to upgrade and use the nRF52832 for my final year project.

    I understand this, and you are absolutely free to use the registers directly - but personally I would recommend making use of the drivers and libraries provided with the SDK, since a lot of the work then is already done for you.
    Especially when it comes to setting up peripherals and the likes, the drivers handles this in a good way - they do not introduce a lot of wasted instructions either, if that is what you are worried about.

    NikTheNordicUser said:
    Are there any examples that i could find using Cmsis or the registers directly please? :)

    Unfortunately we do not provide such examples, but the available registers are all described in their respective documentation. As an example you can see the TIMER peripherals documentation and registers here. There also exists a bare-metal repository on Github, that demonstrates direct register manipulation for a couple of peripherals, but again this is not something that is provided by Nordic so keep this in mind.
    I would again like to emphasize the benefit of using the provided drivers and libraries from the SDK - but I also totally understand if you would like to stick to the register level, I personally felt this way for a long time too.

    Best regards,
    Karl 

  • ill take your advice and start working more on drivers, if not ill try to revert back to registers.

    Also you wouldn't happen to have an idea of BLDC GitHub respositories for the nRF52832 please?

    thanks for your help !

  • NikTheNordicUser said:
    ill take your advice and start working more on drivers, if not ill try to revert back to registers.

    Great, this sounds like a very good approach to it. Please do not hesitate to ask if you should encounter any issues or questions!

    NikTheNordicUser said:
    Also you wouldn't happen to have an idea of BLDC GitHub respositories for the nRF52832 please?

    I do not have any go-to repositories for this, but a quick github search yields the following repositories that might be helpful to have a look at ( keep in mind that the only thing I know about your project is that BLE and a motor is involved ):
    https://github.com/jtguggedal/bachelor_e1610 - a bachelor thesis creating an RC car controlled through WEB and BLE.
    https://github.com/NordicPlayground/nRF52-Bluetooth-Course - the code for a BLE course that we have held for students at NTNU, the goal here was to control a servo - which is basically the same in terms of control.

    Hope this helps, and good luck with your development!

    Best regards,
    Karl

Reply Children
No Data
Related