ARMweb timing

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

ARMweb timing

Post by YahooArchive »

I have a timing problem with my ARMWeb application.

I need to drive a motor for a specific period of time, like:

io( motor_en_pin ) = 1
wait(400)
io( motor_en_pin ) = 0

What I am finding is that the 400ms delay varies, which is not good for
my application.
I have a web page which is being refreshed once every 2sec, I suspect
this may be
interrupting the 400ms wait command, but I'm not sure.

Is there some command other than WAIT that would be better for setting
the motor on time?,
how about the TIMER command?

Are there any other ARMweb processes that are running, that could also
be causing this problem?

Could I use an interrupt timer to sync up my code to avoid clashing with
any web refreshes?

Is there something I can do in my code to detect when the ARMWeb is busy
doing a
web process?



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: ARMweb timing

Post by YahooArchive »

> I need to drive a motor for a specific period of time, like:
>
> io( motor_en_pin ) = 1
> wait(400)
> io( motor_en_pin ) = 0
>
> What I am finding is that the 400ms delay varies, which is not good for
> my application.

To ensure just 400 ms, you will have to turn interrupts off around that code.
There is a BASIC statement for that. Turning interrupts off will affect web
page performance.

> I have a web page which is being refreshed once every 2sec, I suspect
> this may be
> interrupting the 400ms wait command, but I'm not sure.

TCPIP and web services run on a 20 ms timer interrupt, and when there is
something to do, it will get done. That can be longer than 400ms, if it
involves compiling <?BASIC code, or if that request occurs just before the 400
ms is up.

> Are there any other ARMweb processes that are running, that could also
> be causing this problem?

Other interrupts include, serial IO for the UARTs, but those are normally not
doing anything, especially if there is no serial activity.

> Is there something I can do in my code to detect when the ARMWeb is busy
> doing a
> web process?

Not really, there's only 1 CPU, so its either doing your code or an interrupt.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: ARMweb timing

Post by YahooArchive »

Thanks. I assume you are talking about using the INTERRUPT 0|1
command.to disable
and enable the web access. I did not notice this command until now.
It looks like it should do what I need. I'll give it a go.

-mike

Post Reply