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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago