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 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