Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sdk_config overwritten by sdk_old_config

hello nordic

i have been working with nrff52832 with the SDK16.0 (also working with s132 if it matters)

it is a real head braking to deal with your never ending sdk_config.h, today i found out that he has an even more evil origen which is the sdk_old_config.h 

why do we need 2 files defining the same things, seems like a very poor solution to whatever problem 

i wish to configure a timer by enabling NRFX_TIMER_ENABLE so i change it in the sdk_config.h but it does nothing, i have tried to disable every definition that seems related to legacy but still nothing changes 

please help it been to many hours of try and error with no real programing because of that

best regards and hope for better days

Ziv

  • hi Karl

    I would definitely recommend that you use the app_pwm library to control it instead.

    why is the pwm better then controlling the pulses with a timer ? 

    it seems less natural to use pwm since i have to maintain 50% duty cycle all the time, also when i change the COUNTERTOP in order to change the period of the pwm to get different frequencies to control the stepper motor's speed ?

  • Hi Ziv,

    There is no difference in using the TIMER peripheral directly, but the app_pwm library makes most of the configurations and setup for you - making it much easier to control and use.
    The app_pwm library uses the TIMER peripheral behind the scenes, so it is really just an abstraction level higher - which is also why I would recommend it. But if you are comfortable with using the timers directly and you do not mind the "manual" configuration, then you might as well use the TIMER peripheral directly.

    change the period of the pwm to get different frequencies to control the stepper motor's speed

    In my experience most PWM controlled motors does not support changing of the frequency - they usually have a set frequency which must be used.
    The duty cycle can then easily be changed with the app_pwm library - but it is also fairly straight forward to change it on a TIMER generated PWM. You could check out the app_pwm library source code to see how it might be done.

    Best regards,
    Karl

Related