Re: RTC

Started by Art Church March 12, 2005
Thanks. Made those changes.
Based on your comments I am now looking at where I use timer and perhaps could use RTCtick instead as I basically take timer back to to a integer of milliseconds for my purposes.The same should apply there too I would think.
Art

-----Original Message-----
From: Don Kinzer [mailto:]
Sent: Sat 3/12/2005 2:45 PM
To:
Cc:
Subject: [BasicX] Re: RTC --- In , "Art Church" <achurch@m...> wrote:
> I have pulseouts of 0.001 which is within the 1.95 ms range. I
> have changed them to 0.0001 to see if this made a difference.
> It did. For the last hour it seems pretty much right on.

That's interesting. I would have thought that a 1 millisecond pulse
would have been OK. I assume that the code that implements PulseOut
() in the BX-24 disables interrupts while performing the function.
If interrupts are disabled for only 1ms, at most one RTC interrupt
could possibly occur and it should be serviced as soon as interrupts
are re-enabled (assuming that other higher priority interrupts have
not occured also).

As a side note, you might as well reduce the pulse width to something
near the minimum required by the device that you're strobing, plus a
safety margin. If it is 74xxx series logic, for example, even the
minimum 1.085uS pulse that can be generated by PulseOut() is over 20
times as long as the minimum required pulse width. Anything longer
than the minimum just wastes time - you're program can do nothing
else during the pulse generation.

Also note that the code generated by a call to PulseOut() converts
the Single value to an integral number of timer units. If you use a
constant Single value like 'Call PulseOut(12, 0.000001, 0)' the
generated code ends up identical to that generated by 'Call PulseOut
(12, 1, 0). On the other hand, if you use the invocation, 'Call
PulseOut(12, pulseTime, 0)', where pulseTime is a Single variable,
there is another 18 bytes generated to convert the value of the
Single to integral timer units. If the value of pulseTime is
constant, this wastes not only execution time but code space as well.

Don

P.S. there are other similarly useful tidbits of information about
the code generated by the compiler in Mike Perks' excellent series of
articles on the BasicX internals:
http://home.austin.rr.com/perks/basicx/Articles

Yahoo! Groups Links