Question

Write a program for the msp430FR6989 to make led1 and led 2 alternate blinking 2. repeat...

Write a program for the msp430FR6989 to make led1 and led 2 alternate blinking 2. repeat the program to make each led blink 5 times in a sequence, then 5 times simultaneously

Homework Answers

Answer #1

Hello,
       Please find the answer to the first question (Program 1) attached below. If the answer has helped you please give a thumbs up rating. Thank you and have a nice day!

************ C Code for Led 1 and 2 alternate blinking *******

//Demo app to blink LED1 and LED2 on the TI Launchpad
//which is attached to P1.0 and P2.0 respectively
//The green LED(LED2) is connected to P1.6

#include <msp430g2553.h>

int main(void) {
volatile int i;

// stop watchdog timer
WDTCTL = WDTPW | WDTHOLD;
// set up bit 0 and bit 1 of P1 as output
P1DIR = 0x02;
// intialize bit 0 of P1 to 0 and bit 1 to 1
P1OUT = 0x02;


// loop forever
for (;;) {
    // toggle bit 0 and bit 1 of P1
    P1OUT ^= 0x03;
    // delay for a while
    for (i = 0; i < 0x6000; i++);
}
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write an assembly program that toggles a LED connected to pin4 of PORTB with a custom...
Write an assembly program that toggles a LED connected to pin4 of PORTB with a custom delay time.
Write CCS(code composer studio) command for The microcontroller(MSP430g2553). It will wait for a button push with...
Write CCS(code composer studio) command for The microcontroller(MSP430g2553). It will wait for a button push with the red LED on and Green Led off. Once the button is pushed, the red led will go off, and green LED will light for 5 seconds. (Use a slight delay here (specific timing not specified). During that time, the MCU will keep track of button pushes. After 5 seconds, it will blink the red LED t he same number of times that were...
In Java. Write a program that reads-in a times table-number. The program, using this table-number will...
In Java. Write a program that reads-in a times table-number. The program, using this table-number will produce the following report (as shown). The first item in the report is a number with starting value 1. Second column is the word “ X ” (representing the times symbol). Third column is the table-number (itself). Following is an equal sign “ = “ (representing a result). Last column is the result of the operation for that line or row which is the...
Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is...
Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is generated by adding the two most recent sequence numbers together, i.e., 1, 1, 1+1-2, 1+2=3, 2+3=5, 3+5=8, … The user will enter the number of terms in the sequence to be displayed. Assemble this program using the VSC assembler (ASM), and simulate this program using the VSC simulator (SIM). Include a copy of the source listing (SOURCE.DAT), the assembled listing (SLIST.DAT) and the simulation...
Write a Java program segment (not an entire program) that will summarize the season results for...
Write a Java program segment (not an entire program) that will summarize the season results for 5 players on one of TRU’s basketball teams. Each player played 10 games. Your program segment should ask the user for a player’s name, followed by the points that player scored in each of the 10 games (a total of 11 pieces of input). Your program will then produce the summary line shown below for that player.   Your program should get the data for...
Write a program which: Write a program which uses the following arrays: empID: An array of...
Write a program which: Write a program which uses the following arrays: empID: An array of 7 integers to hold employee identification numbers. The array should be initialized with the following values: 1, 2, 3, 4, 5, 6, 7. Hours: an array of seven integers to hold the number of hours worked by each employee. payRate: an array of seven doubles to hold each employee’s hourly pay rate. Wages: an array of seven doubles to hold each employee’s gross salary....
using C++ 1) write a program to calculate to avg of N number of subjects. 2)write...
using C++ 1) write a program to calculate to avg of N number of subjects. 2)write a program to find the factorial of 5! 5*4*3*2*1 3)write a program to display the multiplication table for any number please enter number : 3 1*3=3 2*3=6 2*4= 10*3=30 4) find the factorial on n
1. Write an instruction sequence to copy the contents of the program memory location at 0x2010...
1. Write an instruction sequence to copy the contents of the program memory location at 0x2010 to data memory location at 0x2000. 2. Write an instruction sequence to copy the contents of the data memory location at 0x2000 to data memory location at 0x2050.
Please Write the whole program in assembly i am able to calculate the fibonacci series but...
Please Write the whole program in assembly i am able to calculate the fibonacci series but not sure how to print it in reverse order. Please give a Complete code !! Programming Exercise 1 (10 points): [call it Ass2-Q1.asm] Write an ASM program that reads an integer number N and then displays the first N values of the Fibonacci number sequence, described by: Fib(0) = 0, Fib(1) = 1, Fib(N) = Fib(N-2) + Fib(N-1) Thus, if the input is N...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times and counting the number of heads. Repeat this experiment 10**5 times to obtain the number of heads for every 16 tosses; save the number of heads in a vector of size 10**5 (call it headCounts). You should be able to do this in 1-3 lines of numpy code. (Use np.random.uniform1 to generate a 2d array of 10**5 x 16 random numbers between 0 and...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT