Can anyone tell me how to use an internal RC oscillator as a clock source in atmega8?
I have searched a lot about that and found, there should be configuration bits programmed using ponyprog2000. But when i program configuration bits my program cant be run and when i connect external oscillator between XTAL1 and XTAL2 the program execution speed increases.
Please tell me how to program config bits in proper way....
You can find your required information under the "System Clock and Clock Options" section in the datasheet.
Here's a table from there:
The table shows the required fuse bits settings for CLKSEL3..0 that set the oscillator settings. So, you have to select between 0100 and 0001 for CLKSEL3..0 bits. Now, the value you choose - between 0100 and 0001 - determines the frequecy. And here's the table that reveals that:
So for 8MHz, select 0100 which means that CLKSEL3 = 0 (programmed), CLKSEL2 = 1 (unprogrammed), CLKSEL1 = 0 (programmed), CLKSEL0 = 0 (programmed).
Another interesting thing is that the SUT bits select the startup time and here's the table that shows the different options: