Q1. Given the following setup code for Timer 2, write an Interrupt Service Routine (ISR)
Q1. Given the following setup code for Timer 2, write an Interrupt Service Routine (ISR) for Timer 3 that uses INV to toggle the LED light connected to Port A, RA5. The ISR should be called Timer3Interrupt. Timer 3 setup: Internal fPB clock is 40Mhz , pre-scalar 1:256
Q2. a) If TAD = 85 * 10-9 (85 ns) Seconds (Assume PBclk-Freq = 40 MHz , [2 Marks] So TPB = 1 PBclk − Freq ), Calculate the ADC’s value. Hint: TAD = 2 * (TPB * (ADCs + 1)) b) Write the following Setup code for the ADC with manual sampling and manual conversion.
Q3a.Write a program using an Interrupt Service Routine that does the following : Waits for a Single High Pulse of 250 ms on Pin OC3. When the High Pulse goes from High to low , it turns ON the LED at Port A, RA3 and the LED then stays on.
You will use the Output Compare OC1, Dual Compare mode with a Single High Pulse (OCM= 004). You will use Timer 3 for the OC with a pre-scale value of 256. You need to setup OC3RS and OC3R such that OC3RS – OC3R = 200 ms. We need to convert 200 ms into Timer Clock Cycles. We have Timer 3 with a fpb is 10 Mhz and a Precale of 1:64.
1 attachments
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
