Electronic – Brand new ATmega8 – Changing Fuse Bits

avrfuse-bitsisp

I seem to have a little confusion regarding changing the fuse bits on a new ATmega8 AVR.

A brand new AVR comes with 1 MHz internal RC setting and there's no CKDIV8 fuse bit. Also since ISP programming should be done at less than 1/4th the speed of MCU, initially I have to program at < 250 kHz.

Now my question is when I plug in the AVR to the power source and wire up the SPI connections, and want to change the clock to 12 MHz external crystal do I first program the new fuse bit settings into the AVR (with no crystal connected) and then connect the 12Mhz crystal to the XTAL pins (along with the caps) or connect the crystal and then program the required fuse bits?

Also when one is programming an AVR, does it need a power source or does that come from the ISP header itself?

Best Answer

[order]

Shouldn't matter. The AVR won't use the crystal until nRST is released, so you may as well hook it up first.

[power]

That depends on whether or not the programmer provides power. If it doesn't then you'll need to do so.