[SOLVED] How to use internal 8MHZ oscillator in atmega8?

Status
Not open for further replies.

Briez

Member level 5
Joined
Nov 30, 2012
Messages
83
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,835
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:



Hope this helps.
Tahmid
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…