SlideShare a Scribd company logo
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.
Solution
#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
}

More Related Content

More from richard981

Why might a small corporation organize as an S corporation- An S corpo.docx
Why might a small corporation organize as an S corporation- An S corpo.docxWhy might a small corporation organize as an S corporation- An S corpo.docx
Why might a small corporation organize as an S corporation- An S corpo.docx
richard981
 
Why might elemental bromine and iodine be more soluble in dicholormeth.docx
Why might elemental bromine and iodine be more soluble in dicholormeth.docxWhy might elemental bromine and iodine be more soluble in dicholormeth.docx
Why might elemental bromine and iodine be more soluble in dicholormeth.docx
richard981
 
Why lack of control got Comcast in trouble-Solutionthe media player is.docx
Why lack of control got Comcast in trouble-Solutionthe media player is.docxWhy lack of control got Comcast in trouble-Solutionthe media player is.docx
Why lack of control got Comcast in trouble-Solutionthe media player is.docx
richard981
 
Why might a company accept a project or investment with an NPV less th.docx
Why might a company accept a project or investment with an NPV less th.docxWhy might a company accept a project or investment with an NPV less th.docx
Why might a company accept a project or investment with an NPV less th.docx
richard981
 
Why is Pluto so small- compared to the gas giants- Pick the one best a.docx
Why is Pluto so small- compared to the gas giants- Pick the one best a.docxWhy is Pluto so small- compared to the gas giants- Pick the one best a.docx
Why is Pluto so small- compared to the gas giants- Pick the one best a.docx
richard981
 
Why is it important to use multiple performance measurements when eval.docx
Why is it important to use multiple performance measurements when eval.docxWhy is it important to use multiple performance measurements when eval.docx
Why is it important to use multiple performance measurements when eval.docx
richard981
 
Why does the absorption spectrum of as semiconductor have a sharp-stee.docx
Why does the absorption spectrum of as semiconductor have a sharp-stee.docxWhy does the absorption spectrum of as semiconductor have a sharp-stee.docx
Why does the absorption spectrum of as semiconductor have a sharp-stee.docx
richard981
 
why is it important to understand culturesSolutionIt important to unde.docx
why is it important to understand culturesSolutionIt important to unde.docxwhy is it important to understand culturesSolutionIt important to unde.docx
why is it important to understand culturesSolutionIt important to unde.docx
richard981
 
Why is goal setting important- What are three benefits- What are three.docx
Why is goal setting important- What are three benefits- What are three.docxWhy is goal setting important- What are three benefits- What are three.docx
Why is goal setting important- What are three benefits- What are three.docx
richard981
 
Why is frequency reuse of 1 possible and what is the number of users p.docx
Why is frequency reuse of 1 possible and what is the number of users p.docxWhy is frequency reuse of 1 possible and what is the number of users p.docx
Why is frequency reuse of 1 possible and what is the number of users p.docx
richard981
 
why EI can not be used in determining protein primary structures-Solut.docx
why EI can not be used in determining protein primary structures-Solut.docxwhy EI can not be used in determining protein primary structures-Solut.docx
why EI can not be used in determining protein primary structures-Solut.docx
richard981
 
Why is anion suppression necessary in ion chromatography-SolutionAnion.docx
Why is anion suppression necessary in ion chromatography-SolutionAnion.docxWhy is anion suppression necessary in ion chromatography-SolutionAnion.docx
Why is anion suppression necessary in ion chromatography-SolutionAnion.docx
richard981
 
why does an atoms electronegativity decrease down a column in the peri.docx
why does an atoms electronegativity decrease down a column in the peri.docxwhy does an atoms electronegativity decrease down a column in the peri.docx
why does an atoms electronegativity decrease down a column in the peri.docx
richard981
 
Why does iodine have a much lower melting point than sodium iodide- W.docx
Why does iodine have a much lower melting point than sodium iodide-  W.docxWhy does iodine have a much lower melting point than sodium iodide-  W.docx
Why does iodine have a much lower melting point than sodium iodide- W.docx
richard981
 
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docxWhy do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
richard981
 
Why does this kind of error happen- It is something about makefile- an.docx
Why does this kind of error happen- It is something about makefile- an.docxWhy does this kind of error happen- It is something about makefile- an.docx
Why does this kind of error happen- It is something about makefile- an.docx
richard981
 
Why do you think today-'s computer systems are so vulnerable-Solutiono.docx
Why do you think today-'s computer systems are so vulnerable-Solutiono.docxWhy do you think today-'s computer systems are so vulnerable-Solutiono.docx
Why do you think today-'s computer systems are so vulnerable-Solutiono.docx
richard981
 
Why does one firm in the same industry have a high ROE- one firm has a.docx
Why does one firm in the same industry have a high ROE- one firm has a.docxWhy does one firm in the same industry have a high ROE- one firm has a.docx
Why does one firm in the same industry have a high ROE- one firm has a.docx
richard981
 
Why do you think Starbucks has been so concerned with social responsib.docx
Why do you think Starbucks has been so concerned with social responsib.docxWhy do you think Starbucks has been so concerned with social responsib.docx
Why do you think Starbucks has been so concerned with social responsib.docx
richard981
 
Why do high levels of accruals appear to be mispriced-SolutionRichards.docx
Why do high levels of accruals appear to be mispriced-SolutionRichards.docxWhy do high levels of accruals appear to be mispriced-SolutionRichards.docx
Why do high levels of accruals appear to be mispriced-SolutionRichards.docx
richard981
 

