• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!

Search the Community

Showing results for tags 'pwm'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


  • Community Calendar

Found 37 results

  1. Hello all !! I have a question about my TIVA board: What is the range of frequencies that we can get for the PWM, taking into account the possibilities of "clock division" and the "number of bits"? I ask you if in case we had to measure a resonator with the PWM as a generator (at 50% duty cycle). regards
  2. So I have my MSP430 launchpad with g2553 and g2452 lying around for year now and finally have a reason to use it. I'm a total noob (I mean I programmed some assembler and C in college and know some basic stuff about MCUs but never actually put it to use), but my for my first project I've picked a tough one. That way I'll be challenged and won't get bored. So I've just bought a motherboard that only has 2 fan connectors on it, but I need at least 4 of those, so I decided to make a fan controller. I could just use some 7805s but what's the fun in that? The idea is to use the inferior msp430g2452 controller from the launchpad to generate 4 pwm channels to control 4 fans by changing the duty cycle with potentiometers. From what I've found on the internet, you can only have as many PWM channels as Capture/Compare Registers on a timer, but the first one will always be used for frequency and have 50% duty cycle. 2452 has only one timer with 3 CCRs, so I could only use 2 PWM channels. With g2553 in a 20 pin package that number is 3 and for SMD package you could have 4 PWM channels. But from what I understand from page 6 in tidu761 design guide, you could have as many software PWM channels as you have GPIO pins available. They can all be the same frequency after all, I only need to change the duty cycle. So far as I keep researching design guides and datasheets I have a few questions: 1) What frequency should I use for PWM? I'm guessing it should at least be outside the audible range, so 25 to 30khz should be fine, right? 2) What pins should I use? I would need at least 4 pins for potentiometers, say P1.0 through P1.3 and 4 pins for PWM, P2.0 to P2.3 would be fine? Or should I use some specific pins? Thanks for reading this!
  3. I have a custom board that is driven with an MSP4302553 chip and can drive a Piezo Transducer which resonates at 25khz. I am limited to using a single rechargeable Lithium battery which is 3.3v. In order to get the 117dB that I want out of the Piezo Transducer, I need to generate a square wave with a 25khz frequency and 10volts across the 2 Piezo pins. I found a Push Pull library which allows me to get a -3.3v-3.3v range, or a total of 6.6v across the 2 pins on my Piezo. This gives me about 80dB. I need to boost that voltage by just a little bit after the PWM pins, without losing the 25khz frequency that I'm sending to the Piezo. Does anybody have any ideas for doing this? I'm on a tight budget and want to keep my board as tiny as possible with the fewest components possible. Thanks, Curtis
  4. From the tm4c1294, I thought I remembered only seeing 8 PWM pins, yet the Energia picture (http://energia.nu/wordpress/wp-content/uploads/2014/06/LaunchPads-LM4F-TM4C-%E2%80%94-Pins-Maps-13-34.jpeg) shows quite a bit more than that. Can you really get PWM on every pin marked for PWM on the Energia diagram, or is it a case of all of the pins marked being PWM capable but only get PWM on 8 of them?
  5. Hello, I wrote a very simple PWM Code for my Brushless DC Motor (incl. ESC) and it works very good (I don't use any Potentiometers.): int motorPin = PF_1; void setup() { pinMode(motorPin, OUTPUT); } void loop() { analogWrite(motorPin, HIGH); delayMicroseconds(1000); analogWrite(motorPin, LOW); delayMicroseconds(19000); } I need 50Hz (1/50=20us). The Motor breaks when the first delay is "1000us" and the second is "19000us". The Motor arrives highspeed when the first delay is "2000us" and the second is "18000us" So my dutycycle should be between 5 - 10% What i need is this PWM Signal without any delays. Is there any way to create a PWM without delays? Thank you very much. greetings, Yaman
  6. I am uploading the fade example of energia to the tiva t4mc1294 connected launchpad but the LED is not fading. It is just blinking. I have also connected the pwm output to motor drivers but the speed of the motors are not changing. When I check the voltage of the pin with my multimeter, I get 0.66v. I have tried the fade example on different pins like PF2, PF3(pins marked for analogWrite in launchpad reference) but the results are same. Here is the code for the fade example, given as reference. int brightness = 0; // how bright the LED is int fadeAmount = 5; // how many points to fade the LED by void setup() { // declare pin 14 to be an output: //analogFrequency(FREQ); pinMode(PF_3, OUTPUT); pinMode(PF_2,OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(PF_2,HIGH); // set the brightness of pin 9: analogWrite(PF_3, brightness); // change the brightness for next time through the loop: brightness = brightness + fadeAmount; Serial.print(brightness); // reverse the direction of the fading at the ends of the fade: if (brightness == 0 || brightness == 255) { fadeAmount = -fadeAmount ; } // wait for 30 milliseconds to see the dimming effect delay(30); }
  7. Hi, Sorry for the repost, I save my preview topic in the wrong place I think (http://forum.43oh.com/topic/9286-msp432-servo-librairy-conflicting-with-pwm-analogwrite/, if someone can delete this one...). I am using an MSP432P401R launchpad Rev B with Energia 17 on Windows 10. I've recently got this issue: I can't control servomotors with the Servo.h librairy and at the same time send several PWM. As soon as I called the "attach" function from Servo, the others call to analogWrite in my code don't work anymore. I think it is due to some timer conflicts (both functions using A0 timer ?), but I can't figured out how to fix the problem. I see something wierd in the Servo librairy code (in Servo.cpp:72): //timerParams.clockSource = Timer_Source_SMCLK; This instruction, that seems to choose the timer to use, is commented. Moreover I noticed that several defined are not used in the code of Servo (from Servo.h): #define SERVO_TIMER TIMERA0_BASE #define SERVO_TIME_CFG TIMER_CFG_B_PERIODIC | TIMER_CFG_SPLIT_PAIR #define SERVO_TIMER_TRIGGER TIMER_TIMB_TIMEOUT #define SERVO_TIMER_INTERRUPT INT_TIMERA0B #define SERVO_TIMER_AB TIMER_B #define SERVO_TIMER_PERIPH PRCM_TIMERA0 I have tried to modify "A0" by "A1" without success. Did someone run in a similare problem and could give me some clue to fix it ? Thanks Nathan
  8. Hi , I have written my scheduler which uses the Timer0 subtimer A to generate interrupt for Multi-tasking. I have tested the waverforms generating accurately and arriving at the right time periods. Now the issue that I am facing is PWM waves are not arrived at the expected time. Is PWM interfere with the Timer functionality? What is the work around? Are there any free timers available which I can use it for my scheduler? Some insights to this would really help. Thanks, Peeyush
  9. Hey guys! I'm having some fun with my MSP430 and started to play with the Energia IDE so I can make some tests faster than by the standard library of the microcontroller. But I've searched on the reference and saw that the only function to use with PWM is analogWrite()... How could I change the frequency of the PWM instead of only its Duty cycle? Thank you guys!
  10. Hello! I am new to embedded programming and the forums. For my first task I am trying to generate a clean square wave with a configurable frequency and I figured PWM would be a good way to do this. Below is my code. This works to an extent, but during the off time there are regular spikes to 3.6V at about 10kHz as seen in my scope plot. The scope is a cheap Rigol DS1102. How can I eliminate these spikes? and is my approach the best approach or is there a better one that may not have the extra spikes? thanks in advance for the help! void setup() { // declare pin 14 to be an output: pinMode(GREEN_LED, OUTPUT); } void loop() { // set the frequency: analogFrequency(800); //PWM (Pin, Duty Cycle) - Maximum = 100% = 255 analogWrite(GREEN_LED, 127); } MSP-EXP430G2 w/ crystal populated to pins XIN/XOUT MSP430G2553 Energia 11 Windows 8.1 x64
  11. I've been looking for a while and can't find a good example showing how I can play any sort of music or speech files (mp3, au, wav, etc.). I've got a configuration setup that allows me to read files for things like LCD screens, I'm looking to read a music or speech file and play it through an amplified speaker. I'm not looking to make just tones, rather to play full music or speech files. I've found projects for Arduino such as (http://hlt.media.mit.edu/?p=1963), but nothing that works with MSP430 and Energia. Has anyone done something similar to this with Energia?
  12. I am using an MSP430fr5969. The board only has one hardware pwm available and it located on P1.2. For my application, I need to generate two different pwm signals to control two different motors. One of those is a servo, the other is a linear actuator but it is controlled through a motor speed controller that uses a pwm input (replicating that of an RC receiver). Can I use the servo library and attach a servo to any pin or does that pin have to have hardware pwm? I looked through the Servo.cpp file and it seems to be doing software serial. When i run servo examples, and hook the pin up to an oscilloscope I do not get nice square waves being generated as an output. Currently I am using pin 9, the defualt for the servo libraries. Thanks, Nolan
  13. 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
  14. Hi, I need to generate 4 pwm signals at 50 HZ, they need to run with out interruption. I know the TM4C123G6PM has 2 pwm blocks, but is it possible to access them through Energia? can I use Analog.write(); ? Someone please help. Thank you.
  15. All, Can I output a PWM signal to P1.0 pin (G2231 chip) using timer A in up mode and setting CCR0 / CCR1 accordingly? In short, I was going to use the example code provided by TI (see slac163 and slaa428, example I'm using is the "C" code msp430x21x2_ta_1.c), where pin P1.2 is used for the PWM output. Well, I tried to modify the code to output the signal to P1.0 but can't get it to work. My conclusion is that P1.0 cannot be selected for such function, but I cannot find anythere in the user guide or datasheets a confirmation. In fact, by reading the datasheet (page 6) I had understood it can do that... (link). What am I doing wrong? Can the timer output be in pin P1.0? Here is the code I'm using - below it is set to output to pin P1.2, but there's commented code for pin P1.0 that I tried using. #include <msp430.h> #include <stdlib.h> int main( void ) { //---------------- // // Hardware config // //---------------- // WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer // DCO configuration DCOCTL = CALDCO_1MHZ; //Set DCO to 1 MHz BCSCTL1 = CALBC1_1MHZ; // Calibrate internal clock for 1 MHz // Port 1 configuration P1DIR = 0x04; P1SEL |= BIT2; // P1DIR = 0x01; // P1SEL |= BIT0; // Timer A configuration TACTL = TASSEL_2 + // Set clock to internal DCO ID_0 + // No frequency divider MC_0; // Stopped to begin with CCR0 = 1000-1; // PWM Period (1 us) CCTL1 = OUTMOD_7; // CCR1 reset/set CCR1 = 500; // CCR1 PWM duty cycle //----------- // // Main logic // //----------- // TACTL |= MC_1; _BIS_SR(LPM0_bits); }
  16. 3 channel, high power LED driver, built to fit 10W RGB LEDs (those things are blindingly bright!) Now on Tindie.
  17. Hello, im barely new in ARM programming. What i want to do is to run four independent PWM channels to manage my things. I wrote some code and as i supposed it didint work. In debug process i checked registers and it seems to be ok. Load and match values are corerct so i think error is somewhere in timers configuration. Can someone help me out ? Thanks in advance for reply. Here is my code that i ran on my launchpad. #define PART_LM4F120H5QR 1 #include <inc/hw_types.h> #include <inc/hw_memmap.h> #include <driverlib/sysctl.h> #include <driverlib/gpio.h> #include <driverlib/pin_map.h> #include <driverlib/timer.h> #define PWM_FREQ 20000 void InitGPIOs() { // running clock for gpio C SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); } void InitPWMs() { // runing clock for timers: wide timer 0 and wide timer 1, both 64 bits SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER0); SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER1); TimerConfigure(WTIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM); // timer0 A TimerConfigure(WTIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PWM); // timer0 B TimerConfigure(WTIMER1_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM); // timer1 A TimerConfigure(WTIMER1_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_B_PWM); // timer1 B // 20 khz freq TimerLoadSet(WTIMER0_BASE, TIMER_A, (SysCtlClockGet()/PWM_FREQ)-1 ); TimerLoadSet(WTIMER0_BASE, TIMER_B, (SysCtlClockGet()/PWM_FREQ)-1 ); TimerLoadSet(WTIMER1_BASE, TIMER_A, (SysCtlClockGet()/PWM_FREQ)-1 ); TimerLoadSet(WTIMER1_BASE, TIMER_B, (SysCtlClockGet()/PWM_FREQ)-1 ); // initial width value TimerMatchSet(WTIMER0_BASE, TIMER_A, (SysCtlClockGet()/PWM_FREQ)/2); TimerMatchSet(WTIMER0_BASE, TIMER_B, (SysCtlClockGet()/PWM_FREQ)/2); TimerMatchSet(WTIMER1_BASE, TIMER_A, (SysCtlClockGet()/PWM_FREQ)/2); TimerMatchSet(WTIMER1_BASE, TIMER_B, (SysCtlClockGet()/PWM_FREQ)/2); // enabling timers TimerEnable(WTIMER0_BASE, TIMER_A); TimerEnable(WTIMER0_BASE, TIMER_; TimerEnable(WTIMER1_BASE, TIMER_A); TimerEnable(WTIMER1_BASE, TIMER_; // pin muxing for pwms GPIOPinConfigure(GPIO_PC4_WT0CCP0); GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_4); GPIOPinConfigure(GPIO_PC5_WT0CCP1); GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_5); GPIOPinConfigure(GPIO_PC6_WT1CCP0); GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_6); GPIOPinConfigure(GPIO_PC7_WT1CCP1); GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_7); } int main() { // setting clock to maximum speed 80 Mhz SysCtlClockSet(SYSCTL_USE_PLL | SYSCTL_SYSDIV_2_5 | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); InitGPIOs(); InitPWMs(); while(true) { } return 0; }
  18. What is the preferred way to stop doing analogWrite (PWM) on a pin in Energia? For instance how should I change a pin to digitalWrite, or change it to input, or to just prepare to stop using the pin? In particular, how do you stop the timer (which is used to generate the PWM)? Studying the code for analogWrite, digitalWrite and pinMode I do not see where PWM timers are ever stopped once they are started. (I looked at the code on MSP430, Stellaris, and CC3200). To confirm my impression, I ran a little test on an MSP430. While I can change mode to output and/or do a digitalWrite to change the pin after doing an analogWrite, it appears that the timer just keeps ticking away, even though it is no longer controlling the pin. (I haven't tested this on the other platforms or tested whether changing the pin to input stops the timer.) Is there some glitch where the timers have to be left running once started? Why would one care if the timer keeps running? It uses power (or is this an insignificant amount of power, even on an MSP430 or CC3200 running on a battery). It might make bookkeeping a little easier if unused timers were stopped. (e.g. easier to tell which ones could safely be used for other purposes). Thanks.
  19. I found out from this post that there are 14 PWM outputs possible on the MSP430F5529 microcontroller, and 10 PWM outputs possible on the MSP430F5529 Launchpad. How many are possible when using Energia? I think it is less, but I can't tell from the .h file. I will be using a custom BoosterPack so it doesn't have to stick to that standard. Thanks, Ben
  20. hi , i'm trying to create a PWM signal with period of 15 msec and pulse width the can vary between 1.1 msec and 1.9 msec. (I'm using the Msp430F5529 ) how can i do it? thx in advance.
  21. Hello, I'm planning for a project the use of 12 Channels PWM (Frequency must be above 60khZ, because of driving some VCA´s and not getting into the audio range). As I know, Energia uses "software" PWM with the use of timers (the hardware PWM´s of the new TIVA's is not implimented). So my question is, may I can get some overall performance boost using the driverlib hardware PWM rather than the energia software version? Thanks regards Matthias
  22. The usual way to generate PWM with the MSP430 is to set the timer to up mode, CCR0 to the PWM period, and then use CCR1 and up in reset/set mode to set the PWM pulse width. This provides a precise hardware driven PWM with minimal CPU overhead. The only ISR required is the CCR0 interrupt so new PWM values can be updated without creating glitches. It is possible to use CCR0 to do PWM in addition to CCR1 and up by using continuous mode and output compare toggle mode. This requires an ISR for each CCR used. It is glitch free and allows different PWM periods for each output if desired. The basic ISR is simple: __interrupt void isr_ccr0(void) // - ISR for CCR0 { // static unsigned s = 0; // State static unsigned d; // On duration // TA1CCR0 += (s++ & 1) ? (pwm_period[0] - d) : (d = pwm_on[0]); } // Each time the ISR occurs, the output time is advanced in to the future. The lsb of a state variable toggles between adding the on duration or off duration to the previous time. When the lsb is 0, then the on duration is used, and also saved for later. When the lsb is 1, then the off duration is calculated from the saved on duration and the PWM period. Toggling of the output pin is automatic because the CCR output mode is set to toggle. Complete code for 3 PWM outputs using CCR0, CCR1, and CCR2 of Timer 1 #include <msp430.h> static unsigned pwm_on[3]; // PWM on duration static unsigned pwm_period[3]; // Total PWM period - on duration + off duration // #pragma vector = TIMER1_A0_VECTOR // - ISR for CCR0 __interrupt void isr_ccr0(void) // { // static unsigned s = 0; // State static unsigned d; // On duration // TA1CCR0 += (s++ & 1) ? (pwm_period[0] - d) : (d = pwm_on[0]); } // // #pragma vector = TIMER1_A1_VECTOR // - ISR for CCR1, CCR2 __interrupt void isr_ccr12(void) // { // static unsigned s1 = 0; // State static unsigned d1; // On duration static unsigned s2 = 0; // static unsigned d2; // // switch(TA1IV) { // case 0x02: // - CCR1 TA1CCR1 += (s1++ & 1) ? (pwm_period[1] - d1) : (d1 = pwm_on[1]); break; // case 0x04: // - CCR2 TA1CCR2 += (s2++ & 1) ? (pwm_period[2] - d2) : (d2 = pwm_on[2]); break; // } // } // // static void pwm_init(void) // { // P2DIR |= (BIT0 | BIT2 | BIT4); // PWM outputs on P2.0, P2.2, P2.4 P2SEL |= (BIT0 | BIT2 | BIT4); // Enable timer compare outputs P2SEL2 &= ~(BIT0 | BIT2 | BIT4); // // TA1CTL = TASSEL_2 | ID_3 | MC_2; // Setup timer 1 for SMCLK / 8, continuous mode // TA1CCTL0 = TA1CCTL1 = TA1CCTL2 = OUTMOD_4 | CCIE; // Set timer output to toggle mode, enable interrupt TA1CCR0 = TA1CCR1 = TA1CCR2 = TA1R + 1000; // Set initial interrupt time } // // int main(void) // { // WDTCTL = WDTPW | WDTHOLD; // // DCOCTL = 0; // Run DCO at 8 MHz BCSCTL1 = CALBC1_8MHZ; // DCOCTL = CALDCO_8MHZ; // // pwm_init(); // Initialize PWM // // Setup PWM period pwm_period[0] = pwm_period[1] = pwm_period[2] = 20000; pwm_on[0] = 1000; // Setup servo times pwm_on[1] = 1500; // pwm_on[2] = 2000; // // _enable_interrupts(); // Enable all interrupts // for(; { // } // // return 0; // } //
  23. Hi, Playing around with AnalogWrite and my scope: This little script toggles between two duty cycles: const int analogOutPin = 9; void setup() { pinMode (analogOutPin,OUTPUT); } void loop() { analogWrite(analogOutPin, 100); delay(15); analogWrite(analogOutPin, 150); delay(15); } below is how this looks on the scope, blue direct, yellow with a simple R-C lowpass. every now and then, when changing duty cycle, I get an extra-long pulse. I am using the G2553 on the launchpad, with xtal. I have seen on this forum that calling AnalogWrite when NOT changing the duty cycle should be avoided. But I DO sometimes want to change the duty cycle ;-) Tried the same on an Arduino Uno, no problem there, smooth transitions. any suggestions? maelli01
  24. Hi, I am trying to use the analog write function on energia and am having trouble. When I use the function on the inbuilt LEDs everything is working fine but when I use it on external circuits, if I use analogWrite(255)(the maximum) the led is staying on with the maximum brightness as it supposed to but for any other values, its off. In the example codes there is one which increases and decreases the brightness of the led periodically. For the in-built LED its working fine but for others, when the brightness is supposed to be maximum, the LED is staying on and all other time its off. Any help would be great. Thanks.
  25. PWM is much easier on the new Launchpad using the PWM peripherals, here is a working example using the 3 onboard LEDs. #include <stdint.h> #include <stdbool.h> #include "inc/hw_gpio.h" #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "driverlib/sysctl.h" #include "driverlib/pin_map.h" #include "driverlib/gpio.h" #include "driverlib/pwm.h" int main(void) { unsigned long ulPeriod; //Set the clock SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); //Configure PWM Clock to match system SysCtlPWMClockSet(SYSCTL_PWMDIV_1); // Enable the peripherals used by this program. SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1); //The Tiva Launchpad has two modules (0 and 1). Module 1 covers the LED pins ulPeriod = SysCtlClockGet() / 200; //PWM frequency 200HZ //Configure PF1,PF2,PF3 Pins as PWM GPIOPinConfigure(GPIO_PF1_M1PWM5); GPIOPinConfigure(GPIO_PF2_M1PWM6); GPIOPinConfigure(GPIO_PF3_M1PWM7); GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); //Configure PWM Options //PWM_GEN_2 Covers M1PWM4 and M1PWM5 //PWM_GEN_3 Covers M1PWM6 and M1PWM7 See page 207 4/11/13 DriverLib doc PWMGenConfigure(PWM1_BASE, PWM_GEN_2, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC); PWMGenConfigure(PWM1_BASE, PWM_GEN_3, PWM_GEN_MODE_UP_DOWN | PWM_GEN_MODE_NO_SYNC); //Set the Period (expressed in clock ticks) PWMGenPeriodSet(PWM1_BASE, PWM_GEN_2, ulPeriod); PWMGenPeriodSet(PWM1_BASE, PWM_GEN_3, ulPeriod); //Set PWM duty-50% (Period /2) PWMPulseWidthSet(PWM1_BASE, PWM_OUT_5,ulPeriod/2); PWMPulseWidthSet(PWM1_BASE, PWM_OUT_6,ulPeriod/2); PWMPulseWidthSet(PWM1_BASE, PWM_OUT_7,ulPeriod/2); // Enable the PWM generator PWMGenEnable(PWM1_BASE, PWM_GEN_2); PWMGenEnable(PWM1_BASE, PWM_GEN_3); // Turn on the Output pins PWMOutputState(PWM1_BASE, PWM_OUT_5_BIT |PWM_OUT_6_BIT|PWM_OUT_7_BIT, true); //Do nothing while(1) { } }