Answered step by step
Verified Expert Solution
Link Copied!

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 (D2 & D3) if the switch S1 connected to
RB4 is ON; else, toggle the two MSB bits (D4 & D5). Use TMR0 library function
to generate the time delay.
1. Check the configuration setting is correct in System Module.
2. Generate the code.
3. Click main.c and modify the code in the main program space to interact
with the input.
4. 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 "mcc_generated_files/mcc.h"
void myISR(void);
volatile int currentIndex;
void main(void)
School of Engineering LJMU
Embedded Lab 2 Exercises
{
// initialize the device
SYSTEM_Initialize();
// Enable the Global Interrupts
INTERRUPT_GlobalInterruptEnable();
// Enable the Peripheral Interrupts
INTERRUPT_PeripheralInterruptEnable();
TMR1_SetInterruptHandler(myISR);
while (1)
{
// Add your application code
if(IN1_GetValue()==0){
.
.
.
}

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

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

Discuss the limitations of ASCII.

Answered: 1 week ago