More from richard981 (20)

Why might a small corporation organize as an S corporation- An S corpo.docx
Why might a small corporation organize as an S corporation- An S corpo.docxWhy might a small corporation organize as an S corporation- An S corpo.docx
Why might a small corporation organize as an S corporation- An S corpo.docx
 
Why might elemental bromine and iodine be more soluble in dicholormeth.docx
Why might elemental bromine and iodine be more soluble in dicholormeth.docxWhy might elemental bromine and iodine be more soluble in dicholormeth.docx
Why might elemental bromine and iodine be more soluble in dicholormeth.docx
 
Why lack of control got Comcast in trouble-Solutionthe media player is.docx
Why lack of control got Comcast in trouble-Solutionthe media player is.docxWhy lack of control got Comcast in trouble-Solutionthe media player is.docx
Why lack of control got Comcast in trouble-Solutionthe media player is.docx
 
Why might a company accept a project or investment with an NPV less th.docx
Why might a company accept a project or investment with an NPV less th.docxWhy might a company accept a project or investment with an NPV less th.docx
Why might a company accept a project or investment with an NPV less th.docx
 
Why is Pluto so small- compared to the gas giants- Pick the one best a.docx
Why is Pluto so small- compared to the gas giants- Pick the one best a.docxWhy is Pluto so small- compared to the gas giants- Pick the one best a.docx
Why is Pluto so small- compared to the gas giants- Pick the one best a.docx
 
Why is it important to use multiple performance measurements when eval.docx
Why is it important to use multiple performance measurements when eval.docxWhy is it important to use multiple performance measurements when eval.docx
Why is it important to use multiple performance measurements when eval.docx
 
Why does the absorption spectrum of as semiconductor have a sharp-stee.docx
Why does the absorption spectrum of as semiconductor have a sharp-stee.docxWhy does the absorption spectrum of as semiconductor have a sharp-stee.docx
Why does the absorption spectrum of as semiconductor have a sharp-stee.docx
 
why is it important to understand culturesSolutionIt important to unde.docx
why is it important to understand culturesSolutionIt important to unde.docxwhy is it important to understand culturesSolutionIt important to unde.docx
why is it important to understand culturesSolutionIt important to unde.docx
 
Why is goal setting important- What are three benefits- What are three.docx
Why is goal setting important- What are three benefits- What are three.docxWhy is goal setting important- What are three benefits- What are three.docx
Why is goal setting important- What are three benefits- What are three.docx
 
Why is frequency reuse of 1 possible and what is the number of users p.docx
Why is frequency reuse of 1 possible and what is the number of users p.docxWhy is frequency reuse of 1 possible and what is the number of users p.docx
Why is frequency reuse of 1 possible and what is the number of users p.docx
 
why EI can not be used in determining protein primary structures-Solut.docx
why EI can not be used in determining protein primary structures-Solut.docxwhy EI can not be used in determining protein primary structures-Solut.docx
why EI can not be used in determining protein primary structures-Solut.docx
 
Why is anion suppression necessary in ion chromatography-SolutionAnion.docx
Why is anion suppression necessary in ion chromatography-SolutionAnion.docxWhy is anion suppression necessary in ion chromatography-SolutionAnion.docx
Why is anion suppression necessary in ion chromatography-SolutionAnion.docx
 
why does an atoms electronegativity decrease down a column in the peri.docx
why does an atoms electronegativity decrease down a column in the peri.docxwhy does an atoms electronegativity decrease down a column in the peri.docx
why does an atoms electronegativity decrease down a column in the peri.docx
 
Why does iodine have a much lower melting point than sodium iodide- W.docx
Why does iodine have a much lower melting point than sodium iodide-  W.docxWhy does iodine have a much lower melting point than sodium iodide-  W.docx
Why does iodine have a much lower melting point than sodium iodide- W.docx
 
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docxWhy do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
Why do soluble impurities lower Tf of a solvent- Will insoluble impuri.docx
 
Why does this kind of error happen- It is something about makefile- an.docx
Why does this kind of error happen- It is something about makefile- an.docxWhy does this kind of error happen- It is something about makefile- an.docx
Why does this kind of error happen- It is something about makefile- an.docx
 
Why do you think today-'s computer systems are so vulnerable-Solutiono.docx
Why do you think today-'s computer systems are so vulnerable-Solutiono.docxWhy do you think today-'s computer systems are so vulnerable-Solutiono.docx
Why do you think today-'s computer systems are so vulnerable-Solutiono.docx
 
Why does one firm in the same industry have a high ROE- one firm has a.docx
Why does one firm in the same industry have a high ROE- one firm has a.docxWhy does one firm in the same industry have a high ROE- one firm has a.docx
Why does one firm in the same industry have a high ROE- one firm has a.docx
 
Why do you think Starbucks has been so concerned with social responsib.docx
Why do you think Starbucks has been so concerned with social responsib.docxWhy do you think Starbucks has been so concerned with social responsib.docx
Why do you think Starbucks has been so concerned with social responsib.docx
 
Why do high levels of accruals appear to be mispriced-SolutionRichards.docx
Why do high levels of accruals appear to be mispriced-SolutionRichards.docxWhy do high levels of accruals appear to be mispriced-SolutionRichards.docx
Why do high levels of accruals appear to be mispriced-SolutionRichards.docx
 

Recently uploaded

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
amberjdewit93
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

Write a C program that will output clock signals to port 4 of MSP430-.docx

  • 1. 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. Solution #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
  • 2. watchdog_timer(void) { P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR }