Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:56 20 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Crystal Oscilator for Micromite

Author Message
kg4pid
Regular Member

Joined: 08/03/2015
Location: United States
Posts: 50
Posted: 03:43pm 17 Sep 2017
Copy link to clipboard 
Print this post

I was searching through the user manual and can't seem to find a way to use a crystal oscilator with the micromite. I hope I have just overlooked this. My application is a weather station where it will have to operate from about -17C to 38C. While the built in oscilator may be good, I have my doubts that it would be good enough to not affect some of the readings as well as maintain the correct baud rate for serial communications. So I hope I have just overlooked this but can't find it. This would be for the 28 pin Micromite.

Thanks, MaxEdited by kg4pid 2017-09-19
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 04:14pm 17 Sep 2017
Copy link to clipboard 
Print this post

The 28 pin micromites don't have any option for a crystal.
I am not sure if anyone has used them at -17 degrees. 38 degrees would not be a problem at the top end.

You could use CLOCKTRIM to adjust the clock based on temperature. A few years ago I did a frequency vs temperature test. If my tests are any indication, the low temperatures would be OK. You need to put a micromite into the freezer to test it.


http://www.thebackshed.com/forum/forum_posts.asp?TID=7087&KW=frequency+stability

I also wrote a Windows program to make playing with CLOCKTRIM easier.

http://www.thebackshed.com/forum/forum_posts.asp?TID=8294&KW=timelord

JimEdited by TassyJim 2017-09-19
VK7JH
MMedit   MMBasic Help
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 09:07pm 17 Sep 2017
Copy link to clipboard 
Print this post

Hi Max,

The MicroChip data-sheet implies a -40'C to +85'C operating range. You may need a certain 'suffix' on the part number but I could not see this in a quick look at the data sheet.

I have a customer that successfully uses the 44pin MicroMite in lower temperatures than what you mention.

Can I simply suggest you try a 'freezer' test and try it at around -30'C (assuming you have control of your freezer temperature).

Do let us know if this is a test you're able to carry out; and if so, what the outcome is

WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 09:17pm 17 Sep 2017
Copy link to clipboard 
Print this post

  kg4pid said   I was searching through the user manual and can't seem to find a way to use a crystal oscilator with the micromite. I hope I have just overlooked this. My application is a weather station where it will have to operate from about -17C to 38C. While the built in oscilator may be good, I have my doubts that it would be good enough to not affect some of the readings as well as maintain the correct baud rate for serial communications. So I hope I have just overlooked this but can't find it. This would be for the 28 pin Micromite.

Thanks, Max


What I've done with my weather station is used the clocktrim command to get the clock as accurate as possible but I've also used a gps module as well and this sets the clock to the correct time every 6 hours.
 
kg4pid
Regular Member

Joined: 08/03/2015
Location: United States
Posts: 50
Posted: 03:40am 18 Sep 2017
Copy link to clipboard 
Print this post

Is there not a way to write to the registers to change it so that it would use a crystal? It's not the chip itself I'm worried about temperature wise, it's the onboard oscilator. My experence with the smaller 8 bit microchip processors has been to use a crystal or resonator when the temperature had a large swing like this.

CLOCKTRIM still won't help as it would still change frequency as the temps change.

I can't test anything yet as I am still waiting on parts.

Max
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 07:24am 18 Sep 2017
Copy link to clipboard 
Print this post

  Quote  Is there not a way to write to the registers to change it so that it would use a crystal?


No you need to re-compile as follows:

Install MPLabX and XC32 V1.33 from Microchip.com

Download the firmware from mmbasic.com it is easy to re-compile it to use a crystal. Just change the value of POSCMOD to XT and FNOSC to PRIPLL in Configuration_Bits.h and set pins 9 and 10 to { NULL, 0, UNUSED }, in IOPorts.h. You won't then be able to use these pins for anything other than the 8MHz crystal so no COM2

You will need a pro compiler licence to build the new image but you can get a 1 month temporary pro licence when you install the compiler for the first time.

