Go Down

Topic: question about the system clk (Read 210 times) previous topic - next topic

gzanta

Hi guys

I am using a UNO board for learning.

Can you guys teach me how to output the system clk (16Mhz) please?

Thanks.

jremington

#1
Dec 29, 2015, 03:14 am Last Edit: Dec 29, 2015, 03:16 am by jremington
I don't think that is possible on a standard I/O pin, on the UNO. Why do you want to do that?

CrossRoads

Need to use a Programmer and set a fuse bit.

It's bit 6 of the High Fuse byte:
CKOUT(3)    Bit 6      Clock output      1 (unprogrammed)

(3). The CKOUT Fuse allows the system clock to be output on PORTB0. See "Clock Output Buffer" on page 36 for
details.

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Change this in boards.txt, and reburn the bootloader:
From:
uno.bootloader.high_fuses=0xde
To:
uno.bootloader.high_fuses=0x9e
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

jremington

Thanks, CrossRoads! I learn something every day.

BillHo

Quote
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.


CLKO, Divided System Clock: The divided system clock can be output on the PB0 pin. The
divided system clock will be output if the CKOUT Fuse is programmed, regardless of the
PORTB0 and DDB0 settings. It will also be output during reset.


 
You need to change the bit 6 of the Fuse Low Byte, to get the system clock output at CLKO which is Arduino Uno digital pin 8

Data sheet

gzanta

Need to use a Programmer and set a fuse bit.

It's bit 6 of the High Fuse byte:
CKOUT(3)    Bit 6      Clock output      1 (unprogrammed)

(3). The CKOUT Fuse allows the system clock to be output on PORTB0. See "Clock Output Buffer" on page 36 for
details.

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.
Thanks, can you tell me which mannul this is please? I think I need to read more about it since I am totally new to Arduino. Thanks.

BillHo

You need to change the bit 6 of the Fuse Low Byte, to get the system clock output at CLKO which is Arduino Uno digital pin 8

Data sheet
Thanks, can you tell me which mannul this is please? I think I need to read more about it since I am totally new to Arduino. Thanks.
It is in the data sheet.

sterretje

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

gzanta

Change this in boards.txt, and reburn the bootloader:
From:
uno.bootloader.high_fuses=0xde
To:
uno.bootloader.high_fuses=0x9e
thanks for the reply, can I ask one more question plz?

there are low_fuses and high_fuses, what is the differences  between them please?

the low_fuses is set to 0xFF, and the high_fuses is 0xDE now.

LarryD

thanks for the reply, can I ask one more question plz?

there are low_fuses and high_fuses, what is the differences  between them please?

the low_fuses is set to 0xFF, and the high_fuses is 0xDE now.
http://www.ladyada.net/learn/avr/fuses.html

.
No technical PMs.
The last thing you did is where you should start looking.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy