Shop OBEX P1 Docs P2 Docs Learn Events
SV: [basicstamps] timer or clock function on BS2? — Parallax Forums

SV: [basicstamps] timer or clock function on BS2?

ArchiverArchiver Posts: 46,084
edited 2002-11-25 14:06 in General Discussion
Greetings!

Yes, there IS a timer in the BS2, but it's not available for user programs.
(It would really screw up the BS2)

If you need a 'reasonably' accurate method, and the 'count instructions
approach' doesn't work, I suggest that you look up a 'Watchdog Timer' chip.

These are chips that must be given an 'I'm OK' signal from the processor, or
they trip the Reset pin.


Add one of these, then make certain that your program pulses the 'OK' pin
after sending the data to the PC.
Then leave the BS2 to do whatever it wants...
When the WT chip trips it's time to send a new package.

There are other timers out there that can also be used, though, so look
around.

:-)
Trygve


Opprinnelig melding
Fra: m [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=unwOlb_YpdFgqmvcbbew1s7vfa6xVxXHWgUsmzCWLzpRfiJiCo-Jmvh68hgrByhGQsQPffermuUuB6OJrwr2-Xzpgw]murat_stamp@e...[/url
Sendt: 25. november 2002 13:04
Til: basicstamps@yahoogroups.com
Emne: [noparse][[/noparse]basicstamps] timer or clock function on BS2?


I'd like to be able to periodically send data to my computer from a
BS2. In Pseudo-code, here's what I mean

kInterval con 1000 'interval between data transmission

top:

do some processing

if (interval > kInterval) then transmit data

goto top:


How do I do this? I can't seem to find a non-blocking way to make
something happen on an interval basis. SLEEP, NAP, PAUSE all cause
processing to stop. The fact that SLEEP et. al. exist implies that the
BS2 has an onboard timer, so it seems that a solution that doesn't
require external bits should be possible.

What am I overlooking?

cheers,

_murat


To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.