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
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