
using STDM 102 ARM®-based 32-bit MCUs, write an assembly routine to turn on one of the user LED’s.
You have to configure the I/O lines first. This should be done in a subroutine.
Now that you can control the LED, write a routine to blink the LED. HINT: toggling an LED in code happens very quickly!! Use a delay routine to leave an LED on long enough to see it light up. At the end of this phase, have your code blinking the LED off and on in a loop 10 times. Then
Then write a routine such that when the user presses the switch down, the LED will come on. When the user depresses the switch the light will turn off. This is called polling the state of the switch.

For the purposes of this solution, I will assume that you are using the STM32F102 series MCU. The exact names and values of registers might differ based on the exact STM32F102 model and the board being used.
I'll provide a general solution, and you might need to adjust it for your specific MCU/board.
Before we can control the LED, we need to configure the I/O pin connected to the LED as an output. This is done by setting the appropriate bits in the GPIOx_CRH or GPIOx_CRL register.
Step by stepSolved in 5 steps

- Introductory Circuit Analysis (13th Edition)Electrical EngineeringISBN:9780133923605Author:Robert L. BoylestadPublisher:PEARSONDelmar's Standard Textbook Of ElectricityElectrical EngineeringISBN:9781337900348Author:Stephen L. HermanPublisher:Cengage LearningProgrammable Logic ControllersElectrical EngineeringISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
- Fundamentals of Electric CircuitsElectrical EngineeringISBN:9780078028229Author:Charles K Alexander, Matthew SadikuPublisher:McGraw-Hill EducationElectric Circuits. (11th Edition)Electrical EngineeringISBN:9780134746968Author:James W. Nilsson, Susan RiedelPublisher:PEARSONEngineering ElectromagneticsElectrical EngineeringISBN:9780078028151Author:Hayt, William H. (william Hart), Jr, BUCK, John A.Publisher:Mcgraw-hill Education,





