122-32000 Parallax Inc, 122-32000 Datasheet - Page 184
122-32000
Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
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
- Current page: 184 of 438
- Download datasheet (5Mb)
CNT
System Counter register.
((PUB ┆ PRI))
Returns: Current 32-bit System Counter value.
Explanation
The
Counter serves as the central time reference for all cogs; it increments its 32-bit value once
every System Clock cycle.
Upon power-up/reset, the System Counter starts with an arbitrary value and counts upwards
from there, incrementing with every System Clock cycle. Since the System Counter is a
read-only resource, every cog can read it simultaneously and can use the returned value to
synchronize events, count cycles and measure time.
Using CNT
Read
any particular purpose, but the difference in successive reads is very important. Most often,
the
the start of a window of time. The next examples use the
The above code is an example of a “fixed delay.” It delays the cog’s execution for 3 million
system clock cycles (about ¼ second when running with the internal fast oscillator).
The next is an example of a “synchronized delay.” It notes the current count at one place and
performs an action (toggles a pin) every millisecond thereafter with accuracy as good as that
of the oscillator driving the Propeller chip.
PUB Toggle | TimeBase, OneMS
Page 184 · Propeller Manual v1.0
CNT
waitcnt(3_000_000 + cnt)
dira[0]~~
OneMS := clkfreq / 1000
TimeBase := cnt
repeat
CNT
CNT
waitcnt(TimeBase += OneMS)
!outa[0]
CNT
– Spin Language Reference
register is used to delay execution for a specific period or to synchronize an event to
register contains the current value in the global 32-bit System Counter. The System
to get the current System Counter value. The actual value itself does not matter for
'Wait for 3 million clock cycles
'Set P0 to output
'Calculate cycles per 1 millisecond
'Get current count
'Loop endlessly
' Wait to start of next millisecond
' Toggle P0
WAITCNT
instruction to achieve this.
Related parts for 122-32000
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: