EmbeddedRelated.com
Forums

werial port error & crystal freq measurement method for a 9s12dg128

Started by blewis999 June 1, 2006
Does anyone know how to measure the freq of a Pierce oscillator? I
tried a scope probe on xtal but do not see anything, same for extal.

I have four identical boards, one that a SCI port that works correctly
and three that the SCI function won't work. The one that does work,
has a through hole crystal mounted on the smd pads for a SMD crystal.
I did this by bending the pins and soldering it on. It works perfectly.

The other 3 boards have the SMD crystal mounted on the pads as it was
designed to be mounted. All functions on the boards work except that
the sci port output is wrong. The output seen on a terminal emulator
looks like a baudrate mismatch; which is why I suspect the crystal.

We use CW process expert to generate the cpu setup code so I don't
suspect the code. All four boards have exactly the same code loaded.

Can anyone suggest a way to trouble shoot this sort of problem. I
could try taking the smd crystal off but the last time I did that it
pulled the pads off at the same time, damaging the board, because
there are no exposed areas to desolder. The pads are completely under
the crystal.

Thanks in advance

Bob Lewis

Hi Bob,

You could drive a pin in a loop and measure
the period to compare the two boards, or set
up a PWM output also. You could also look at
the SCI with a scope also, and work out the
baud rate.

Regards,
Darren Moore
> -----Original Message-----
> From: 6... [mailto:6...]
> On Behalf Of blewis999
>
>
> Does anyone know how to measure the freq of a Pierce oscillator? I
> tried a scope probe on xtal but do not see anything, same for extal.
>
> I have four identical boards, one that a SCI port that works
> correctly
> and three that the SCI function won't work. The one that does work,
> has a through hole crystal mounted on the smd pads for a SMD crystal.
> I did this by bending the pins and soldering it on. It works
> perfectly.
>
> The other 3 boards have the SMD crystal mounted on the pads as it was
> designed to be mounted. All functions on the boards work except that
> the sci port output is wrong. The output seen on a terminal emulator
> looks like a baudrate mismatch; which is why I suspect the crystal.
>
> We use CW process expert to generate the cpu setup code so I don't
> suspect the code. All four boards have exactly the same code loaded.
>
> Can anyone suggest a way to trouble shoot this sort of problem. I
> could try taking the smd crystal off but the last time I did that it
> pulled the pads off at the same time, damaging the board, because
> there are no exposed areas to desolder. The pads are completely under
> the crystal.
>
> Thanks in advance
>
> Bob Lewis
>





I have no problem probing either pins on the pierce oscillator
configured crystal with 10M ohm oscilloscope probe. If it does not
oscillate it's not working or does not have enough margin.

Andrew Lohmann AMIIE
Design Engineer

PLEASE NOTE NEW EMAIL ADDRESS IS:
a...@bellinghamandstanley.co.uk

Bellingham + Stanley Ltd.
Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
Tel: +44 (0) 1892 500400
Fax: +44 (0) 1892 543115
Website: www.bs-ltd.com

blewis999 wrote:

> Does anyone know how to measure the freq of a Pierce oscillator? I
> tried a scope probe on xtal but do not see anything, same for extal.
>
> I have four identical boards, one that a SCI port that works correctly
> and three that the SCI function won't work. The one that does work,
> has a through hole crystal mounted on the smd pads for a SMD crystal.
> I did this by bending the pins and soldering it on. It works perfectly.
>
> The other 3 boards have the SMD crystal mounted on the pads as it was
> designed to be mounted. All functions on the boards work except that
> the sci port output is wrong. The output seen on a terminal emulator
> looks like a baudrate mismatch; which is why I suspect the crystal.
>
> We use CW process expert to generate the cpu setup code so I don't
> suspect the code. All four boards have exactly the same code loaded.
>
> Can anyone suggest a way to trouble shoot this sort of problem. I
> could try taking the smd crystal off but the last time I did that it
> pulled the pads off at the same time, damaging the board, because
> there are no exposed areas to desolder. The pads are completely under
> the crystal.
>
> Thanks in advance
>
> Bob Lewis
>
> SPONSORED LINKS
> Fast track
>
> Microcontrollers
>
> Technical support
>
>
> Intel microprocessors
>
>
>
> >.
>
>

-----------------------------Disclaimer-----------------------------

This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the addressee. If you are not the addressee please note that any distribution, reproduction, copying, publication or use of this communication or the information is prohibited. If you have received this communication in error, please contact us immediately and also delete the communication from your computer. We accept no liability for any loss or damage suffered by any person arising from use of this e-mail.

-----------------------------Disclaimer-----------------------------





If you have a debugger hooked up, you can look at the CRGFLAG register
to see if the SCM bit is set. This would indicate that you are in Self
Clocked Mode, which would explain why things are running, but timing is
off. Since the board with the unique crystal is the one with the
problem, and if you don't see the crystal oscillation with a high
impedance scope probe, the crystal may be damaged or the wrong type,
capacitor values may be wrong for that crystal, check series resistor
value if present, etc. The other possibility would be a defect elsewhere
- depends which S12 type, but there are pins which configure chip to use
Colpitts vs. Pierce. If that pin has the wrong level at reset , you
would wind up in self clocked mode as well.

Dave
blewis999 wrote:
> Does anyone know how to measure the freq of a Pierce oscillator? I
> tried a scope probe on xtal but do not see anything, same for extal.
>
> I have four identical boards, one that a SCI port that works correctly
> and three that the SCI function won't work. The one that does work,
> has a through hole crystal mounted on the smd pads for a SMD crystal.
> I did this by bending the pins and soldering it on. It works perfectly.
>
> The other 3 boards have the SMD crystal mounted on the pads as it was
> designed to be mounted. All functions on the boards work except that
> the sci port output is wrong. The output seen on a terminal emulator
> looks like a baudrate mismatch; which is why I suspect the crystal.
>
> We use CW process expert to generate the cpu setup code so I don't
> suspect the code. All four boards have exactly the same code loaded.
>
> Can anyone suggest a way to trouble shoot this sort of problem. I
> could try taking the smd crystal off but the last time I did that it
> pulled the pads off at the same time, damaging the board, because
> there are no exposed areas to desolder. The pads are completely under
> the crystal.
>
> Thanks in advance
>
> Bob Lewis
>
>
Do you have an insulator between the crystal and your board?

Dave
blewis999 wrote:

> Does anyone know how to measure the freq of a Pierce oscillator? I
> tried a scope probe on xtal but do not see anything, same for extal.
>
> I have four identical boards, one that a SCI port that works correctly
> and three that the SCI function won't work. The one that does work,
> has a through hole crystal mounted on the smd pads for a SMD crystal.
> I did this by bending the pins and soldering it on. It works perfectly.
>
> The other 3 boards have the SMD crystal mounted on the pads as it was
> designed to be mounted. All functions on the boards work except that
> the sci port output is wrong. The output seen on a terminal emulator
> looks like a baudrate mismatch; which is why I suspect the crystal.
>
> We use CW process expert to generate the cpu setup code so I don't
> suspect the code. All four boards have exactly the same code loaded.
>
> Can anyone suggest a way to trouble shoot this sort of problem. I
> could try taking the smd crystal off but the last time I did that it
> pulled the pads off at the same time, damaging the board, because
> there are no exposed areas to desolder. The pads are completely under
> the crystal.
>
> Thanks in advance
>
> Bob Lewis
>
> SPONSORED LINKS
> Fast track
>
> Microcontrollers
>
> Technical support
> Intel microprocessors
>
> >.
>
>


--- In 6..., blewis999 wrote:
>

> Can anyone suggest a way to trouble shoot this sort of problem. I
> could try taking the smd crystal off but the last time I did that it
> pulled the pads off at the same time, damaging the board, because
> there are no exposed areas to desolder. The pads are completely under
> the crystal.
>

I have experienced this before but it might not be so with your
symptomatic problem but...

Seems to be an overcooked SMD crystal thru the reflow oven might be
the problem?

