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

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
3: Propeller Programming Tutorial
We modified the
and
methods by changing the
parameter to
,
Start
Toggle
Delay
DelayMS
meaning “delay in units of milliseconds.” Then we modified the
… statement such
waitcnt
that instead of waiting a fixed number of clock cycles, it calculates the number of clock
cycles that there are in
milliseconds of time.
is a command that returns the
DelayMS
CLKFREQ
current System Clock frequency in Hertz (cycles per second). Its value is set by the Propeller
Tool at compile time and also by the
command at run time; see
on page 183.
CLKSET
CLKSET
There are 1,000 milliseconds per second and
is the number of clock cycles per
CLKFREQ
second, so
is the number of clock cycles in
milliseconds
clkfreq / 1000 * DelayMS
DelayMS
of time.
With this modification, regardless of the application’s start-up frequency, or how often the
application changes the frequency during run time, the Output object will recalculate the
proper delay each time through its loop.
Now, of course, we need to modify our Blinker2 object to adjust the
parameters
DelayMS
appropriately. Enter the code modifications shown in the listing on page 136. Note that we
entered the
and
settings just as we had left them from the last exercise.
_CLKMODE
_XINFREQ
Propeller Manual v1.0 · Page 135

Related parts for 122-32000