I want to use 3 khz frequency signal has input to the micro controller.
i am unable to read 0-3 khz frequency input signal to the microcontroller
- You can always read input signals by configuring GPIO pins as inputs and setting the speed(max frequency limit) which is greater than the input signal
please give me any suggesion or code related to that
- What did you try so far?
i have tried through ADC pin(ANI) but could not read.
"please give me any suggesion"
post your code.
"or code related to that "
i have used pin number 2(PD5/ AIN5),from that pin i tried to capture the frequency signal coming from sensor (3KHZ ).
we have to measure that signal and to indicate how much frequency is coming.
You'd likely want to use a TIM in Input Capture, PWM Input, or External Count mode. At that point you're looking to measure the period, or get a count over an integration period.
You cannot measure frequency using ADC peripheral. You have to configure the PD5 as an alternate function timer in INPUT CAPTURE mode either to count rising or falling edges of input signal. After this, get the value from corresponding CCR register, divide this value from system clock frequency to get the frequency of input signal.
"You cannot measure frequency using ADC peripheral."
you certainly can. but it is generally unwise to do so.
Retrieving data ...