Question: Use automatic code generation and some of your own code to create the following variations. Therequirements for each program are that: Uses a 4 MHz

Use automatic code generation and some of your own code to create the following variations. Therequirements for each program are that: Uses a 4MHz MSI system clock. Use PA0 to drive LED transistor and blink an LED with a period of 2 seconds (1 second on, onsecond off). Monitor Pin PC13(the User Button). Note that this pin will need an internal pull-up resistor andthe button will connect to ground. Disable all other pins and clocks (except on RTC program, then leave the LSE power and thepins assigned to PC14 and PC15)The low power states to be used in most of the programs are trigger by the following code.//HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON,PWR_SLEEPENTRY_WFI);//HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON,PWR_SLEEPENTRY_WFI);//HAL_PWREx_EnterSTOP0Mode(PWR_STOPENTRY_WFI);//HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);//HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);//HAL_PWREx_EnterSHUTDOWNMode();These can be uncommented to put the program into a __WFI()(Wait-for-interrupt) in various low-powerstates. Place these functions in while(1) loop.The programs that are to be generated area. Blink with CPU clocki. Counts a volatile variable inside the CPU program to create the period. Do not use the HAL_Delay function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!