XTAL configuration

Started by Michael Millikan February 8, 2004
Hello everyone,

I'm having a bit of trouble running a PIC16F84.

It's a fairly trivial application - a stepper motor driver - but for some
reason I can't get the oscillator to work properly. I got it working with an
RC configuration (so I know the code is fine), but when I switched to a 2meg
crystal it doesn't seem to work. I set the configuration bits to XT, with
both the watchdog timer and power up timer disabled. I used 33pF caps,
connected to the OSC1 and OSC2 pins and to ground (with the crystal of
course connected to the OSC1 and OSC2 pins.) The only part number I've got
on the crystal is HC18, but I have no idea what that means (I hope it's
parallel cut...).
This is on a perf board so I guess there might be some signal coherence
issues, but I believe that at 2meg it should be negligible.

Are there any tricks to it? Does anyone know what may be wrong?

Vecheslav Silagadze

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?pageatures/photos&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca



Have you grounded the crystal case?
There is also a lot more stray capacitance on a perf board so you
need to make the crystal wiring as tight (short) as possible, and
possibly reduce your ballast caps to something like 15pf.
I also found that no caps worked the best for proto boards with the
5 per row spring steel contacts.

What frequency are you using? Have you tried HS mode, which has
a higher drive level?

Robert

Michael Millikan wrote:
>
> Hello everyone,
>
> I'm having a bit of trouble running a PIC16F84.
>
> It's a fairly trivial application - a stepper motor driver - but for some
> reason I can't get the oscillator to work properly. I got it working with an
> RC configuration (so I know the code is fine), but when I switched to a 2meg
> crystal it doesn't seem to work. I set the configuration bits to XT, with
> both the watchdog timer and power up timer disabled. I used 33pF caps,
> connected to the OSC1 and OSC2 pins and to ground (with the crystal of
> course connected to the OSC1 and OSC2 pins.) The only part number I've got
> on the crystal is HC18, but I have no idea what that means (I hope it's
> parallel cut...).
> This is on a perf board so I guess there might be some signal coherence
> issues, but I believe that at 2meg it should be negligible.
>
> Are there any tricks to it? Does anyone know what may be wrong?




----- Original Message -----
From: "Michael Millikan" <>
To: <>
Sent: Sunday, February 08, 2004 2:03 AM
Subject: [piclist] XTAL configuration > Hello everyone,
>
> I'm having a bit of trouble running a PIC16F84.
>
> It's a fairly trivial application - a stepper motor driver - but for some
> reason I can't get the oscillator to work properly. I got it working with
an
> RC configuration (so I know the code is fine), but when I switched to a
2meg
> crystal it doesn't seem to work. I set the configuration bits to XT, with
> both the watchdog timer and power up timer disabled. I used 33pF caps,
> connected to the OSC1 and OSC2 pins and to ground (with the crystal of
> course connected to the OSC1 and OSC2 pins.) The only part number I've got
> on the crystal is HC18, but I have no idea what that means (I hope it's
> parallel cut...).

The cut doesn't matter, it just means the crystal will be off-frequency
slightly if it is for series operation. HC18 is probably the case package. > This is on a perf board so I guess there might be some signal coherence
> issues, but I believe that at 2meg it should be negligible.

Try a different crystal?

Leon

Leon Heller, G1HSM
Email:
My low-cost Philips LPC210x ARM development system:
http://webspace.webring.com/people/jl/leon_heller//lpc2104.html