I am using the C51 compiler and have code for the silabs C8051F120.
I have built a wind speed sensor with a rotary encoder but it seems to top out at 42mph. I know there have been gusts greater than that since I started using it.
I have considered calibrating the unit with an automobile and think i may be missing edges of the encoder signal because of processing overhead. I think the encoder counter routine should be interrupt driven.
My coworker Frisky suggested the circuitry is not able to handle fast counting signals coming from sensor and said that the 2nd problem circuitry should be analyzed.
Does anyone have an idea why that might happen?
freyed,
You said earlier:
"I think the clock is going at 50MHZ and the pulses are going at about 18 to 22MS so i cannot see how the code can miss them."
You are right with that.
A basic 8051 running at 12MHz can easily do timing on 22ms pulses. But it assumes that the code is written in an appropriate fashion.
Just re-read the posts here, analyse your problem and fix your code.