continuous clock output

how to get clock output from arduino uno, which has a 16MHz crystal, without using a loop?

Do you mean you want a 16Mhz clock signal from the Arduino to drive another circuit?

Can you be more vague?

LarryD:
Do you mean you want a 16Mhz clock signal from the Arduino to drive another circuit?

16MHz is preferred, but any frequency will do.

You can set a fuse with an AVR programmer, and output the system clock on a certain pin.
You can use PWM and output a fixed frequency - analogWrite(128); is an example of that, output is 488-490 Hz. Google "arduino PWM secrets" to learn how to change it.

pwm will not work. need something above 1 MHZ, so i should not have said "any", but should have added "above 1Mhz" after "any". 8 Mhz will do or 4 MHZ, but would prefer 16MHz.

CrossRoads:
You can set a fuse with an AVR programmer, and output the system clock on a certain pin.

lol, i read the second part and forgot the first part.
thanks for repeating.
puts head in a bag

it looks like avr is another chip, not part of the arduino. why would one need another chip in order to get the clock from the arduino?

This is an Arduino Uno with the AVR processor, an ATmega328P, marked with an arrow...

An "avr" is one chip of several on an Arduino board. It is the "primary" processor. You do not need another chip. The one marked is capable of outputting its clock signal.

ArduinoATmega328.png

You do need an AVR Programmer, which connects to the Arduino at the ICSP header, to program the fuse to have the AVR Processer output the system clock.

See Table 28-9 Fuse Low Byte, and page 34:
9.9 Clock Output Buffer
The device can output the system clock on the CLKO pin. To enable the output, the CKOUT Fuse has to be programmed.
This mode is suitable when the chip clock is used to drive other circuits on the system. The clock also will be output during reset, and the normal operation of I/O pin will be overridden when the fuse is programmed.
Any clock source, including the internal RC Oscillator, can be selected when the clock is output on CLKO. If the System Clock Prescaler is used, it is the divided system clock that is output.

So, you can change the Fuse value in boards.txt for the Uno, reburn the bootloader, and then see the system clock on PORTB, bit 0 (which is D8).
I've not done that myself, but I think that will work.

In boards.txt:

uno.bootloader.low_fuses=0xff

change to
uno.bootloader.low_fuses=0xbf

CrossRoads:
In boards.txt:

uno.bootloader.low_fuses=0xff

change to
uno.bootloader.low_fuses=0xbf

i found three boards.txt
one was for due only, so i guess that is not it.
the other two:
C:\Arduino\hardware\arduino\avr
and
C:\Arduino\hardware\arduino

which one are you talking about?

Not sure - change them both.

it wont let me burn bootloader, and have spent most of the day on google.

What are you using for a Programmer?
Some folks use another Arduino. I use an Atmel AVR ISP MKii.

Scroll down ~1/3 of the way here,

Nick Gammon uses PWM for some fast signals without burning fuses.

using arduino 1.5.5-r2 as the programming environment. i assume that is what you were asking

No, I am asking what you using for a Programmer -something plugs onto the ICSP header, takes control of the chip via Reset and the SPI lines, and can program the fuses and bootloader.
For example, here is an Atmel AVR ISP MKii bootloading a '1284P board.
Others struggle with Arduino as ISP, I can't be bothered. Spend a few bucks, (~$35), get something self contained that works every time. Like your father/grandfather used to say, don't be afraid to spend on good tools. Something along those lines.
http://www.crossroadsfencing.com/BobuinoRev17/

:slight_smile:
thanks for your help.
will be a month or so before i can order any more parts.
glade there is an easier way to program the adruino.