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  [ 3 posts ] 
Author Message
 Post subject: Reading, calculating Time
PostPosted: Wed Mar 14, 2007 10:00 pm 
Hello,

I've been working on a program. But in the program i'd like to measure the time the processor takes to do calculations. I know i need to use a crystal that is stored on my microprocessor. I tried the RCtime but i didn't really get it right.
I'm using 'ATOM-pro IDE'
I'm using a 'basic script' (no c/c++ or asm project)

My question:

How can i calculate, or measure time in a script like below?
Is RCtime the right function, or do i need other functions?
How do i store time in a variable?

(variables)

Loop1:
start time
(Calculations)
end time-->(store time in a variable)
Goto loop1:

I hope you have some time to post.
Greetings,
Roland


Top
  
 
 Post subject: Re: Reading, calculating Time
PostPosted: Wed Mar 14, 2007 10:00 pm 
You posted under the standard Atom forum, but claim to be using the Atom PRO IDE. These are not the same device, and there are differences in the BASIC as to usage and functionality. If there IS a way to do this using features of Atom BASIC we need to know which you are using, standard Atom or Atom Pro.

However, if you have access to an oscilloscope, the point is moot. Simply make a pin high (i.e., HIGH P0) at the start of your math calculations, then pull it low at the end (LOW P0). The time span in between the high/low will answer your question. If an O-Scope is not available, but a frequency counter is available with the period feature, then use that. In both cases you will want to do a loop so you have a steady signal to study. Just be sure to trigger on the leading edge. This is where the pin goes high at the start of your calculations.

Perhaps someone else can tell us how to do this in software.
OK?
kenjj


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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