internal oscillator stability and UART

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
picdog
Posts: 390
Joined: 28 Feb 2006 09:32

internal oscillator stability and UART

#1 Post by picdog » 28 Jan 2008 09:10

Hello dear forum developers,
just to post a question that I had also put on mikroC PIC forum.

I have 2 dsPIC (or PIC) and they are talking each other via UART. They exchange some data (hundreds bytes) every few minutes. Data rate is in the range 9600 / 38400 baud. Due to space and other constraints I don't have a XT/HS oscillator but I have to use FRC and/or FRC with PLL (Fclock is 8 MHz - 32 MHz for PIC and 7.37 MHz - 80 MHz for dsPIC33).

Obvioulsy there is a problem with the stability of the internal oscillator that can create problems with the UART subsystem; the 2 devices are exposed to a wide range of temperature as they are outside (so the temperatures might be -10 °C to 45 °C). The devices are in the same place (they are quite near and they are in the same box), but in certain situations the temperatures will be different (because it is like a data-logger, one board is in front of a box and the other is inside, so the sun might warm up one board whilst the other being cooler).

I would to know if someone read (or did himself) some real experimentation in this way, e.g. measured the short-term or long-term stability of the oscillator and how much this might compromise the UART protocol (2%? 3%?)

I did some tests with the 2 devices continuously speaking a some LEDs to see directly if the data are correct, and putting one in a fridge (-20 °C) while the other at room temperature, and many similar cycles, even the second at 50 °C and then exchanging them, and at these baudrates I didn't had problems.

Did someone some experience in this field?

Thank you in advance,

picdog
... a proud user of MikroElektronica EasyPic3, EasyPic4, BigPic4, MikroC for PIC, EasydsPIC2, dsPIC-Pro2, LV24-33 and MikroC for dsPIC :)

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: internal oscillator stability and UART

#2 Post by zristic » 28 Jan 2008 10:05

This is a common problem in telecommunications. This is the reason why Manchester encoding is used, since it carries information about the clock.

picdog
Posts: 390
Joined: 28 Feb 2006 09:32

#3 Post by picdog » 28 Jan 2008 10:11

Sure Zoran, I know, but in this particular case I have only a pin to exchange data, in only one way and UART is the simpler solution; I can try to use Manchester coding, thank you for the advice, but I was curious to know about some experience in UART stability for these no-XTAL applications.
Thank you very much, picdog
... a proud user of MikroElektronica EasyPic3, EasyPic4, BigPic4, MikroC for PIC, EasydsPIC2, dsPIC-Pro2, LV24-33 and MikroC for dsPIC :)

nelson_mendes
Posts: 66
Joined: 01 Feb 2008 15:48
Location: Porto, Portugal

#4 Post by nelson_mendes » 23 Aug 2008 17:11

Hello,

Unfortunately, I cannot help since I'm just starting now with dsPIC...

However, I have a problem that is a bit like yours.
I'm am using a dsPIC30F6015 on some sort of a development board, made by myself, while my workgroup still didn't bought the dsPICPRO4.

It's on the following picture:

Image

I did the first test with the board, the led blinking one, with the internal oscillator and with the PLL @ 16X.
I worked fine but I noted some overheating in the dsPIC and in the LM7805 (I putted an heatsink after it burned my fingers), which I don't know if it's normal to occur.
I turned OFF the PLL, all worked fine and in a very much cooler way.

Then I tried to test the "soft_uart" example used on the dsPICPRO3, but I didn't wanted to use any crystal because the electronics store is closed... :(

Same procedure, internal oscillator, PLL @ 16X and the first test was with baudrate @ 9600 bps. I connected my USB to RS232 level converter to Port1 and anything happened. No data was returned.

I took the necessary precautions on the program in order to use that kind of frequency, but I have no idea in particular why it didn't worked?

Can't I use that baudrate with that clock frequency??
Is the internal oscillator so affected by temperature that uart can't work?

I need to perform this test on both uarts with the following baudrates: 9600, 38400 and 115200 bps.

I'm hopping to use a 7.5MHz crystal with the PLL @ 16X to perform several tests in the project where I'm involved @ those baudrates.
Is that crystal suited for this purpose? (achieving 120MHZ and still being able to use the UART)


I thank the forum people for the attention and I'll look forward to a reply, in case anyone knows what going on.


Best regards,

Nelson Fernandes

mehranm
Posts: 1
Joined: 23 Aug 2010 04:58

Re: internal oscillator stability and UART

#5 Post by mehranm » 23 Aug 2010 05:05

I am having some problems with internal FRC clock running at 40MHz and internal PLL (dsPIC33FJ12GP201).
I measure phase noise in oscillators and I can see instability of the pic clock between 1kHz and 100kHz as pic temp goes below 15 deg C.
Trying to find a solution for it as well!

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: internal oscillator stability and UART

#6 Post by tihomir.losic » 23 Aug 2010 15:34

Hello,

please, create Support ticket on:
http://www.mikroe.com/esupport
and send us smallest possible project from I'll be able to reproduce your issue.

Thanks.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”