122-32000 Parallax Inc, 122-32000 Datasheet - Page 325

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
WAITCNT
4: Spin Language Reference –
the overhead time consumed by the loop statements:
, !outa[0] and
. The
repeat
waitcnt
resulting output looks like Figure 4-2.
Figure 4-2: Synchronized Delay Timing
Using the synchronized delay method, our output signal is always perfectly aligned to the
time base plus a multiple of our interval. This will work as long as the time base (an external
crystal) is accurate and the overhead in the loop does not exceed the time interval itself. Note
that we waited, with
, before the first toggle so that the time between the very first
WAITCNT
toggle and the second matches that of all the rest.
Calculating Time
An object can delay a specific amount of time even if the application changes the System
Clock frequency occasionally. To do this, use
combined with an expression that
WAITCNT
includes the current System Clock frequency (
). For example, without you knowing
CLKFREQ
what the actual clock frequency will be for applications using your object, the following line
can be used to delay the cog for 1 millisecond; as long as the clock frequency is fast enough.
waitcnt(clkfreq / 1000 + cnt)
'delay cog 1 millisecond
For more information, see
on page 175.
CLKFREQ
Propeller Manual v1.0 · Page 325

Related parts for 122-32000