Answered step by step
Verified Expert Solution
Question
1 Approved Answer
EE 2 4 2 Laboratory Manual Session 8 : General Purpose Input - Output ( GPIO ) and Interrupt Yeditepe University Spring 2 0 2
EE Laboratory Manual
Session : General Purpose InputOutput
GPIO and Interrupt
Yeditepe University
Spring
Assignment
Assume that the green LED is initially off. Design such a system that by using an interrupt and calling
ISRcallback function you can define any function toggle the green LED on the Nucleo LRZ
board contimuously. The interrupt code in Listing should simply define that the CPU waits in an
infinite loop. When the user presses the button, this loop is interrupted. The CPU executes the function
that you define. Afterward, it turns back and waits in the infinite loop for another interrupt.
a Fill in the empty blocks in the below C code in Listing to perform the required
operations.
b Write also another program using the GPIO method that performs the same tasks as the
Interrupt code snippet given in Listing You should use Mbed Studio.
#undefARMFP
#include "mbed.
Port and interrupt settings
execute the function ISRcallback, as the button is pressed, turn on or offtoggle the LED
int main
LED will be off initially
generate the interrupt and call the ISRcallback function which is defined by the user
let the CPU waits in an infinite loop
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