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

How feasible is to use PWM for one minute interval for each high and low pulse?

Hello,

I am experimenting with PWM for time, I have a setup where I am using three sensor which gives analogue output. 

I am using a mux which has two control pins, so I am controlling control pins with PWM, now I am experimenting with time, how it is possible to make a PWM signal of 1 minute at high level and 1 minute at low level? how do I change prescaler in nRF52dk to create such a slow clock.

regards,

Jaydip

Parents
  • Hello,

    Since the period of the signal is so long, 2 minutes, you can either implement this using the app_pwm library, or you may set up a timer to toggle the pin directly as its callback handler.
    Will you need to change the period / duty cycle of this PWM, or will it always be 1 minute off 1 minute on? If this is the case then I would suggest using the timer approach, but if you are going to change the duty cycle etc, then I suggest using the PWM library.
    You can see the usage of the PWM library demonstrated in the PWM Library example in the nRF5 SDK.
    The timer toggling pin functionality is demonstrated in the timer example where a timer is set to toggle a LED every 500 ms.

    Please do not hesitate to let me know if anything still should be unclear, or if you have any other questions.

    Best regards,
    Karl

     

Reply
  • Hello,

    Since the period of the signal is so long, 2 minutes, you can either implement this using the app_pwm library, or you may set up a timer to toggle the pin directly as its callback handler.
    Will you need to change the period / duty cycle of this PWM, or will it always be 1 minute off 1 minute on? If this is the case then I would suggest using the timer approach, but if you are going to change the duty cycle etc, then I suggest using the PWM library.
    You can see the usage of the PWM library demonstrated in the PWM Library example in the nRF5 SDK.
    The timer toggling pin functionality is demonstrated in the timer example where a timer is set to toggle a LED every 500 ms.

    Please do not hesitate to let me know if anything still should be unclear, or if you have any other questions.

    Best regards,
    Karl

     

Children
Related