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?
But he thinks that it go down for a short time and he says that an 8 bit processor cannot be fast enough to see it!
Eh ... that's nonsense. The "bit-ness" of a processor has absolutely nothing to do with the width of pulses it can detect.
How "short" is the "short time" ?
So we want to know if we go to the arm am I going to use the code I've done already?
You can use the code, but it will have exactly the same problems - because your code has some fundamental problems.
1. It uses heavyweight library functions (like printf) that gobble up CPU time like there's no tomorrow regardless of the processor architecture used.
2. It tries to poll a signal that should be acquired by some hardware mechanism (timer/counter, interrupt, whatever).
Fix these, and your program will run even on the cheapest '51.