Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN: 9780133923605
Author: Robert L. Boylestad
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

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.

Expert Solution
Check Mark
Step 1: Configuring the I/O Lines

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.


Knowledge Booster
Background pattern image
Electrical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:PEARSON
Text book image
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Electrical Engineering
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Text book image
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:9780078028229
Author:Charles K Alexander, Matthew Sadiku
Publisher:McGraw-Hill Education
Text book image
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:9780134746968
Author:James W. Nilsson, Susan Riedel
Publisher:PEARSON
Text book image
Engineering Electromagnetics
Electrical Engineering
ISBN:9780078028151
Author:Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:Mcgraw-hill Education,