Enabling CLK0 Fuse on Atmega328P

I have a project where I need to have the clock output on PB0 to drive another IC.

I want to use the Arduino IDE and bootloader.

I have Atmega328P with the Arduino bootloaders on them and a USBTinyISP. The default data for the Arduino Atmega328P is:

Arduino Duemilanove or Nano w/ ATmega328
Low Fuse 0xFF
High Fuse 0xDA
Extended Fuse 0×05

What I want to do is set the fuse for CLK0 to enable CLK0 at PB0. I checked the fuse calculations and using the USBTinyISP and AVRDUDE I plan to set the fuses as follows:

-U lfuse:w:0xbf:m -U hfuse:w:0xda:m -U efuse:w:0x05:m

Basically, I am changing the Low Fuse from 0xFF to 0xBF. The others remain as the Arduino default.

  1. Is there any problem with doing this?

  2. When I compile and upload a new program using the Arduino IDE, will the fuse still be set as I set it? In other words, once I set that fuse, can I develop the program assuming PB0 will be outputting the system clock for that IC for future compiles?

Thanks

  1. I haven't tried this but I don't think there should be a problem. If there is any issue, just reprogram the original fuse value.

  2. Yes, uploading from the IDE does not set or reset any fuses.

You may want to make a few adjustments to those fuse settings. I suggest...

• Adding " Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0]"

• Changing the brown-out detection to "Brown-out detection level at VCC=4.3 V; [BODLEVEL=100]"

That should leave you with the following...

Low: BF
High: D2
Extended: 04

If you decide to use my suggestions, be sure to confirm them before using them!

  1. Is there any problem with doing this?

No. The only critical fuse is "Reset Disabled (Enable PC6 as i/o pin); [RSTDISBL=0]". DO NOT BURN THAT FUSE. The only way to recover is "high voltage" programming or debugWIRE.

The clock fuse is second most critical. If you get that wrong it can be annoyingly difficult to recover but it is possible.

  1. When I compile and upload a new program using the Arduino IDE, will the fuse still be set as I set it?

Yes.

In other words, once I set that fuse, can I develop the program assuming PB0 will be outputting the system clock for that IC for future compiles?

Yes.

Thanks for the replies!