shiftOut function question

Hi guys... just out of curiosity. What is the frequency of the the clock pulse used in the shiftOut function?

I don't have a scope to measure it but I would guess between 1 and 2 MHz.

You could estimate it by writing a sketch which loops, say, 10,000 times and performs a shiftOut() in each loop. Then measure the total time taken to complete the loop using millis(). If that was, for example, 50ms, the frequency would be around 10,000 * 8 (bits per byte) / 0.05 = 1.6MHz. It will be rough, and an underestimate, but it would give you a ball-park figure.


What speed do you want it? I use SPI.transfer to send data to shift registers.
Default clock speed is 4 MHz, and I've cranked it up to 8 MHz when I want it really fast by changing the SPI clock divisor from 4 to 2.
Example transfer:
digitalWrite (ssPin, LOW);
digitalWrite (ssPin, HIGH); // output of 74HC595 for example updates on this rising edge.

Some ADCs and DACs will only work at slower speeds, like 1 or 2 MHz.