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 MHz MSI system clock. Use PA to drive LED transistor and blink an LED with a period of seconds second on onsecond off Monitor Pin PCthe User Button Note that this pin will need an internal pullup 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 PC and PCThe low power states to be used in most of the programs are trigger by the following code.HALPWREnterSLEEPModePWRMAINREGULATORONPWRSLEEPENTRYWFI;HALPWREnterSLEEPModePWRLOWPOWERREGULATORONPWRSLEEPENTRYWFI;HALPWRExEnterSTOPModePWRSTOPENTRYWFI;HALPWRExEnterSTOPModePWRSTOPENTRYWFI;HALPWRExEnterSTOPModePWRSTOPENTRYWFI;HALPWRExEnterSHUTDOWNMode;These can be uncommented to put the program into a WFIWaitforinterrupt in various lowpowerstates. Place these functions in while 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 HALDelay function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
