Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Real Time Embedded Systems: 2. The requirement for this question is to simply measure the time elapsed while a single button {GPIO} is being pressed

Real Time Embedded Systems:

image text in transcribed
2. The requirement for this question is to simply measure the time elapsed while a single button {GPIO} is being pressed using interrupts. The GPIO pin is pulled to a high state when the button is not depressed. In this application, the button is mechanical and experiences signicant bouncing. The goal is to measure the contiguous time [in ms} between when the button is pressed and when the button is released, excluding the bouncing. See diagram below. timeElapsed You have already setup 3 interrupt handlers. One handler is the ISR that handles Timero's overow. That timer is set up with a prescaler of 32. a counter TOP value of 250, and is set up to reset to 0 and count up to TOP. The CLK is running at 16MH2. Here is the handler denition: void Timer9_0V_HandIerr J The other 2 handlers are for the pin that Is connected to the button. One handles the RISING transition. and the other handles the FALLING transition. Here are the denitions: void pinRisingJiandIex-(J void pink I Iingr_HandIer(} Write the required code snlpplts (In each handler) that assigns the variable time-Elapsed to the specified time in the timing diagram. You may add any additional variables, but be sure to state any assumptions

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

2 The main remaining disputes

Answered: 1 week ago

Question

The structure of liberty was a gift from what European country?

Answered: 1 week ago

Question

What was the first US state admitted to the union?

Answered: 1 week ago

Question

What was the last currency to be used in the US before the dollar?

Answered: 1 week ago

Question

In what state was George Washington born?

Answered: 1 week ago