-3
\$\begingroup\$

I want to build a basic Atmega8a (DIP-28) micro-controller circuit (programed using a 10 pin ISP socket).

I have found several basic circuits. Some of them use crystal oscillator, some use internal oscillator.

1- What options we have when it comes to oscillator? (different methods of using internal and external oscillator).

2- When we use which?

3- What problems each might pose when transferring programs to the chip using an ISB programmer (say USB ASP). Which one is easier to use?

\$\endgroup\$
  • 3
    \$\begingroup\$ Have you had a chance to look at the datasheet yet? \$\endgroup\$ – Ignacio Vazquez-Abrams Dec 29 '15 at 8:54
0
\$\begingroup\$

First, I will really use 6 pin instead of 10.

  1. Internally, you can use 1, 2, 4, 8 MHz. Externally, you can use from 32k-16 MHz. You probably can use higher than 16 MHz, but I haven't tested that.

  2. Normally I will use 8 MHz internally when timing is not that important. If timing is important, I will use a high accurate 16 MHz externally. The crystal from a Uno is not considered high accuracy. The time when you use a lower frequency is when you are powering your project with a battery or the code is very simple that doesn't require high frequency. You set this up by setting the fuse.

  3. In term of uploading, they are all the same if you plan to upload with a programmer.

\$\endgroup\$
0
\$\begingroup\$
  1. Internally the Atmega can work with 1,2, 4 and 8 MHz. And externally you can add upto 16Mhz. The purpose of connecting a crystal oscillator to a microcontroller is that it requires clock pulses for its functionality. For each instruction fetching, decoding, executing, and storing, processor require clock pulse. For most purposes the internal oscillator is accurate enough. On AVRs, for example, the data sheet claims the factory calibration is within 10%. Obviously that won't do for a real time clock, but for asynchronous serial communications like RS232 it's only necessary to be within 4%. For something like USB, however, more precision is needed, and for that you normally need an external crystal. A crystal will be accurate to better than 0.05% without trimming and won't drift significantly with normal temperature changes.
  2. While programming a microcontroller, you may pose a problem of incorrect connections, Improper voltage supplies and a lot more which you'll just learn with experience.
\$\endgroup\$
  • \$\begingroup\$ Note that you can calibrate the internal oscillators to +/- 1% of the datasheet specified frequency using the methodology described in this app note from Atmel: atmel.com/images/doc2555.pdf \$\endgroup\$ – justinrjy Dec 30 '15 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.