Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project Name:- EX4_2_INT_RB0_Pin_DeBounce Description:- The previous exercise is prone to switch bounce, when using a mechanical switch as the input to the interrupt pin (i.e.
Project Name:- EX4_2_INT_RB0_Pin_DeBounce Description:- The previous exercise is prone to switch bounce, when using a mechanical switch as the input to the interrupt pin (i.e. RB0), when used on a real hardware implemention as a single press of PB0 can result 2 it triggering multiple interrupts. This exercise also uses a pushbutton (PB0) connected to the external INT input (i.e. on pin RB0) of the PIC16F188 to trigger an interrupt everytime the hutton is pressed. However, within the ISR after an interrupt occurs from a button press, this program will disable the interrupt so multiple interrupts cannot occur. It also sets a global software flag (i.e. variable) to alert the main while loop that the button is pressed. Inside, the main while loop you can detect the button has been pressed by checking the global flag bit, and then use the get_PBO previously used in Exercise 2 to check that the switch has a stable low (i.e. switch is released) to ensure that it has been released. Once the button has been released with no further glitches occuring, then the Interrupt can be turned back on again
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started