Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Atmega16 ext oscillator

Status
Not open for further replies.

Michael_N

Member level 2
Joined
Jan 11, 2012
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Denmark
Activity points
1,685
Hi,

I have an Atmega16 controlling a relay. It all works on my STK500 board, so now I have made a PCB for it. But A friend of mine says that the internal oscillator is no good, and he recommended me using a crystal. I already had some 12 MHz crystals from another project so I might as well use these.

But how do I set the processor up in AVR studio to run with the ext crystal. As it is now it does not run on my pcb, but when I put it back on the stk 500kit it works fine.

I now where do make the settings, I'm just unsure which one to choose.

Best regards
Michael
 

The internal RC if fine unless you are looking for a high accuracy clock source or you want to use a frequency above 8MHz.
What are the current settings of the CKOPT and CKSEL fuses?
 
The internal RC if fine unless you are looking for a high accuracy clock source or you want to use a frequency above 8MHz.
What are the current settings of the CKOPT and CKSEL fuses?

Hi Alexan,

To be honest I would prefer to use the internal oscillator. And for this use I don't need high accuracy at all. Would it be a problem using the internal osc witch the pcb I already made? If I remove the crystal related components it would fine, or?

Anyway, the CKOPT fuse is not selected.

The last CKSEL on the list is selected: EXT. CRYSTAL/RESONATOR High Freq.; Start-up time: 16K CK + 64ms, [CKSEL=1111 SUT11]
 

If you don't need high accuracy and a frequency below or equal to 8MHz is fine, you can use the internal oscillator. It's completely fine and reliable. You can use it comfortably.

Just don't use the crystal related components in the PCB and set the fuses for internal oscillator.

Hope this helps.
Tahmid.
 

Michael_N said:
A friend of mine says that the internal oscillator is no good, and he recommended me using a crystal.
This is not the whole truth. If you need precision in clocking, then your friend is right. If on the other hand you have to manage simple time tasks, then the internal oscilator is just fine.


Michael_N said:
I already had some 12 MHz crystals from another project so I might as well use these.
What is the supply voltage of the ATmega16? Is it an ATmega16, or maybe a 16L or a 16A? 16L for instance, can go up to 8MHz.


Michael_N said:
But how do I set the processor up in AVR studio to run with the ext crystal. As it is now it does not run on my pcb, but when I put it back on the stk 500kit it works fine.
In situations like this, the best thing you can do is run the project with the internal crystal first to make sure that the project is working properly, and then try with the external crystal.


Michael_N said:
I now where do make the settings, I'm just unsure which one to choose.
I do not have AVRStudio in front of me right now, but you can choose external oscilator 8+MHZ with 16ms start up delay.


Alexandros
 
The settings for internal RC are

Code:
CKSEL3..0                  Nominal Frequency (MHz)
0001                                  1.0
0010                                  2.0
0011                                  4.0
0100                                  8.0

The CKOPT Fuse should always be unpro-grammed when using this clock option

Note that a 0 means programmed while 1 means unprogrammed.

Thew SUT1..0 =11 seems very strange, 11 is a reserved value which is not valid.

Your described value of CKSEL=1111 makes sense for an external crystal setting.

---------- Post added at 18:58 ---------- Previous post was at 18:50 ----------

...the best thing you can do is run the project with the internal crystal first to make sure that the project is working properly, and then try with the external crystal.

Just to clarify things there is no internal crystal, the internal AVR clock source is an RC oscillator.
I'm sure that you already know that and you wrote it by mistake but I don't want anyone reading the thread to get the wrong impression for the internal clock source.
 
alexan_e said:
Just to clarify things there is no internal crystal, the internal AVR clock source is an RC oscillator.
Yes, it's an internal RC oscilator. You are right that we must be accurate to avoid confusions.
 

Hi again,

Sorry for my late answer.
Thanks to your help, I now use the internal oscillator.
And I've have total control over changing between internal oscillator and ext crystal... Actually it is quite easy:)
So thanks again guys!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top