Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions