How many cogs ?
Ole Man Earl
Posts: 262
This may seem silly, but how do you know how many cogs are being used by your program? Is there some spin code to tell you ?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
http://obex.parallax.com/objects/154/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········
cog starts up do something, checks p0 if low start same code in new cog and do some something else.
any number of cogs could be running in this example
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
SPIN code:
byte[noparse][[/noparse]$7ff-cogid]:=cogid
....
byte[noparse][[/noparse]$7ff-cogid]:=0
PASM code:
cog_id cogid cog_id
sub cog_run, cog_id
wrbyte cog_id, cog_run
...
wrbyte zero, cog_run
cogstop cog_id
zero long 0
cog_run long $7ff
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
Most of the time cog usage can be predicted.· It's easy to build-in some dynamic bookkeeping for those few situations where it can't be predicted.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.