Jump to content
DebanjanDatta

How many PWM outputs can I obtain using the msp430g2553 chip?

Recommended Posts

Hi... So let me ask this straight. I have to run a 3phase BLDC Motor using a full bridge inverter. The PWM signals for the switches of the inverter need to be generated using a microcontroller. Which means I need 6 different PWM signals. Can this be achieved using an MSP430g2553 chip? I currently have the 20 pin version only. I happen to be a complete beginner in the matter of microcontrollers. So please be kind enough to overlook my dumbness if I've missed out something very obvious!

Share this post


Link to post
Share on other sites
3 minutes ago, Rei Vilo said:

Please refer to the pins map and the data-sheet.

Hi... Thanks for the reply. But I wouldn't have posted this in the first place, had I been able to figure it out by browsing through the user guide/datasheet. I'm working with a time constraint here and it'd require quite a bit of digging up to find exactly what I require from 644 pages of information! 😅 I've racked my brains at it once but being the noob that I am, couldn't get an answer.

Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites

There are two answers:

 

1: Strictly using hardware, you have two independent PWM channels, as long as you aren't using either timer for anything else (the two TIMER_A modules-- timer type A, a 16 bit with counter with a selection of control inputs for counting, output modes, and other options. Other MSP430 devices may include other timer types, such as TIMER_B). There are several pins that can be attached to each for PWM output, but, for practical purposes, they are not independent.

 

2: Using software, you can have as many PWM as you have output pins, but more than 8 gets more difficult. The max PWM frequency will not be as high as the hardware only solution, and the precicion will be lower, but for many applications, it is quite acceptable. This requires using an interrupt service routine triggered by a timer at the PWM resolution. If you want a PM cycle of 10ms (100 cycles per second) and a n 8 bit resolution (256 PWM pulse widths), you will need the interrupt to trigger every 39 microseconds. This is about the limit for an MSP4302553 at the max clock frequency, if you want to get anything else done, like control the PWM.

I have used this approach a number of times, and have at least one example on this site (8 channel spooky eye controller for hallow'een

). For motor control, this might be quite sufficient, especially if you use a table in memory for control. For a three phase BDC motor, you are likely to be able to use 3 or 4 bit resolution and a PWM cycle of about 500 microseconds. This will give you a max RPM of the order of 18KRPM (300 rev/sec)

 

As regard to your response to Rei Vilo,: A key skill that anyone working with electronics, microcontrollers, PGA's, and so on, is reading and interpreting data sheets and data books. For a complex device, which the MSP430's are, this is not easy, but is still a needed skill and you will need to do it to complete any project that is not trivial, and a three phase driver is decidedly not trivial. The information for response 1 is directly in the pin map. Response 2 requires experience.

Share this post


Link to post
Share on other sites
3 hours ago, enl said:

There are two answers:

 

1: Strictly using hardware, you have two independent PWM channels, as long as you aren't using either timer for anything else (the two TIMER_A modules-- timer type A, a 16 bit with counter with a selection of control inputs for counting, output modes, and other options. Other MSP430 devices may include other timer types, such as TIMER_B). There are several pins that can be attached to each for PWM output, but, for practical purposes, they are not independent.

 

2: Using software, you can have as many PWM as you have output pins, but more than 8 gets more difficult. The max PWM frequency will not be as high as the hardware only solution, and the precicion will be lower, but for many applications, it is quite acceptable. This requires using an interrupt service routine triggered by a timer at the PWM resolution. If you want a PM cycle of 10ms (100 cycles per second) and a n 8 bit resolution (256 PWM pulse widths), you will need the interrupt to trigger every 39 microseconds. This is about the limit for an MSP4302553 at the max clock frequency, if you want to get anything else done, like control the PWM.

I have used this approach a number of times, and have at least one example on this site (8 channel spooky eye controller for hallow'een

). For motor control, this might be quite sufficient, especially if you use a table in memory for control. For a three phase BDC motor, you are likely to be able to use 3 or 4 bit resolution and a PWM cycle of about 500 microseconds. This will give you a max RPM of the order of 18KRPM (300 rev/sec)

 

As regard to your response to Rei Vilo,: A key skill that anyone working with electronics, microcontrollers, PGA's, and so on, is reading and interpreting data sheets and data books. For a complex device, which the MSP430's are, this is not easy, but is still a needed skill and you will need to do it to complete any project that is not trivial, and a three phase driver is decidedly not trivial. The information for response 1 is directly in the pin map. Response 2 requires experience.

Thanks a ton for such a detailed reply!! Now I got some idea at least

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

×