BasicMicro - Forums

www.basicmicro.com
It is currently Sun May 20, 2012 11:32 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Re: RCTimeout default is longer than I need, seems a waste of time
PostPosted: Tue Apr 24, 2007 8:28 am 
I have a similar problem in a project, I have four insulated pads if you don’t touch the pad it will time out but it takes a little more than ¼ second just to scan the pads so you can scan less than 4 times per second. In my case if you touch the pad RCTIME will return a 2 so the rest of the time is wasted and keeps me from scanning the the pads as often as I need.
Craig


Top
  
 
 Post subject: RCTimeout default is longer than I need, seems a waste of time
PostPosted: Tue Apr 24, 2007 9:42 am 
the manual says the RCTimeout default is 65,535 microseconds.
it also has a Timeoutmultiple to modify this time limit.

to me 65,535 * 1 (smallest whole number) = 65,535 (yes, duh, work with me a sec =)
which is about 4 times longer than the max I'm after.
meaning: time's a wastin'
does it matter? I think it might. it all adds up, especially if I need to do this function numerous times.

I have several atom manuals which presents things slightly (and usefully) different. I haven't found an answer in them. I've searched these forums and found many interesting things, but didn't happen to find this answer.
it may be just basic computer math -which still seems odd to me which might be my problem =)
not really sure how to google something this specific in a productive way.

so my question is:
how can I let the Atom get on with it's life after about 15,000 us?
or is there a different way to accurately time a changed pin state?

thanks for reading and thinking about this

BEX

ps this is similar to timbo's question but i didnt see a reply


Top
  
 
 Post subject: Re: RCTimeout default is longer than I need, seems a waste of time
PostPosted: Tue Apr 24, 2007 10:06 am 
Is that to say that you expect it to time out instead of changing states? The timeout isn't a factor if the pin changes state.


Top
  
 
 Post subject: Re: RCTimeout default is longer than I need, seems a waste of time
PostPosted: Tue Apr 24, 2007 10:00 pm 
Offline
Citizen

Joined: Sat Mar 08, 2003 11:00 am
Posts: 40
Why don't you use "Software Interrupts".

Note the Atom only checks its enabled interrupts between MBasic keywords, so you might put your main loop into a 'tight' busy-wait, like:

Main:
Pause 1 ' Check every 1 mSec
GOTO MAIN

Now you may have to "debounce" the switches still, but this approach should give you 1 mSec response times.


Top
 Profile  
 
 Post subject: Re: RCTimeout default is longer than I need, seems a waste of time
PostPosted: Tue Apr 24, 2007 10:00 pm 
yes, dleroi, good point, duh!

if i get a timeout there's a problem and i definitely dont need the atom running until i fix it.
color me red =)

thank you very much for reminding me to look at the forest not the trees!

Im so embarrassed LOL


BEX


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO