Electronic – Isolation of watch crystal from ICSP

crystalisolationpic

I'm working on a project which uses a PIC with a 32kHz watch crystal attached to Timer1. Unfortunately, the chip I'm currently using, PIC16F1827, shares the T1OSI & T1OSO pins with ICSPCLK & ICSPDAT.

I'd like to be able to use the ICSP, ideally without having jumpers or other manual management.

What would be the best way to isolate the crystal from the ICSP?

The data sheet, and other notes I've found around this, are not specific, obviously given the wide range of circuitry that might be connected to the ISCP pins.

It is recommended that isolation devices be used to separate the programming pins from other circuitry. The type of isolation is highly dependent on the specific application and may include devices such as resistors, diodes, or even jumpers.

Edit to add: I believe the crystal is a DT-26 model, from MEC.

Best Answer

With a decent programmer that has sufficiently low impedance drive on PGC and PGD (our USBProg has 150 Ω, for example), a crystal between those two lines shouldn't interfere with programming.

However, check the crystal specs. The problem is that ±5 V accross the crystal, especially something low power like most 32768 Hz crystals, could damage it. Since the crystal is high impedance relative to the programming lines, even at its resonant frequency, you can put a resistor in series with it. It's can't be so high as to cause a meaningful phase shift at 33 kHz, but maybe there is a value between that and where it can still protect the crystal. Again, the key is the crystal datasheet. If necessary, ask the crystal company if it is OK to put ±5 V accross it at arbitrary frequencies.

Added in response to datasheet:

It says the crystal effective series resistance is 22-40 kΩ and that the max drive level is 360 nW. Those together imply only 89 mV, but that would be what should be accross the crystal at the resonant frequency. It can probably tolerate much more off resonance, but that is of little use since you can't guarantee the programmer won't happen to produce signals near 33 kHz between PGC and PGD for long enough to be a problem, and you don't know what "near" and "long enough" are.

So yes, it appears you do have a problem that needs careful consideration. It doesn't look like there will be any easy answers, just annoying choices. The first step would be to talk to the crystal manufacturer and find out what you can really get away with when you're not expecting the crystal to be producing good timing. Normal operating limits and absolute maximum limits can be quite different, and this datasheet is rather vague on the specifics.