I made a board with AT89LP52 (higher-speed brother of AT89S52) and at the crystal connection I used a 22Mhz crystal with 5pF NPO ceramic caps grounded.

The circuit itself works along with the software on-chip, but I noticed something interesting.

This chip comes with some "fuse" setting that allows me to automatically apply an internal 5Mohm resistor from a crystal connection to ground.

I also noticed that when I touch pins 19 and 20 of the chip together (a crystal pin and ground), the software goes erratic, and I know this due to the results of the LEDs on board during the test.

So I'm curious. If I continue with the AT89LP52, Should I always enable or never enable the internal 5Mohm resistor? and Would my crystal value (of 22.1184Mhz) be too high for this particular chip?

I don't really notice this erratic behavior when I use a normal AT89S52.

Yes the crystal is connected as close to the crystal pins as possible

  • \$\begingroup\$ Please show us the relevant part of the layout around the crystal pins and the crystal. Also, the crystal doesn't go nearest to the crystal pins. The ballast caps do. \$\endgroup\$ – Janka Sep 14 at 6:07
  • \$\begingroup\$ Also, did you enable the high power oscillator mode? \$\endgroup\$ – Janka Sep 14 at 6:11

The datasheet says the resistor may help with oscillator startup especially at higher frequencies. Therefore it should do no harm to enable it.

The crystal you are using is not too high for the chip, it supports up to 24 MHz. But to run at over 20 MHz, the supply voltage must be 4.5V or more. And the High Power oscillator mode must be selected for crystals over 12 MHz.

The crystal pins are very sensitive. Touching them with finger, especially the XTAL1 input pin 19, will disturb the oscillation and anything can happen - it is not normal use to touch them as they need to be very carefully isolated from disturbances. A finger to ground would short the input to ground at far below 1 Mohm resistance so it represents a significant shift in the oscillator DC bias and it will also add significant capacitive load in the range of tens of picofarads. The behaviour is different from another MCU, because they are built differently and have different internal oscillator circuitry.

  • \$\begingroup\$ You probably now this as well, but just to add: crystals are so sensitive even oscilloscope probes can cause them to shift frequency or behave erratically. \$\endgroup\$ – Jan Dorniak Sep 14 at 11:30

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.