Program for measures the wind direction-vane, Assembly Language

You are to create an assembly program for the MSP430 that correctly measures the wind direction, to a precision of 45° (N, NW, W, SW, S, SE, E, NE), using the MSP430's ADC.

Your program will output the direction using four LEDs, one each for N, S, E, and W. If the wind direction is out of the N, only the N LED will light. If the wind direction is out of the NW, both the N and W LEDs with be ON.

Note that the actual circuit interfacing to the wind vane will use the 3.6V supply on the

Launchpad board itself. This means that voltage readings provided in the table on the following page need to be appropriately scaled. As per the table, a 10kohm resistor will be used in the voltage divider.

As only one wind vane is available for use, test your code using a pot connected between ground and 3.6 V (the supply voltage for your board). The wind vane will be available in 310 for final check-out. Pots, LEDs, and resistors will be provided in 310.

Your program must use at least one subroutine. You are free to choose which functionality to place in the subroutine.

Extra Credit:

(1) Correctly measure all 16 directions possible by the vane. Develop some mechanism for visually displaying the added directions.

(2) Store the voltages corresponding to the specific directions as constants in a memory array (see example below). Have your code cycle through this array until a match is found.

ORG 0xD000

DC 0x1234, 0xABCD, ... ;replace w/ calculated voltages

Wind Vane

The wind vane is the most complicated of the three sensors. It has eight switches, each connected to a different resistor. The vane's magnet may close two switches at once, allowing up to 16 different positions to be indicated. An external resistor can be used to form a voltage divider, producing a voltage output that can be measured with an analog to digital converter, as shown below.

The switch and resistor arrangement is shown in the diagram to the right.

Resistance values for all 16 possible positions are given in the table.

Resistance values for positions between those shown in the diagram are the result of two adjacent resistors connected in parallel when the vane's magnet activates two switches simultaneously.

2042_anemometer.png

Posted Date: 3/4/2013 7:25:42 AM | Location : United States







Related Discussions:- Program for measures the wind direction-vane, Assignment Help, Ask Question on Program for measures the wind direction-vane, Get Answer, Expert's Help, Program for measures the wind direction-vane Discussions

Write discussion on Program for measures the wind direction-vane
Your posts are moderated
Related Questions
LENGTH : Byte Length of a Label: This directive is not available in MASM. This is used to mention to the length of a data array or a string. MOV CX. LENGTH ARRAY This sta

NEG: Negate:- The negate instruction forms the 2's complement of the particular destination in the instruction. For obtaining 2's complement, it subtracts the contents of destinat

;StrNCpyAsm - copy zero terminated string2 to zero terminated string1, ; but copy no more than count (parameter) characters ; or the length of string2, whi

DMA Hardware (8237 DMAC) :   1)Processor contain HOLD/HOLD Acknowledge lines to interact with 8237 o   DMAC can achieve control of ISA bus by asserting HOLD o   P

Develop an assembly language program for the system and simulate it using MPLAB. From this produce a demo program (in Assembly language) that will run on the MatrixMultimedia Devel

ADC: Add with Carry:- This instruction performs the similar operation a like ADD instruction, but adds the carry flag bit (which might be set as a result of the previous calculatio


Using the AddSub program from Ch3 under c:\Masm615\examples as a reference, write a program that subtracts three 16-bit integers using only registers. Insert a call DumpRegs statem

move a byte string ,16 bytes long from the offset 0200H to 0300H in the segment 7000H..

I/O interface I/O  devices such as displays and keyboards  establish  communication of computer with outside world. Devices may be interfaced in 2 ways Memory mapped I/O and I/