Need to set 20 MHz external crystal to work with Atmega328P

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been working with my micro-controller for the last 2 months and i have had a bitter experience while setting fuse bits. I had to throw away one...

So now i need to work with an external clock of 20Mhz

i have got a 20MHz crystal and while reading the datasheet i have learned i need to connect it to the xtal1 and xtal2 pins of the uC. and i know that i need to use 22pF capacitors on both pins and then put them to ground...

But i dont know the part where i need to tell the uC that it has to work off the external clock

But even after searching the net and reading the datasheet i am not confident enough to try setting the fuse bits to make my uC work with external clock.

Could anyone here help me out? i really need to do this and after this i do have a few more doubts about this... But first can anyone pls help me set my uC to work with 20MHz crystal

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But even after searching the net and reading the datasheet i am not confident enough to try setting the fuse bits to make my uC work with external clock.

www.engbedded.com/fusecalc

it says:

low: F7
high: D9
ext: FF

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alfie.max15 wrote:
So now i need to work with an external clock of 20Mhz

i have got a 20MHz crystal and while reading the datasheet i have learned i need to connect it to the xtal1 and xtal2 pins of the uC. and i know that i need to use 22pF capacitors on both pins and then put them to ground...

That is not an external clock. An external clock is usually a square block with a pin in each corner, and needs a Vcc connection.

Tread carefully - you may brick another AVR and need assistance in recovering it ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Correct.

An external oscillator is a stand-alone device that generates a signal when you apply power, even if there is no micro. It connects to one pin of the micro.

If you want to use an external crystal, DO NOT set the fuses for "external oscillator" as the crystal will not work.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!