Make sure you comply with the requirements of Geoff's licence for mmbasic (don't distribute the image, personal use only without his further agreement, etc.)

You MUST use v1.33 of the compiler

I've done this successfully in the past.Edited by matherp 2017-09-19
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1099
Posted: 04:27pm 18 Sep 2017
Copy link to clipboard 
Print this post

@kg4pid

As far as I can make out from the spec sheet (Fig.32-6 on physical page 309), the drift in FRC (Free Running Clock) of the 170 is somewhere around 0.375% for a 40C to -30C temperature swing.

Running some tests at 9600 baud receiving gave me good data from 9170 through 10070 baud transmitted data, again which equates to about 5%. This was for a 40 character string with a pause of 200mS between transmits. Long strings should progressively reduce the range but I haven't tested that.

Based on this, I feel that the temperature shift you envisage should not impede good comms.

The tests I ran were from a 470 to a 470 but should be valid for 170's.

Hope this helps,
panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
kg4pid
Regular Member

Joined: 08/03/2015
Location: United States
Posts: 50
Posted: 03:54am 19 Sep 2017
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Is there not a way to write to the registers to change it so that it would use a crystal?


No you need to re-compile as follows:

Install MPLabX and XC32 V1.33 from Microchip.com

Download the firmware from mmbasic.com it is easy to re-compile it to use a crystal. Just change the value of POSCMOD to XT and FNOSC to PRIPLL in Configuration_Bits.h and set pins 9 and 10 to { NULL, 0, UNUSED }, in IOPorts.h. You won't then be able to use these pins for anything other than the 8MHz crystal so no COM2

You will need a pro compiler licence to build the new image but you can get a 1 month temporary pro licence when you install the compiler for the first time.

Make sure you comply with the requirements of Geoff's licence for mmbasic (don't distribute the image, personal use only without his further agreement, etc.)

You MUST use v1.33 of the compiler

I've done this successfully in the past.


This is probly the only way to actually FIX the problem. But for other reasons which I can't go into right now, this won't be an option for me at this time. But thanks anyways, it's good to know that it can be done.
 
kg4pid
Regular Member

Joined: 08/03/2015
Location: United States
Posts: 50
Posted: 03:55am 19 Sep 2017
Copy link to clipboard 
Print this post

  panky said   @kg4pid

As far as I can make out from the spec sheet (Fig.32-6 on physical page 309), the drift in FRC (Free Running Clock) of the 170 is somewhere around 0.375% for a 40C to -30C temperature swing.

Running some tests at 9600 baud receiving gave me good data from 9170 through 10070 baud transmitted data, again which equates to about 5%. This was for a 40 character string with a pause of 200mS between transmits. Long strings should progressively reduce the range but I haven't tested that.

Based on this, I feel that the temperature shift you envisage should not impede good comms.

The tests I ran were from a 470 to a 470 but should be valid for 170's.

Hope this helps,
panky


That info is good to know. We'll see how well the recieving end tolerates such a swing. Edited by kg4pid 2017-09-20
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 05:11am 19 Sep 2017
Copy link to clipboard 
Print this post

Have a look at this thread
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 07:12pm 19 Sep 2017
Copy link to clipboard 
Print this post

another option is outlined here:
http://www.thebackshed.com/forum/forum_posts.asp?TID=9295

this uses a CD4060 to divide a 32.768kHz watch crystal down to 2Hz, then an interrupt to check the micromite's drift and adjust the clocktrim setting to compensate.

one advantage over having a crystal running the micromite directly is that only one pin is used. the down side is that you have an extra IC involved.


cheers,
rob :-)
 
kg4pid
Regular Member

Joined: 08/03/2015
Location: United States
Posts: 50
Posted: 04:59am 20 Sep 2017
Copy link to clipboard 
Print this post

  matherp said   Have a look at this thread


I just read through that thread and I see what they are doing. And I may have to do something simular. But this is still fixing a hardware problem, with software. Since I've always been a hardware type person, I usually add hardware to make writing software easier.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024