Hi, Bruce
You'll laugh ... that's exactly what I'd like the program to do !!!
let's see closer :
if value is between A and B ... test fails and program computes the mean value. That runs well.
if value is out from A to B , it means signal is out of limits ( Wrong signal ) or no signal at all ( pulsin returns 0 - note pulsin_max defined 12500 @ 20 Mhz).
Then, loop is supposed to be endless and generating spare signals to outputs until a correct input signal is found.
I had a closer look lighting a led as a "pass flag": Even with no incoming signal at all, test for value never comes true ... led do not light up when High led is placed
right after "value2 = ..."
But the Pulsin statement is run well.
Note between the end of this bit of program and the sub, there's a goto to the "good incoming pulse section" ...
If you want the full prog. ( source is ~ 500 lines ...) to have a better view, it will be without any other than the copyright limitations.
The most confusing thing is those lines ( they are Copied and pasted from other program ... with same variables !!! ) work perfectly on shorter programs aboard 16F628s.
As I told Dwayne, an IF THEN statement placed after those lines also always returns YES. ...
EVEN values must return NO ...
I seriously think the problem is located in the IF THEN tests ( all the tests... )as Pulsin returns the correct value for the incoming pulse !!!
Alain




Bookmarks