Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise: Toggle the two PORTA LSB bits ( D 2 & D 3 ) if the switch S 1 connected to RB 4 is ON;
Exercise: Toggle the two PORTA LSB bits D & D if the switch S connected to
RB is ON; else, toggle the two MSB bits D & D Use TMR library function
to generate the time delay.
Check the configuration setting is correct in System Module
Generate the code.
Click main.c and modify the code in the main program space to interact
with the input.
Build and download the code to the curiosity board and test the
function.
You will interact with the input by using Getvalue Partial code below
#include mccgeneratedfilesmcch
void myISRvoid;
volatile int currentIndex;
void mainvoid
School of Engineering LJMU
Embedded Lab Exercises
initialize the device
SYSTEMInitialize;
Enable the Global Interrupts
INTERRUPTGlobalInterruptEnable;
Enable the Peripheral Interrupts
INTERRUPTPeripheralInterruptEnable;
TMRSetInterruptHandlermyISR;
while
Add your application code
ifINGetValue
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