Question

In: Electrical Engineering

An MSP430 microcontroller system is to be designed with the following requirements: The circuit operates from...

An MSP430 microcontroller system is to be designed with the following requirements:

The circuit operates from a 5 V supply with a decoupling capacitor.

2 LEDs (IF=15mA, VF = 1.9V) are connected to pins P1.2, P1.3. P1.4 on the microcontroller. These LEDs should have appropriate current limiting resistors and be connected in a sinking arrangement.

1 Push button should be connected to P2.1 using an external pull-up resistor

1 Push button should be connected to P2.2 using the internal pull-up resistor

A timer will be used to toggle P1.2.

A 20K? potentiometer is connected (as a voltage divider) to analog input 0 (A0).

>Draw a circuit which matches the above description. Calculations or justification should be shown for the resistors chosen for the circuit.

>Write an Embedded C function to setup the pins, pull-up resistors, special function and analog input registers: (Hint: The following registers should be modified: PxDIR, PxOUT, PxREN, ADC10AE0, PxSEL)

>Explain why a resistor is used when interfacing each LED with the microcontroller. What is the purpose of this resistor?

>Explain why a resistor is used when interfacing each switch with the microcontroller. What is the purpose of this resistor?

>Assuming the 10-Bit ADC on the MSP430 is used, what would be the input voltage to the ADC if the value returned in the ADC10MEM register was 500 (assuming the analog full scale voltage is 1.6V)?

Solutions

Expert Solution

Solution:

The circuit should have DC-DC Converter with decoupling capacitor to convert the 5V Supply to 3.3V output for the MSP430 micro controller.

Two LEDs are connected for P1.2 and P1.3 ports in sinking arrangement as and it is also called active high configuration. when outpin pin is high, then LED is ON and OF,F if otherwise.

A dip switch is connected to P2.1 port with external pull up resistor and the current is limited by the pull up resistor and when switch is pressed and read low.  

A dip switch is connected to P2.2 port with internal pull up resistor and the current is limited by the pull up resistor and when switch is pressed and read low.  Pull-up resistors can be activated by setting bits in the PxREN registers in MSP430 microcontrollers provided that the pin is configured as an input.

20K potentiometer is connected to A0 analog input as shown below.

The embedded C function can be written as to define all peripherals as

void int_io();

void int_io()
{
P1DIR |=0X0C; //set P1.2 and P1.3 to set the control digital IO data port as output port
P2DIR &=0X60; //Set P2.1 and P2.2 as input port- dipswitch

P2REN = |= 0x04; //toenable internal pull up for Port P2.2

P1SEL = 0x01; // tomake the P1.0 pin as anaog input

ADC10AE0 = 0x01; // Enable analog input on channel 0

}

The purpose of the resistor is to limit the acceptable current to flow through LED.

The purpose of the resistor is to restrict the flow the current through the resistor when switch is closed to minimize the power dissipation in the circuit.


Related Solutions

DTMF home automation system using ATMEGA8 i need the circuit and the code for the microcontroller
DTMF home automation system using ATMEGA8 i need the circuit and the code for the microcontroller
Design and program an Arduino-based circuit that contains the following items - 1 Arduino Uno microcontroller....
Design and program an Arduino-based circuit that contains the following items - 1 Arduino Uno microcontroller. - 1 IR remote control, - 1 IR sensor - 1 LCD 16x2 Display - Any other components you find necessary. The circuit will do the following: - The circuit represents a 2-digit calculator. - At start of operation, the LCD display should display “0” in line 2 of the LCD display. - Pressing the On/Off button on the IR remote represents the “Clear”...
Design an embedded system using MSP430 to control a traffic light system. It is included a...
Design an embedded system using MSP430 to control a traffic light system. It is included a complete design description of a traffic light system to help you in your design. Show the hardware schematics and the software needed to complete your design.
Consider the following system of equations for all problems. The following system of equations is designed...
Consider the following system of equations for all problems. The following system of equations is designed to determine concentrations (the c’s in g/m3) in a series of coupled reactors as a function of the amount of mass input to each reactor (the right-hand sides in g/day). 8?1 − 4?2 − 2?3 = 2000 −3?1 + 18?2 − 6?3 = 1400 −4?1 − 2?2 + 12?3 = 3000 Calculate and interpret the condition number. Use the row-sum norm. Scale the coefficient...
) Design a simple embedded system with PIC16F84A microcontroller (using 20MHz resonator). The system can drive...
) Design a simple embedded system with PIC16F84A microcontroller (using 20MHz resonator). The system can drive a LED light on for 52.6ms on and 26ms off repeatedly. A watchdog timer should be enabled and have a time out period of 72 ms. Sketch the circuit and write the complete assembly program.
Design an embedded system using a MSP430 to create a slot machine. Include a complete description...
Design an embedded system using a MSP430 to create a slot machine. Include a complete description of a slot machine designed using logic circuits. You must submit a complete design with all the hardware and software needs, include a c program that utilizes the msp430 for this.
what are the ingredients to design a security system using Microcontroller MSP 430? and what is...
what are the ingredients to design a security system using Microcontroller MSP 430? and what is the proper flowchart for this system?
Determine if the following requirements for a wet well control system, are consistent: a) If the...
Determine if the following requirements for a wet well control system, are consistent: a) If the pump is on then the valve shall be open. b) If the valve is closed then the water level is ≤ 10 meters. c) If the water level is >10 meters then the pump is on.
Consider the following set of requirements for a university information system that is used to keep...
Consider the following set of requirements for a university information system that is used to keep track of students’ transcripts. R1: The university keeps track of each student's name, student number, class, and degree program. R2. The university consists of various departments. Each department is described by a name, department code and phone. R3. Each course has a course number, course name, and credits. R4. Each section has an instructor, course number, and section number. There might be multiple sections...
What is an Ethics Compliance Program designed to accomplish? What are the minimum requirements of such...
What is an Ethics Compliance Program designed to accomplish? What are the minimum requirements of such a program?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT