Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

stk500 clock source atmel microcontroller

Status
Not open for further replies.

hani_a

New Member
what's the difference between using the microcontroller clock vs. using an external crystal or osscillator? what's the difference between the oscillator and the crystal? do i need only 1 clock for the microcontroller? does it have an
exact value? or should it just be approximately the same value?

i happen to be using an atmega16 microcontroller on an stk500 board; i'm currently using the board osscillator and i want to use the microcontroller clock instead... any hints? i'm very new to the topic!

thanks a million for the help!

hani a.
 
The difference between the microcontroller's internal clock and the external clock is that the internal clock is based on an internal RC oscillator. This oscillator is not as stable as using an external crystal.

You only need one of the clock sources. AVRSTUDIO allows you to configure the target microcontroller for internal or external clock.

Be aware that the ATMEGA16 included with your STK500 often comes with the JTAG function enabled. This makes PORTC2, PORTC3, PORTC4 and PORTC5 unavailable for general IO signal use. You can use AVRSTUDIO to disable the JTAG feature.

hgmjr
 
That's right. You get to choose which clock source you get to use. The main reasons for one choice over another are:

cost: if you use an external crystal or ceramic resonator, then you have to buy that part and the cost might be $.50 or so. But if you can use the internal RC oscillator, there is no additional cost.

frequency stability: the accuracy of the oscillator frequency is the main thing that is different with the different oscillator choices. The most accurate oscillator is one using a crystal. The next most accurate would be a ceramic resonator. The least accurate would be either the internal RC oscillator or an external RC oscillator. For example, a crystal rated at 100ppm tolerance might be accurate to within 0.01% and then as temperature varies, you might get another 0.005% variation. To contrast, the RC oscillator is only accurate to about 3% and if you "calibrate" following data sheet descriptions, you might get down to 1% and then variation over temperature might still be in the 1 to 5% range. So crystal is much more accurate, but RC is cheaper. Most people use crystals. Ceramic resonators can also work and they fall in between crystal and RC for accuracy.
 
You should try reading your STK500 owners manual, and the AVR Application notes, it covers all of this in detail.
 
Another advantage to using the internal clock over an external crystal is that you can use the pins that would otherwise be used to connect to the crystal as digital IO.

It is always a good idea to read the owner's manual as sceadwian has mentioned. There are often precautions that you should take when using a piece of equipment that you will only know about if you read the manual carefully before you proceed.

hgmjr
 
Last edited:
dear friends,
i have problem when i am using microcontrller for AC switching application, out put of the mcu to the relay . when spike generated in ac ckt while relay operating, then the out put of the other or same pin of mcu going to change...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top