Thats just sweet, someone asks a question and gets a non answer, what gives???
I am a user attempting to learn to use a product that is delivered with no standardized instructions. I have spent over 20 hours of time reading tutorials that do not explain how to use this product, Best I can find states there are many ways to code a function and that some are better than others.
Settle down. Their are no standardized instructions because I suck at writing them.
Debugging embedded code is not an easy task. Especially time-critical code.
Ensure you are using a sufficient clock speed.
When working with uS, you want as much speed as you can get.
9600000 will give you 27uS granularity while 1200000 will only provide a lousy 213uS granularity.
There is also a high likely-hood of a core bug.
Having no serial support on the '13 makes this problem even harder.
Also, try this version of pulseIn
unsigned long pulseIn_new(unsigned char pin, unsigned char stat, unsigned long timeout){
while(digitalRead(pin) != stat){if(micros() - st > timeout){return 0;}}
unsigned long st = micros();
while(digitalRead(pin) == stat){if(micros() - st > timeout){return micros()-st;}}
return micros()-st;
}
Which may correct a possible bug.
The MCU does not generate a change in the state of the output pin based on input from the radio control receiver signal pin.
I have verified that the RX is outputting a pulse width of 1500us at center with a span from 1048us low to 1952us high.
Ok this is doable but should be easier at a higher clock rate.
I have powered the MCU using RX power and separate power for the MCU and RX with no change.
The power source should have little effect since this is most likely a software bug.
I have no clue at this point if the problem is hardware, software, or operator related.
Probably software with the possibility of a mixed issue.