One test you could probably do, the board you have with the tacked on
thru hole crystal. Make the SMD have legs ie. solder pieces resistor
leads to your SMD crystal then tack them onto the SMD pads.

> Thanks in advance
>
> Bob Lewis
>





Andrew Lohmann wrote:
> I have no problem probing either pins on the pierce oscillator
> configured crystal with 10M ohm oscilloscope probe. If it does not
> oscillate it's not working or does not have enough margin.
I think this is the problem or very close to it.

I wrote a program that toggled a pin as Darren suggested and found
that in fact the oscillator was way off. On the board that was working
it produced a square wave of 1.11khz, the non working board produced
449hz.

So thinking I had found the problem I changed all the smd xtals to
through hole by just bending the pins and resoldering. They all worked
correctly... for a while. Now one of them is back at 449hz in the test.

So I think the oscillator cct is unstable and I can't see a wave form
on the xtal pin (maybe low gain as Andrew suggested).

I am using a 22pf and 1nf to gnd across the xtal and 1M ohm in
parallel to the xtal.

Can anyone suggest other values? I think we got these from an appnote
or design on the net.

Oscillator design is not something I have done before... so any
direction is appreciated. The pll is off and we have xclks grounded
for Pierce mode.

"you can look at the CRGFLAG register
to see if the SCM bit is set"

I will try this in the morning.

Thanks for the help

Bob Lewis





> correctly... for a while. Now one of them is back at 449hz in the
test.
>
> So I think the oscillator cct is unstable and I can't see a wave
form
> on the xtal pin (maybe low gain as Andrew suggested).
>
> I am using a 22pf and 1nf to gnd across the xtal and 1M ohm in
> parallel to the xtal.
>
> Can anyone suggest other values? I think we got these from an
appnote
> or design on the net.

Speaking of ap notes, did you follow the suggested PC board layout?
It seems to be fairly critical, because Freescale provides suggested
layouts for several versions of this chip in the Device User Guide,
section 23.

Gary Olmstead
Toucan Technology
Ventura CA





garyolmstead wrote:

[...]

> Speaking of ap notes, did you follow the suggested PC board layout?
> It seems to be fairly critical, because Freescale provides suggested
> layouts for several versions of this chip in the Device User Guide,

In my opinion and experience the Freescale layout suggestions are not
suitable in many cases. I guess that especially devices without
conductive enclosure will fail EMC immunity tests (indirect ESD on
HCP) when using these layouts.

I see absolutely no reason to break the ground plane below the
oscillator, and I also wouldn't make the slots in the groundplane
below the controller.

But one has to _understand_ how the oscillator works to make a
reliable design. A high impedance probe is needed for confirmation.
See http://www.oliverbetz.de/hit/hit_e.htm for a simple "home brew"
design.

Oliver
--
Oliver Betz, Muenchen

At 21:00 01/06/2006 -0700, you wrote:
>I am using a 22pf and 1nf to gnd across the xtal and 1M ohm in
>parallel to the xtal.
>
>Can anyone suggest other values? I think we got these from an appnote
>or design on the net.

As Uwe pointed out, the capacitors you selected are no good for Pierce
oscillator.
Specifically 1nF capacitor is way too hi for the Pierce oscillator - for
example at 4MHz 1nF capacitor gives a relatively low typical resistance of
40ohm to GND - too low.
(according to the formula Xc = 1/(2*PI*F*C)

Try using two equal capacitors somewhere in the range of 10pF - 47pF,
between both EXTAL and GND, and XTAL and GND.

Another recommendation is to make sure you actually measure 2.5V on both
the VDD and the VDDPLL pins. I have seen too many HCS12 customers who
mistakenly connected VDD or VDDPLL to the +5V supply, and got very marginal
operation, including self-clock mode, damaged Flash, and other misbehaviors
(rather than a completely inoperable design which would have been the
natural expected behavior when the internal 0.25um gates are connected to
5V instead of 2.5V).

Hope this helps,
Doron
Nohau
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html