EmbeddedRelated.com
Forums

DCO Jitter and Effects on UART

Started by James Joyce August 17, 2010
Hey everyone,

This is a continuation of my UART issues. When I look at the clock output of the
MSP430F1611 after I set it to 4Mhz using a 32kHz crystal I see a very large
jitter. In fact, the signal looks like a square wave and at the same time there
are "shifter versions" of it around what would be the 4Mhz signal.

My oscilloscope measures the frequencies to be between 3.85MHz and 4.15MHz. That
is, constantly the frequency of the DCO is shifting between those values and I
would assume between them too. Is this any way normal? I would expect some
jitter but not that much. Am I going to be forced to use a HF crystal?

Thank you



Beginning Microcontrollers with the MSP430

James Joyce wrote:
> Hey everyone,
>
> This is a continuation of my UART issues. When I look at the clock output of the
> MSP430F1611 after I set it to 4Mhz using a 32kHz crystal I see a very large
> jitter. In fact, the signal looks like a square wave and at the same time there
> are "shifter versions" of it around what would be the 4Mhz signal.
>
Yes, this is perfectly normal. It is the modulator of the DCO doing its
work.
> My oscilloscope measures the frequencies to be between 3.85MHz and 4.15MHz. That
> is, constantly the frequency of the DCO is shifting between those values and I
> would assume between them too. Is this any way normal? I would expect some
> jitter but not that much. Am I going to be forced to use a HF crystal?
>

It should not be an issue with the UART. This error is very small
compared to the baud rate. You would have a hard time seeing it on the
bit stream. The errors from the uart modulator are much greater. The
only way to measure the frequency accurately is by using a freq meter
with a decent timebase.

I've used 9600 with the ACLK and 115200 with a 2mhz DCO without a
problem, among several other baud rates.

This is two sets of data superimposed to create the 'fuzz' streamed from
a 1611 at 115200 baud using the DCO. There is not a byte out of place.
And I have very long record sets of this stuff and never noticed a glitch.



And no matter what you base your uart on, if you have critical data you
will want to use checksums, handshaking, retries on fail, as anything
can cause a bad bit. Even if you use a crystal that divides down so as
to eliminate the uart modulator.

If you can't make your uart stable, I'd take a fresh look.

Best, Dan.

Dan and everyone,

Thanks for the help. I've seemed to have fixed my problem. It was on the PC
side. I should have verified earlier that my custom serial software was working.
It appears there was a bug and although I'm still tracking it down, I've fixed
it.
It seems the communications are quite reliable and you're right Dan, the
supposed error is rather small about ~3% or so.

I am still left wondering about the DCO's behavior but I guess that's just the
way it is.

Thanks a lot.

________________________________
From: Dan Bloomquist
To: m...
Sent: Tue, August 17, 2010 9:33:40 PM
Subject: Re: [msp430] DCO Jitter and Effects on UART

James Joyce wrote:
> Hey everyone,
>
> This is a continuation of my UART issues. When I look at the clock output of
>the
> MSP430F1611 after I set it to 4Mhz using a 32kHz crystal I see a very large
> jitter. In fact, the signal looks like a square wave and at the same time
there
> are "shifter versions" of it around what would be the 4Mhz signal.
>
Yes, this is perfectly normal. It is the modulator of the DCO doing its
work.
> My oscilloscope measures the frequencies to be between 3.85MHz and 4.15MHz.
>That
> is, constantly the frequency of the DCO is shifting between those values and I
> would assume between them too. Is this any way normal? I would expect some
> jitter but not that much. Am I going to be forced to use a HF crystal?
>

It should not be an issue with the UART. This error is very small
compared to the baud rate. You would have a hard time seeing it on the
bit stream. The errors from the uart modulator are much greater. The
only way to measure the frequency accurately is by using a freq meter
with a decent timebase.

I've used 9600 with the ACLK and 115200 with a 2mhz DCO without a
problem, among several other baud rates.

This is two sets of data superimposed to create the 'fuzz' streamed from
a 1611 at 115200 baud using the DCO. There is not a byte out of place.
And I have very long record sets of this stuff and never noticed a glitch.



And no matter what you base your uart on, if you have critical data you
will want to use checksums, handshaking, retries on fail, as anything
can cause a bad bit. Even if you use a crystal that divides down so as
to eliminate the uart modulator.

If you can't make your uart stable, I'd take a fresh look.

Best, Dan.



James Joyce wrote:
> Dan and everyone,
>
> Thanks for the help. I've seemed to have fixed my problem. It was on the PC
> side. I should have verified earlier that my custom serial software was working.
> It appears there was a bug and although I'm still tracking it down, I've fixed
> it.
> It seems the communications are quite reliable and you're right Dan, the
> supposed error is rather small about ~3% or so.
>

Hi James,
Glad you could work this out. I'm 60, so you can imagine how many times
I've been there. :)

> I am still left wondering about the DCO's behavior but I guess that's just the
> way it is.
>
>
Yes, and as long as you don't need the accuracy at more than some 2-3
times a magnitude of the DCO^-1, phase locking to the watch crystal
should be good enough. This is usually the case with the uart. Trim the
watch crystal and you have a second a month as I understand it. As the
MCLK just usually drives the processor, who cares! In the longer run,
the frequency is very stable. In the very longer run you simply use the
ACLK for accuracy. Yea, I can see the MCLK used for high end data ack,
and you have to use a fast crystal. But if you are not acquiring along
with higher end hardware, I don't see the justification.

Best, Dan.