Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING KNOWLEDGE FROM C LANGUAGE PRGRAMMING DONT COMPILE ONLY JUST READ EACH OF THE FOLLWING LINES AND EXPLAIN WHAT THE LINES ARE DOING. #include //exact-width

USING KNOWLEDGE FROM C LANGUAGE PRGRAMMING DONT COMPILE ONLY JUST READ EACH OF THE FOLLWING LINES AND EXPLAIN WHAT THE LINES ARE DOING.

#include //exact-width integer types

#include //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 frequency higher than 24MHz.

//See data sheet for Flash wait-state requirement for a given frequency.

FPU_enableModule();

PCM_setCoreVoltageLevel(PCM_VCORE1);

FlashCtl_setWaitState(FLASH_BANK0, 1);

FlashCtl_setWaitState(FLASH_BANK1, 1);

CS_setDCOFrequency(DCO_FREQ);

//Init clock signals: MCLK, HSMCLK, SMCLK.

//Can be divided by 1, 2, 4, 8, 16, 32, 64, or 128.

CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);

CS_initClockSignal(CS_HSMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_8);

CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_16);

//Get clock signals settings.

mclk = CS_getMCLK();

hsmclk = CS_getHSMCLK();

smclk = CS_getSMCLK();

aclk = CS_getACLK();

bclk = CS_getBCLK();

//Configure P1.0 as output.

//P1.0 is connected to a red LED on LaunchPad.

GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);

while(1)

{

//simple delay loop

for(n=0; n<1000000; n++)

{

//do nothing

}

GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0);

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Prove: Turing - recognizable languages are: undecidable

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago