Rctime Behaviour
Archiver
Posts: 46,084
In a message dated 5/20/2004 4:31:48 PM Eastern Daylight Time,
simonrparker@y... writes:
> Can anyone explain what is happening here, is there anything I can do
> to the code to prevent it or is there a way that the Stamp can detect
> if something is connected to a pin or not?
>
>
You can not tell if a passive device is connected to the Stamp - all you can
determine is whether a pin is high or low.
[noparse][[/noparse]Non-text portions of this message have been removed]
simonrparker@y... writes:
> Can anyone explain what is happening here, is there anything I can do
> to the code to prevent it or is there a way that the Stamp can detect
> if something is connected to a pin or not?
>
>
You can not tell if a passive device is connected to the Stamp - all you can
determine is whether a pin is high or low.
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
Im using a BS2SX.
Lets say I have 5 knobs wired up to the Stamp using rctime and
displaying their value on the debug screen, if I unplug all the knobs
except for one it seems like the basic stamp slows down and takes a
reading from the knob at more infrequent intervals or that the latency
has increased.
Can anyone explain what is happening here, is there anything I can do
to the code to prevent it or is there a way that the Stamp can detect
if something is connected to a pin or not?
Cheers,
Simon
time allowed.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: simonrparker [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qW5LSmbuRAM5bZJ41aO43CkIL-tmxZqJeYkbEEi8vAFj-lCCFTJWPl-Rf4l4zUdJS9gdmxZT9TgppOH-mrE7]simonrparker@y...[/url
Sent: Thursday, May 20, 2004 3:29 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
Hi,
Im using a BS2SX.
Lets say I have 5 knobs wired up to the Stamp using rctime and
displaying their value on the debug screen, if I unplug all the knobs
except for one it seems like the basic stamp slows down and takes a
reading from the knob at more infrequent intervals or that the latency
has increased. Can anyone explain what is happening here, is there
anything I can do to the code to prevent it or is there a way that the
Stamp can detect if something is connected to a pin or not?
Cheers,
Simon
take more time if nothing is connected to the pin?
Cheers,
Simon
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...> wrote:
> RCTIME is still doing its thing ... and is taking the maximum amount of
> time allowed.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> Sent: Thursday, May 20, 2004 3:29 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
>
>
> Hi,
>
> Im using a BS2SX.
> Lets say I have 5 knobs wired up to the Stamp using rctime and
> displaying their value on the debug screen, if I unplug all the knobs
> except for one it seems like the basic stamp slows down and takes a
> reading from the knob at more infrequent intervals or that the latency
> has increased. Can anyone explain what is happening here, is there
> anything I can do to the code to prevent it or is there a way that the
> Stamp can detect if something is connected to a pin or not?
>
> Cheers,
> Simon
> Sorry for being dim but I cant get my head around this. Why would it
>take more time if nothing is connected to the pin?
>
>Cheers,
>Simon
The RCTIME instruction is sitting there waiting to obtain a reading, and nothing is happening with nothing attached to the pin. Therefore, it waits the maximum time permissible to obtain a reading, and then goes on its merry way when nothing occurs. I'm not sure how else it might be explained.
>--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...> wrote:
>> RCTIME is still doing its thing ... and is taking the maximum amount of
>> time allowed.
>>
>> -- Jon Williams
>> -- Applications Engineer, Parallax
>> -- Dallas Office
>>
>>
>>
Original Message
>> From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
>> Sent: Thursday, May 20, 2004 3:29 PM
>> To: basicstamps@yahoogroups.com
>> Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
>>
>>
>> Hi,
>>
>> Im using a BS2SX.
>> Lets say I have 5 knobs wired up to the Stamp using rctime and
>> displaying their value on the debug screen, if I unplug all the knobs
>> except for one it seems like the basic stamp slows down and takes a
>> reading from the knob at more infrequent intervals or that the latency
>> has increased. Can anyone explain what is happening here, is there
>> anything I can do to the code to prevent it or is there a way that the
>> Stamp can detect if something is connected to a pin or not?
>>
>> Cheers,
>> Simon
>
>
>
>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.
>
>Yahoo! Groups Links
>
>
>
>
pin is NOT at the target state for the RCTIME function, then the fuction
will take the maximum possible time to complete. Remember, RCTIME is
looking for a change of state on the pin -- in your case that change
never comes.
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: simonrparker [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=XbItNt7tkEWCBKep1tPQ6HZuuCwbk--bnVHWVgK-A6-T5GPvcrx364bPOSy78EAx8W76AsrmnqfH4YSQ]simonrparker@y...[/url
Sent: Thursday, May 20, 2004 5:08 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: Rctime Behaviour
Sorry for being dim but I cant get my head around this. Why would it
take more time if nothing is connected to the pin?
Cheers,
Simon
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> RCTIME is still doing its thing ... and is taking the maximum amount
> of time allowed.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> Sent: Thursday, May 20, 2004 3:29 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
>
>
> Hi,
>
> Im using a BS2SX.
> Lets say I have 5 knobs wired up to the Stamp using rctime and
> displaying their value on the debug screen, if I unplug all the knobs
> except for one it seems like the basic stamp slows down and takes a
> reading from the knob at more infrequent intervals or that the latency
> has increased. Can anyone explain what is happening here, is there
> anything I can do to the code to prevent it or is there a way that the
> Stamp can detect if something is connected to a pin or not?
>
> Cheers,
> Simon
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.
Yahoo! Groups Links
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
Ive solved the problem by bridging the ports of unused inputs with a
fixed value resistor.
Incidentally, what is the maximum time RCTIME will stay on a pin
waiting for change? I thought it depended on the PAUSE value.
Cheers,
Simon
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...> wrote:
> RCTIME is going to run unless you remove it. If the input state of the
> pin is NOT at the target state for the RCTIME function, then the fuction
> will take the maximum possible time to complete. Remember, RCTIME is
> looking for a change of state on the pin -- in your case that change
> never comes.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> Sent: Thursday, May 20, 2004 5:08 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Re: Rctime Behaviour
>
>
> Sorry for being dim but I cant get my head around this. Why would it
> take more time if nothing is connected to the pin?
>
> Cheers,
> Simon
>
>
> --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
> wrote:
> > RCTIME is still doing its thing ... and is taking the maximum amount
> > of time allowed.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> > Sent: Thursday, May 20, 2004 3:29 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
> >
> >
> > Hi,
> >
> > Im using a BS2SX.
> > Lets say I have 5 knobs wired up to the Stamp using rctime and
> > displaying their value on the debug screen, if I unplug all the knobs
> > except for one it seems like the basic stamp slows down and takes a
> > reading from the knob at more infrequent intervals or that the latency
>
> > has increased. Can anyone explain what is happening here, is there
> > anything I can do to the code to prevent it or is there a way that the
>
> > Stamp can detect if something is connected to a pin or not?
> >
> > Cheers,
> > Simon
>
>
>
> 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.
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: simonrparker [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=8-CWW8UlTDdeRkt47VT1W8XYEFLDi2TT2GJDvq_aZWQQwz5kpvYQ29rd16TQunebjSmEdwdVglqBwSwJUWFh]simonrparker@y...[/url
Sent: Thursday, May 20, 2004 6:56 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: Rctime Behaviour
OK, I get it now [noparse]:)[/noparse] thanks for your patience and to everyone who
replied. Ive solved the problem by bridging the ports of unused inputs
with a fixed value resistor. Incidentally, what is the maximum time
RCTIME will stay on a pin waiting for change? I thought it depended on
the PAUSE value.
Cheers,
Simon
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> RCTIME is going to run unless you remove it. If the input state of
> the pin is NOT at the target state for the RCTIME function, then the
> fuction will take the maximum possible time to complete. Remember,
> RCTIME is looking for a change of state on the pin -- in your case
> that change never comes.
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
Original Message
> From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> Sent: Thursday, May 20, 2004 5:08 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Re: Rctime Behaviour
>
>
> Sorry for being dim but I cant get my head around this. Why would it
> take more time if nothing is connected to the pin?
>
> Cheers,
> Simon
>
>
> --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
> wrote:
> > RCTIME is still doing its thing ... and is taking the maximum amount
> > of time allowed.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
Original Message
> > From: simonrparker [noparse][[/noparse]mailto:simonrparker@y...]
> > Sent: Thursday, May 20, 2004 3:29 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Rctime Behaviour
> >
> >
> > Hi,
> >
> > Im using a BS2SX.
> > Lets say I have 5 knobs wired up to the Stamp using rctime and
> > displaying their value on the debug screen, if I unplug all the
knobs
> > except for one it seems like the basic stamp slows down and takes a
> > reading from the knob at more infrequent intervals or that the
latency
>
> > has increased. Can anyone explain what is happening here, is there
> > anything I can do to the code to prevent it or is there a way that
the
>
> > Stamp can detect if something is connected to a pin or not?
> >
> > Cheers,
> > Simon
previously charged the capacitor to some value.
The RCTIME then times how long it takes to discharge
the capacitor (or vice-versa).
What is happening to you now is when a knob is
disconnected, then RCTIME is 'timing-out', which
can take a while -- much longer than actually
measuring the discharge time.
So, what you need to do is check to see if the
pin is actually at the start-state BEFORE you
issue the RCTIME. You can do this by reading
the state of the pin before the RCTIME. If
it is not at the 'start-state' you want to
measure, don't issue the RCTIME.
--- In basicstamps@yahoogroups.com, "simonrparker"
<simonrparker@y...> wrote:
> Hi,
>
> Im using a BS2SX.
> Lets say I have 5 knobs wired up to the Stamp using rctime and
> displaying their value on the debug screen, if I unplug all the
knobs
> except for one it seems like the basic stamp slows down and takes a
> reading from the knob at more infrequent intervals or that the
latency
> has increased.
> Can anyone explain what is happening here, is there anything I
can do
> to the code to prevent it or is there a way that the Stamp can
detect
> if something is connected to a pin or not?
>
> Cheers,
> Simon