Progress of a Pause command

John O

Senior Member
Is there a method (register that can be PEEKed, perhaps) to see the current 'progress' of a Pause command?

The situation I'm interested in, is as follows:

If an interrupt occurs during a Pause command, the Pause is terminated and the rest of the pause is lost. If it were possible to read in the interrupt subroutine how far the Pause had progressed, it would be possible to complete the pause before returning from the subroutine.

John.
 

John O

Senior Member
That's how I'm doing it at the moment to make up an hour delay:
Code:
for w0 = 1 to 60000
  pause 60
next
I suppose 60ms (maximum, for every interrupt) isn't too significant and time lost in the truncated pause will be made up in the execution time of the interrupt routine itself anyway, but I was just wondering if there was a way to "reclaim" the lost time with certainty.

John.
 

magicjohn

New Member
I'm by no means an expert in these things, but it seems to me that perhaps you should be using the internal timer - which presumably(?) keeps ticking during an interupt - see "Settimer" etc. in the manual.
 

John O

Senior Member
I'm by no means an expert in these things, but it seems to me that perhaps you should be using the internal timer - which presumably(?) keeps ticking during an interupt - see "Settimer" etc. in the manual.
Forgot to mention, I'm using an 08M which I don't think has the SetTimer command :(

John.
 

inglewoodpete

Senior Member
That's how I'm doing it at the moment to make up an hour delay:
Code:
for w0 = 1 to 60000
  pause 60
next
I suppose 60ms (maximum, for every interrupt) isn't too significant and time lost in the truncated pause will be made up in the execution time of the interrupt routine itself anyway, but I was just wondering if there was a way to "reclaim" the lost time with certainty.

John.
Having chosen the 08M to do my task, I would use something very similar to the code you have shown. If something more accurate is required, you'd have to look at a bigger chip (18M2 or 20X2), although you could consider an SMD version if size is a problem.
 

John O

Senior Member
I only became aware of the usefulness of the SetTimer command after I'd committed myslef to the 08M - it was such a trivial application otherwise that it was hard to justify anything bigger. (Scroll down: http://vwlowen.co.uk/picaxe/weather-station/page-5.htm)

I suppose this was more of a "generic" enquiry for future use to see if the current value of the Pause command is accessible - assuming it must be strored somewhere :)

John.
 

Technical

Technical Support
Staff member
No you can't peek it. But you could reduce your error from 60ms to 1ms.

Code:
for w0 = 1 to 60000
for w1 = 1 to 60
  pause 1
next
next
 
Top