Go Down

Topic: Arduino always doing things on the background? (Read 638 times) previous topic - next topic

BlindPilot

Hi,

I am new to Arduino (I have been using Bascom for a time). I understand that Arduino is always updating the clock used by millis() and may be doing a few other other thing on the background that dont seem to be very clearly documented. Is it so? If yes, is there an easy way to disable all that?
I do need to have a precise timing(without any jitter) when executing my code. Is it possible?


Thanks a lot for your help,

Manuel


AWOL

Quote
I understand that Arduino is always updating the clock used by millis() and may be doing a few other other thing on the background that dont seem to be very clearly documented. Is it so?

No, I don't think it is so.
I'd say it is very clearly documented - in fact, you've got the source, so you can find out for yourself.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

wildbill

What are you doing that you feel would be impacted by this?

BlindPilot


what do I do to disable all the background tasks like updating millis() ?


Thanks,
Manuel

Senso

Disable interrupts, thats whats going up. Milis is updated by a timer overflow, either stop the timer or disable interrupts.

PaulS

There are some activities that are performed in response to interrupts, like updating timers, including the one used by millis(). You could take careful aim at your foot, and disable interrupts.

I don't think that this is going to be a solution to your unstated problem, though. So much stuff that the Arduino does, like PWM, Servo control, receiving serial data, updating timers, etc. requires interrupts.

Quote
I do need to have a precise timing(without any jitter)

Well, now, that is going to be difficult if you've disabled the timers.

Senso

Maybe he is using cycle counted assembly.

BlindPilot

I am trying to send a given number of pulses to a 17/128th microstep controller and also send trigger pulses to a video camera each 1280 microsteps. The timing needs to be as precise(no jitter) as possible

Manuel

BlindPilot

Sorry, I wanted to say 1/120th micro step controller.
If I disable interrupts, I cannot use delayMicroseconds(), can I ?

BlindPilot


Senso,

disabling / enabling interrupts with cli()  and  sei()   seem to solve the problem and I can stil use delayMicroseconds() as I wanted.

Thanks so much!

Manuel

Go Up