The MSP430 is connected to a small DC motor and one push buttons (to change the
ID: 3735235 • Letter: T
Question
The MSP430 is connected to a small DC motor and one push buttons (to change the speed of the DC motor).
a. (15 points) Create a small circuit to create a 1 bit DAC to be able to vary the motor voltage between 1 to 3V DC with less than 250mV ripple (do not forget to provide you RC value) using the MSP430.
b. (25 points) Create a simple C program that enable adjusting the motor speed by pressing the push button. When you press the push button, the output voltage should cycle between 1V, 2V and 3V output.
Explanation / Answer
#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>//header file for sleep function
// main starts
int main()
{
int button,outputVoltage,iterator;
printf("1 on your keyboard represent the push button Press it to cycle output voltage between 1V to 3V ");
scanf("%d",&button);
//loop for cycling between 1V to 3V
while(button==1)
{
for(iterator=1;iterator<=3;iterator++){
outputVoltage=i;
printf(" Output Voltage=%dV ",i);
Sleep(500);//inbuilt function in c that halts the output for some time
}
}
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.