Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions given. Using DISCO-L476VG board. 1. Configure the USER_BUTTON input as in external interrupt. Configure this interrupt to call an Interrupt Service Routine (ISR) on

Instructions given. Using DISCO-L476VG board.

1. Configure the USER_BUTTON input as in external interrupt. Configure this interrupt to call an Interrupt Service Routine (ISR) on the falling edge of the button (when the button is pressed). Write an ISR that toggles LED1 every time the button is pressed.

2. Add code to configure another interrupt that is triggered by the rising edge of the USER_BUTTON input (when the button is released). Add another ISR that configures a timer to turn LED1 off after a delay of one second.

3. You code should not turn on LED1 when the blue button is pressed and then turn off the LED 1 second after the button is release.

Code written according to instructions. Code is FUNCTIONAL.

image text in transcribed

Questions needing answers to.

Explain what interrupts you configured and why.

Explain how to configure a timer, how to read the timer in real-real time, and how to configure interrupts at 2, 10, and 100 second intervals.

How would you use timers and an oscilloscope or logic analyzer to measure the CPU clock if you didnt know it?

include "mbed.h" Ticker turnoff Interrupt!n button(PA-0); DigitalOut led1 (LED1); Digitalout led2 (LED2); void ledoff() led1-0; void flip) ed1=1; turnoff.attach (&ledoff,1.0); void rise) int main) button.fall (&flip); button.rise(&rise); include "mbed.h" Ticker turnoff Interrupt!n button(PA-0); DigitalOut led1 (LED1); Digitalout led2 (LED2); void ledoff() led1-0; void flip) ed1=1; turnoff.attach (&ledoff,1.0); void rise) int main) button.fall (&flip); button.rise(&rise)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions