Go Down

Topic: void loop speed? (Read 7 times) previous topic - next topic

PaulS

I was trying to remember who's line that was.

Jzone

Quote
The act of measuring how long it takes affects how long it takes.


Heh, yeah, fair point. I actually meant sticking a hardware frequency counter on the pin I'm changing the state of...

...which will put a load on it... but I'll stop there before I start questioning whether or not I'm *really* typing this.  ;)

PaulS

Just as a matter of curiosity, why are you doing this?

Jzone

I'm using a 4052 multiplexer to 'multiply' the outputs of a TLV5618 DAC (from 2 - to 2 x 4).

The mux is being run (or clocked or whatever) by the Arduino.

Each output of the mux feeds a sample and hold.

I need to run the mux as fast as I can - but still give the DAC and the S&H time to do their thing and settle.

This is all pretty new to me - so I was just curious what the 'fastest' real world speed out of the Arduino might be.

Hope that makes sense - I'm kind of making this up as I go right now.

Thanks.

mem

Assuming you only have the two digital writes in loop the frequency is just under 130 kHz (the period is 7.75us). Around half the time is taken by the digital writes, the remainder by the loop code. If you want to generate high frequencies you would be better served by using one of the timers, for example: http://www.arduino.cc/playground/Code/FrequencyTimer2.

This is one of those cases where measurement does not affect the readings in any meaningful way if you use something like a logic analyzer.

Go Up