Question

1. Clock signal for timer Tim3 is 80 MHz. Channel 1 of the timer is configured in input capture counter reset mode (rising edge polarity). The value of TIM3_PSC is 79. The value of Tim3_CCR1 register determined in input capture interrupt handling function is 2000. Determine the period of the incoming signal. Show your work.

Answers

Answer
Are these answers correct?
Answered by GPT 3.5
First, calculate the timer clock frequency:

Timer clock frequency = Clock signal / (TIM3_PSC + 1)
Timer clock frequency = 80 MHz / (79 + 1)
Timer clock frequency = 80 MHz / 80
Timer clock frequency = 1 MHz

Next, calculate the period of the incoming signal using the value in the Tim3_CCR1 register:

Period = (Tim3_CCR1 + 1) / Timer clock frequency
Period = (2000 + 1) / 1 MHz
Period = 2001 / 1,000,000
Period = 0.002001 seconds

Therefore, the period of the incoming signal is 0.002001 seconds or 2.001 ms.
Answered by GPT 3.5
I apologize for the error in my previous response. Let's recalculate the period of the incoming signal using the correct values provided:

Given:
Clock signal for timer Tim3 is 80 MHz
TIM3_PSC = 79
Tim3_CCR1 = 2000

Calculate the timer clock frequency first:
Timer clock frequency = Clock signal / (TIM3_PSC + 1)
Timer clock frequency = 80 MHz / (79 + 1)
Timer clock frequency = 80 MHz / 80
Timer clock frequency = 1 MHz

Next, calculate the period of the incoming signal using the value in the Tim3_CCR1 register:
Period = (Tim3_CCR1 + 1) / Timer clock frequency
Period = (2000 + 1) / 1,000,000
Period = 2001 / 1,000,000
Period ≈ 0.002001 seconds

Therefore, the correct period of the incoming signal is approximately 0.002001 seconds or 2.001 ms. Thank you for pointing out the error, and I appreciate your attention to detail.

Related Questions