Jump to content
43oh

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!

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!

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.

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

Link to post
Share on other sites
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...