I have an Atmega8 and an external oscillator. The oscillator is a rectangular, 4-pin component that I picked up in a local surplus store (no data sheets, loose parts, no regular stock); however, I did some research on the internet, and I think that this is likely the data sheet. Based on some research on avrFreaks, I believe that this is an "external clock."
I would like to experiment with this clock source - in particular I am working thru Deans USART tutorial (I know that 16Mhz is not one of the "magic numbers," but it seems to be within the 2% error tolerance that Dean references). I want to use it with my ATMega8. I am programming the mcu with an AVRISP MKII.
Can someone offer some advice as to whether I am think in the following thru correctly?
First: To use this clock source, it seems that I need to select "External Clock" in the fuse drop down menu in AVR Studio. Table 12 on page 32 of the data sheet suggests that the only 3 options for the ATMega8 and an external clock are:
6 CK "“ BOD enabled
6 CK 4.1 ms - Fast rising power
6 CK 65 ms - Slowly rising power
In the drop down menu "6 CK 65 ms" isn't a choice, but "6 CK 64 ms" is a choice - I assume that they are the same? Not sure if I understand which "start-up" time I should use, but since the "default" setting that the chip ships with is "Slowly rising power," I am inclined to select that option - does that sound right?
Second: Also, with respect to the CKOPT Fuse, the data sheet says
By programming the CKOPT Fuse, the user can enable an internal 36 pF capacitor between
XTAL1 and GND, and XTAL2 and GND.
So, I assume that I should check that box on the fuse dialogue menu?
Third: Per Figure 13 on page 32 of the mcu data sheet and the clock's data sheet, I hook pin #7 of the clock to GND, #8 to XTAL1 of the mcu, #14 to Vcc (5V, same as the mcu) and leave #1 unconnected.
Fourth: When I am done experimenting, I want to re-set internal clock. If I program mcu with my AVRISP MKII while it is still connected to the external clock, will I be able to re-set the internal clock (i.e., the factory setting)? Is it as simple as going into the fuse menu and selecting the "default" fuse setting?
Thanks for any help and patience.