2。 Which pin does the signal enter? If Timer0 is used as a counter, the input pin is P3.4
If the timer 1 is used as the counter, the input pin is P3.5. If measuring a single pulse width (or period), you can input any pin, but it is best to use the interrupt pin P3.2 or p3.3..
3。 How to calculate the program after the signal enters the pin
Time 50ms with another timer, measure how many pulses are input within 50ms, and then multiply by 20 (i.e. 1) to get the frequency.