Question on the Counter Module
Edgar
Posts: 8
Hi, I was reading the Counter Modules and Circuit Applications PE Lab,
on page 6, it says that between phsa~ and dira[noparse][[/noparse]17]~, there are 624 cycles.
Shouldn't that number depend on clkfreq?
on page 6, it says that between phsa~ and dira[noparse][[/noparse]17]~, there are 624 cycles.
Shouldn't that number depend on clkfreq?
Comments
is the easiest one to understand. The number 624 was
strange to me because phsa~ and dira[noparse][[/noparse]17]~ seemed
like simple bit operations. I would think that it would take
less than 10 cycles to execute if done in assembly. It is
that much slower using the interpreter?
It also seemed that the manual was using 624 as a time
value instead of a cycle value:
Counter Module PE Lab Manual wrote on page 6:
Where did 624 come from?
The number of clock ticks between phsa~ and dira[noparse][[/noparse]17]~ was determined by replacing the 0.01 μF
capacitor with a 100 pF capacitor and finding the lowest value before zero was returned. In the test program,
time := phsa replaces time := (phsa – 624) #> 0, and the lowest measurable value was 625.
The code:
My confusion is that if 624 was just the number of cycles
of the interpreter, then the test with capacitance was
probably irrelevant. If the capacitance test was relevant,
then 624 corresponded to a duration, but the unit of
624 was in clock ticks.
Post Edited (Edgar) : 3/24/2008 5:51:16 AM GMT
This particular lab illustrates how you can measure the time using an RC circuit. The time is measured in clock ticks because there's a built-in timer that's incremented every clock tick. I'm sure this lab is written this way because it's designed to work with different Propeller boards and some of them come with clock crystals that produce a different system clock frequency.