Sign in to follow this  
Followers 0
Nolan

PWM on MSp430fr5969

3 posts in this topic

I am looking to run two motors via motor controllers that require pwm signals.

 

I have learned how hardware and software pwm work. I also have learned what would be required to create a software pwm with a chip timer and clock in CCS. I am still however confused on whether this is required in energia and how I can tell what pins i am able to use. 

 

Using a MSP430fr5969:

 

Can i simply use the analogwrite() function on a pin that allows for it to be used according to the pin map http://energia.nu/wordpress/wp-content/uploads/2014/10/LaunchPad-with-MSP430FR5969.jpg ?

 

Does the analogwrite function only work on the pins that have hardware pwm capability or is it a software pwm function? 

 

Could I for example use pins P1_4 and P1_3 to send a pwm to signal to the motor controllers? Does the same apply when reading pwm signals? 

 

-Nolan 

Share this post


Link to post
Share on other sites

analogWrite() will only work on pins that have PWM ability. Otherwise, pins without PWM ability will either be "off" or "on".

 

Energia itself won't prevent you from controlling pins via timers and thus doing software based PWM either, but that's you manipulating the timers and pin states on your own, since your code in the sketch will overload whatever Energia may have been trying to do behind the scenes.

Share this post


Link to post
Share on other sites

analogWrite() will only work on pins that have PWM ability. Otherwise, pins without PWM ability will either be "off" or "on".

 

Energia itself won't prevent you from controlling pins via timers and thus doing software based PWM either, but that's you manipulating the timers and pin states on your own, since your code in the sketch will overload whatever Energia may have been trying to do behind the scenes.

 

Ok. Understood. I have seen several libraries for Arduino that create software pwm on another pin. Is there a library that you would recommend that translates well to energia for this purpose?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0