Hello everyone,
I've been trying to learn the ATmega8 coding for a day or two and I'm confused about the ADC clock and the default clock for the CPU.
So, from my understanding, you set the ADC clock using the ADCSRA register and its division factors to set the ADC clock between 50Khz to 200Khz. Now, I thought the clock for the CPU is 16 Mhz but its default is 1Mhz. So, you use a division factor of 8 (since 1000Khz/8 = 125Khz). But, if the CPU clock can go up to 16Mhz, how do you set it to 16Mhz? I've been trying to google "ATmega8 setting clock" or something similar but no luck. Like for MSP430 LaunchPad, you would use BCSCTL1 and DCOCTL registers to control the frequency of the digital clock oscillator for the CPU but I can't seem to find the registers to set the CPU clock for the ATmega8.
Thanks a lot!