I am a beginner coder learning on the MSP430FR4133. I'm using a as part of my system, which is controlled by PWM.
PWM Machines CSE 466 MSP430 Interrupts 26. PWM – Frequency/Duty Cycle CSE 466 MSP430 Interrupts 27.
The motor rotates across 180°, with a 1ms pulse being far right and 2ms pulse being far left in a 20ms period. Unfortunately I'm simply having no success operating it. I have some very simple code that my intention was to simply force the motor to the right-most position: WDTCTL = WDTPW WDTHOLD; P1DIR = BIT7; //P1.7 Output P1SEL0 = BIT7; //P1.7 Select TA0CCR0 = 20000-1; //Set Period to 20ms. TA0CCTL1 = OUTMOD7; //CCR1 Reset/Set TA0CCR1 = 1000; //Set Duty Cycle to 1ms TA0CTL = TASSELSMCLK MCUP TACLR; //Use SMCLK in Up Mode Unfortunately, the code isn't operating as I intended. The motor is supplied by a 5v supply, though the PWM signal from the MPS430 is only 3.3v.
![Pwm Pwm](/uploads/1/2/5/5/125508811/422445045.png)
Could this also be an issue? Thanks for any assisstance, and I can expand on anything I have not given enough information on.