An MSP430 microcontroller system is to be designed with thefollowing requirements:
The circuit operates from a 5 V supply with a decouplingcapacitor.
2 LEDs (IF=15mA, VF = 1.9V) are connectedto pins P1.2, P1.3. P1.4 on the microcontroller. These LEDs shouldhave appropriate current limiting resistors and be connected in asinking arrangement.
1 Push button should be connected to P2.1 using an externalpull-up resistor
1 Push button should be connected to P2.2 using the internalpull-up resistor
A timer will be used to toggle P1.2.
A 20K? potentiometer is connected (as a voltage divider) toanalog input 0 (A0).
>Draw a circuit which matches the above description.Calculations or justification should be shown for the resistorschosen for the circuit.
>Write an Embedded C function tosetup the pins, pull-up resistors, special function and analoginput registers: (Hint: The following registers should be modified:PxDIR, PxOUT, PxREN, ADC10AE0, PxSEL)
>Explain why a resistor is usedwhen interfacing each LED with the microcontroller. What is thepurpose of this resistor?
>Explain why a resistor is usedwhen interfacing each switch with the microcontroller. What is thepurpose of this resistor?
>Assuming the 10-Bit ADC on theMSP430 is used, what would be the input voltage to the ADC if thevalue returned in the ADC10MEM register was 500 (assuming theanalog full scale voltage is 1.6V)?