I have to catch 14 bits as opposed to 32 right ?
would this mean something likeIf that's the case then what about the pulse sizing ?Code:Until (i>13)
I am specifically referring to these lines
andCode:If (stx<760) Then init
I am correct so far then the above part is where the confusion starts and it has to do with the PULSIN command.Code:pulse>100
As i understand it the PULSIN command...
As per the manual
Fantastic , that explains the following (I think!)Measures pulse width on Pin.
If State is zero, the width of a low pulse is measured.
If State is one, the width of a high pulse is measured.
The measured width is placed in Var.
If the pulse edge never happens or the width of the pulse is too great to measure, Var is set to zero
Now here's the cruncher for meCode:While GPIO.1=1 Wend
This is a tad confusing, what about other values of oscillator ?The resolution of PULSIN is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the pulse width is returned in 10us increments.
If a 20MHz oscillator is used, the pulse width will have a 2us resolution.
I am using a 4MHZ internal clock so therefore I would be looking at 10uS increments, but what does this mean exactly ? Does it mean the pulse is returned rounded off to the nearest 10uS ?
Another thing ...
So PULSIN reads ONLY the ACTUAL oscillator (crystal, R/C) so what happens if we were using this on an 18F4520 for example where you could use PLL , something like 8MHz x 4 to total up to 32MHz ..?Defining an OSC value has no effect on PULSIN.
The resolution always changes with the actual oscillator speed.
Is there some trick involved in that instance or do we then need to start looking at HPWM ?
Apologies for the what may appear as "dumb questions" but I am trying to keep them simple in order to explain my confusion.
And looking at the forums and various posts it seems you have so many asking similar thnigs about your code.
Kind regards
Dennis




Bookmarks