ATMEGA16 erratic behavior with 8MHz crystal

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

Hello,
I have an ATMEGA16 project, on a bread board. I am using an 8MHz crystal with 2 15pf caps. My program is running all over itself, in a seemingly random pattern. I have run the same program using the internal RC oscillator and it works fine.

I'm sure that a breadboard is not the ideal place to have an 8MHz clock. This is probably the problem here. Has anyone else dealt with this before? And what can be done to fix it?

thanks,
Andy

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

Quote:

My program is running all over itself, in a seemingly random pattern.

Wonder what that means?!?

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

I assume you're playing with a DIP. Solder decoupling caps onto the power pin pairs on either side. On the pins. It can be done neatly so it still fits properly in a socket. Short the digital and analog ground pins across the top of it using a short wire. A leftover resistor's leg is good.
Bend out the xtal pins so they don't enter the breadboard, solder the crystal to them, and the crystal load caps from the pins to the ground pin right next to them. Also, use the correct load caps. Take the nominal load capacitance of the crystal, multiply by 2, subtract 7pf for the pin.

/Kasper

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

Set fuses to full swing oscillator.

Peter

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

Thanks for the help.

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

..and don't forget about bad solder joints in your crystal components too.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I used to have the same problem.

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

It may be better to use crystal oscillator modules with logic level outputs on breadboards, instead of crystals.