Question: (50 pts.) Write a complete C program to do the following for the MSP432: Initialize the A/D converter and use it to read the voltage

  1. (50 pts.) Write a complete C program to do the following for the MSP432:
  1. Initialize the A/D converter and use it to read the voltage on the wiper of a pot every 100 ms.
  2. Set up 2 PWM outputs, both at a frequency of 4 kHz. You will want a fairly high duty cycle resolution (i.e., be able to change the duty cycle in small increments).
  3. Control the duty cycle of the two PWM outputs using the value on the pot as follows:
    1. Make PWM output 1 proportional to the value (i.e., as the value increases, so should the duty cycle) over a duty cycle range of 50% to 100%. Thus, for example, when the wiper voltage is 0 V, the duty cycle should be 50%, when it is 1.1 V, the duty cycle should be 66.5%, when it is 3.3 V, the duty cycle should be 100%, etc.
    2. Make PWM output 2 inversely proportional (i.e., if the value is 0 V, the duty cycle should be 100%, if 3.3 V, 50%, if 1.1 V, 83.5 %, etc.).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!