Question

Write a C program that will output clock signals to port 1 of MSP430. Assume that...

Write a C program that will output clock signals to port 1 of MSP430. Assume that clock inputs are as follows: ACLK = LFXT1 = 32768, MCLK = DCO Max, SMCLK = XT2

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

Solution:

code:

#include <msp430x14x.h>

void main(void)

{

// WDT 250ms, ACLK, interval timer

WDTCTL = WDT_ADLY_250;

IE1 |= WDTIE; // Enable WDT

interrupt

P1DIR |= 0x01; // Set P1.0 to

output direction

// Enter LPM3 w/interrupt

_BIS_SR(LPM3_bits + GIE);

}

// Watchdog Timer i

nterrupt service

routine

interrupt[WDT_TIMER] void

watchdog_timer(void)

{

P1OUT ^= 0x01;

// Toggle P1.0

using exclusive-OR

}

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Add a comment
Know the answer?
Add Answer to:
Write a C program that will output clock signals to port 1 of MSP430. Assume that...
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
  • Write a C program that will output clock signals to port 4 of MSP430. Assume that...

    Write a C program that will output clock signals to port 4 of MSP430. Assume that clock inputs are as follows: ACLK = LFXT1 = 32768, MCLK = DCO Max, SMCLK = XT2.

  • USING KNOWLEDGE FROM C LANGUAGE PRGRAMMING DONT COMPILE ONLY JUST READ EACH OF THE FOLLWING LINES...

    USING KNOWLEDGE FROM C LANGUAGE PRGRAMMING DONT COMPILE ONLY JUST READ EACH OF THE FOLLWING LINES AND EXPLAIN WHAT THE LINES ARE DOING. #include <stdint.h> //exact-width integer types #include <ti\devices\msp432p4xx\driverlib\driverlib.h> //driver library #define DCO_FREQ 48e6 //unit: Hz uint32_t mclk, hsmclk, smclk, aclk, bclk; void main(void) { uint32_t n; WDT_A_holdTimer(); //stop watchdog timer //Set the DCO Frequency. //Only use DCO nominal frequencies: 1.5, 3, 6, 12, 24, 48MHz. //Enable FPU for DCO Frequency calculation. //Change VCORE to 1 to support a...

  • Name: Grade: 710 [10] 1) For the following MSP430 C program, fill in the comments next...

    Name: Grade: 710 [10] 1) For the following MSP430 C program, fill in the comments next to the // to indicate the function of the corresponding line. Be brief, no more than one line per comment; be inspired by the existing comments. #include <msp43092553.b> //LEDI mounted on bit as an output #define LEDI B ITO #define LED2 BITO #define BUTTON BIT3 unsigned int folds = 1; int i=1; void main(void) WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer PLOUT...

  • 1=Write a program in C to get 16-bit data from Port-D and send it to ports...

    1=Write a program in C to get 16-bit data from Port-D and send it to ports Port-B 2-Write instructions in C to toggle both bits RD7 and RD0 continuously 3-Write instructions in C to get the status of RB2 and put it on RB0 4-Code a simple program in C to send 3499H to Port B and Port D.

  • 04. a) Write an 8051 C program to send values 00 through FFH to port Pl. b) Write an 8051 C program to send values -3 to +3 to port P1. c) Write an 8051 C program to toggle all bits of P1 (between 55...

    04. a) Write an 8051 C program to send values 00 through FFH to port Pl. b) Write an 8051 C program to send values -3 to +3 to port P1. c) Write an 8051 C program to toggle all bits of P1 (between 55H and AAH) with some delay d) A door sensor is connected to P1.1 and a buzzer to P1.7. Write an 8051 C program to monitor the sensor and when it opens (0') sound the buzzer...

  • Write a Verilog program to describe a sequential circuit that has input X and output Z....

    Write a Verilog program to describe a sequential circuit that has input X and output Z. Z goes to 1 whenever the last four X inputs (in four clock cycles) are 1001 or 0110. Use a switch (SW1) on the DE1 board for X and a red LED for Z. Use a push button as the clock input. Use both the Moore and Mealy models to describe the circuit.

  • Write assembly or C software to implement the following Mealy FSM (Figure 2.42). Include the FSM state machine, port ini...

    Write assembly or C software to implement the following Mealy FSM (Figure 2.42). Include the FSM state machine, port initialization, timer initialization, and the FSM controller. The command sequence will be input, output, wait 10 ms, input, then branch to next state. The 1-bit input is on Port P (PP0), and the 3-bit output is on Port P (PP3, PP2, PP1). Assume the E clock is 8 MHz. Microcontroller MC9S12 0/4 Happy Hungry 1/2 1/5 1/3 06 Sleepy Figure 2.42...

  • To become familiar with using Port A and Port H as input ports H as an input port and port B as an output port

    Goal: To become familiar with using Port A and Port H as input ports H as an input port and port B as an output port, using dragon12-Light boards as well as to improve your programming skills.Project: Write an assembly program and a C program to do the following:When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs and let them stay on even after the switch #8 is changed to low.When DIP...

  • How to write a program to draw the output of a picture use c programming Assignment...

    How to write a program to draw the output of a picture use c programming Assignment Output 2 to power n 2 to power-n 2 4 8 16 3 2 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 1OOOOO0ooo000 O.50O0OO0000OOO 0.250000000OOO O.125000ooooOO O.062500OoooOO O.031250OoooOO 0.015625000O00 O.00781250000O O.0039062500OO O.0019531250OO O.000976562500 O.000488281250 O.000244140625 O.0o0122070313 O.000061035156 O.0o0030517578 O.ooO015258789 O.ooO007629395 O.ooO003814697 O.ooO001907349 O.0oOO00953674 2 3 6 8 10 12 1 3 15 16 17 18 19 20

  • Can someone solve it with C plz Write a program that inputs a time from the...

    Can someone solve it with C plz Write a program that inputs a time from the console. The time should be in the format “HH:MM AM” or “HH:MM PM”. Hours may be one or two digits, for example, “1:10 AM” or “11:30 PM”. Your program should include a function that takes a string parameter containing the time. This function should convert the time into a four digit military time based on a 24 hour clock. For example, “1:10 AM” would...

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