Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please pay attention to the type of microchip used as that will impact the answer Problem 1. Input Capture modul 2 (IC2) is to be

image text in transcribedPlease pay attention to the type of microchip used as that will impact the answer
Problem 1. Input Capture modul 2 (IC2) is to be used with Timer2 to determine the duration a pulse is high. Assume a 16 MHz instruction frequency. The pulse length should be written to a (a) We want to use pin 23 on the PIC24FJ64GA002 package as the input. Show the code needed (b) The maximum length pulse we expect to measure is 1 ms and we will set the Timer2 to rollover global variable declared as unsigned int PulseLength. to ensure this pin is a digital input to IC2 every 1 ms. To be as accurate at possible we will use a 1:1 prescale with Timer2. Show the code needed to initialize and enable Timer2 (c) Show the code needed to initialize and enable IC2. We would like to determine the pulse length in an IC2 ISR. Show the code needed to intialize and enable IC2 interrupts, assume natural priority (d) Code the ISR for the IC2 interrupt. It should compute the pulse length and place the result in the global variable PulseLength Problem 1. Input Capture modul 2 (IC2) is to be used with Timer2 to determine the duration a pulse is high. Assume a 16 MHz instruction frequency. The pulse length should be written to a (a) We want to use pin 23 on the PIC24FJ64GA002 package as the input. Show the code needed (b) The maximum length pulse we expect to measure is 1 ms and we will set the Timer2 to rollover global variable declared as unsigned int PulseLength. to ensure this pin is a digital input to IC2 every 1 ms. To be as accurate at possible we will use a 1:1 prescale with Timer2. Show the code needed to initialize and enable Timer2 (c) Show the code needed to initialize and enable IC2. We would like to determine the pulse length in an IC2 ISR. Show the code needed to intialize and enable IC2 interrupts, assume natural priority (d) Code the ISR for the IC2 interrupt. It should compute the pulse length and place the result in the global variable PulseLength

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

Application: ToCallorNotToCall...

Answered: 1 week ago

Question

Strong analytical, communication, and problem-solving skills

Answered: 1 week ago