Question

in MSP430 design tutorial using F5529 in lab 6 If I wanted to blink LED2 (green)...

in MSP430 design tutorial

using F5529

in lab 6

If I wanted to blink LED2 (green) every 2 seconds and LED1 (red) every 1 seconds, how would I set it up using Timers and Interrupts? You need not write any code, just explain how you would do it. (Hint: I’m not looking for a long answer here, but you’d have to do something different than what you did in lab).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans.

There are two ways solving this issue ,in first method you could use two timers in MSP430 and set the count value of the first for 1s and in the other you can set double the count (for 2sec) and the two leds can be toggled when the interrupt gets fired. Here we used two ISR's and two timers. In the second method we only use one timer ,set its count for triggering every one second ,in the ISR you need to write code such that only when interrupt is fired twice, the green led is toggled(two second) and the red led is toggled on each interrupt.

For keeping in track that the interrupt is fired twice you can use flag variables to store how many times the interrupt is fired and only on second consecutive firing the green led is toggled. For red led you could toggle it in each interrupt trigger. It is more challenging to do with only one timer and it is also more efficient. Please do try both the methods.

Add a comment
Know the answer?
Add Answer to:
in MSP430 design tutorial using F5529 in lab 6 If I wanted to blink LED2 (green)...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. How many Timers does the F5529 have? Name them. What happens when the Timer overflows?...

    1. How many Timers does the F5529 have? Name them. What happens when the Timer overflows? And what exactly does "overflow" mean? 2. What is the name of the register that "counts?" 3. 4. What is the name of the Timer A Interrupt Flag? 5. What is "resolution?" State 2 ways you can change it. What are the different Timer Modes and how do they work? 6. 7. What is the advantage of Up Mode vs Continuous Mode? What settings...

  • In this lab, you will exercise 2 things: programming interrupts and configuring/using the timers. It's assumed...

    In this lab, you will exercise 2 things: programming interrupts and configuring/using the timers. It's assumed you are already well versed in I/O This assignment will be worth 10 points 2 point Configuring timer(s) correctly l point- Configuring interrupts correctly 3 point-Implementing ISRs correctly 1 point- All other required configurations 3 points-Correct program behavior Create a new project in Keil, named "Lab5". In this project, you should: 1 - Disable the Watchdog timer! 2- Configure the LEDs (P1.0 and P2.0,...

  • Lab 1-Lab Portion Part I Copy the Blink program from Figure 1-13 (page 17) in the textbook and run it on your Arduino. After verifying that the Blink program works, modify the program to make the...

    Lab 1-Lab Portion Part I Copy the Blink program from Figure 1-13 (page 17) in the textbook and run it on your Arduino. After verifying that the Blink program works, modify the program to make the on-board LED attached to pin #13 blink out "SOS" in Morse code. Use a 2 750 millisecond for long pulses. 50 millisecond for short pulses and a Part 2, Write a program that uses two pushbuttons to increase or decrease the brightness of the...

  • I need help with doing these tasks for code composer Lab 3 - Branching, Push Button...

    I need help with doing these tasks for code composer Lab 3 - Branching, Push Button and LEDs-Reading Assignment in this lab, we are going to control a LED via a push button- using general purpose digital 10 for both input (button) and output (LED) on port 1 - using Code Composer Studio. Furthermore, we are going to use a branch instruction to create an IF-ELSE structure in assembly to determine if the LED should be lit up based on...

  • Static Equilibrium Lab: Wheel and Axle If you wanted to lift something heavy using this device, w...

    Static Equilibrium Lab: Wheel and Axle If you wanted to lift something heavy using this device, would you have the heavy object connected to the larger disc and then pull one the smaller disc, or vice-versa? Why? What would be the effect of using this device on the speed that the object lifts? That is, if you pulled your string at a speed of 10 cm/s, would the object lift 10 cm/s, or would it lift faster or slower? Activity...

  • C++ i want Lab#3 done can u make clear code so I could understand it. Lab#2The...

    C++ i want Lab#3 done can u make clear code so I could understand it. Lab#2The objective of this lab is compare the populations of various cities that lie in between Toledo and Dayton on I-75. Write a program that produces a bar illustrating the populations. The program should read the name of the city and its population from a file. Have the program continue this process until the end of file is reached. For each city, your program should...

  • Please help with my car traffic simulator! Code that I already have below, I do not know how to...

    Please help with my car traffic simulator! Code that I already have below, I do not know how to start it off! public class IntersectionSimulation { private final static int EAST_WEST_GREEN_TIME = 30 ; private final static int[] NORTH_SOUTH_GREEN_TIMES = { 20, 24, 30, 42 } ; private final static int[] CAR_INTERSECTION_RATES = { 3, 5, 10 } ; private final static int[] CAR_QUEUEING_RATES = { 5, 10, 30 } ; private final static int[] EXPERIMENT_DURATIONS = { 3*60, 5*60,...

  • Please help 15. During our paper lab experiment, we compared the tumor cells from one patient...

    Please help 15. During our paper lab experiment, we compared the tumor cells from one patient to the normal cells of the same patient. If we wanted to do a larger study to give a larger picture of what is going on in colon cancer cells which of the following would be a better way to set up the experiment? A. Collect cancer cells and normal cells from 1000 patients and run 1000 different microarrays (one for each person) and...

  • I need help trying to design this RC-circuit. PHYS 2120 LAB 6 - RC Circuit Capstone...

    I need help trying to design this RC-circuit. PHYS 2120 LAB 6 - RC Circuit Capstone For example, if we wait long enough, eventually what do you expect the voltage over the capacitor to become? Part 1: Design an RC-circuit to charge a capacitor as quickly as possible. Your circuit must include the following elements (and only these elements): A Switch, a 10V Battery, a 0.1 F Capacitor, a 250 resistor, a 500 resistor, two 7512 resistors, a 1000 resistor,...

  • 1. (9 points) In this Question, we are going to perform DSBSC modulation using MAT- LAB....

    1. (9 points) In this Question, we are going to perform DSBSC modulation using MAT- LAB. The signal we want to use is a speech signal. Here is the block diagram of ths system we want to simulate: Modulation Demodulation ult gt) m(t) x Butterworth LPF mr(t) c(t) Gr(t) Figure 1: DSBSC modulation and demodulation. (a) Since we are working with speech signals, we will choose a sampling frequency that is much larger than the bandwidth of the signals. As...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT