This example demonstrates how to configure an input to measure frequency from a speed sensor.
Configuration is very simple, select Frequency/Pulse input mode. The options will be Threshold #1 or #2, these will determine what voltage levels trigger the input. See reference manual for a complete description.
The measured Frequency value will be found in the variable frequencyAxx with a WORD data type and units of Hz.
- You may need to override the default resistor setting if you need to pull the signal up or down depending on what type of sensor you are using. For example an open collector proximity sensor may need to have a pullup resistor added to the circuit.
- Use an oscilloscope to verify the signal levels match the input requirement over the entire expected frequency range.