This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
HI,
I am trying to set the DCO calibration values to get the frequency of 16MHZ. I am using the inbuilt library constants to set the register values for me. I get some tolerance and my SMCLK operates at 15.80MHz instead of 16.
Need a way to accurately configure the clock to run at 16MHz frequency.
Hi Vikram,
How close to 16MHz do you need to be? Those internal calibration constants are for around room temperature, and will only get you to +/- 0.5% Typical or +/-3% max from 0 to 85C.
If you are getting 15.80MHz with the internal calibration values that is likely as close as you'll get with those. If you are using or have access to an external 32KHz crystal, you could try to calibrate your 16MHz DCO based on that instead.
There is an example in MSP430Ware for calibrating your DCO in this way which you can try. Look at msp430g2xx3_dco_flashcal.c.
Be aware that this example overwrites the preloaded constant values.
Best Regards,
Brandon Fisher
Hi Brandon,
Thanks for the quick response.
I do not have an option to connect the external crystal to calibrate the DCO. However even if I do this for one device and get the calibrated register values, how about rest of my other devices? should this calibration be done for all the devices?
Also, i am unable to lock the DCO to even 1MHz on my TI MSP430 Launchpad Dev kit. I am using the default calibrated constant values from the library. Am I missing something. is there a way to configure the DCO to get the stable frequency.
Thanks,
Vikram
What kind of accuracy do you need? As Brandon pointed out, the DCO is not all that accurate. You are pretty close to .1%
Is there a way i can set the clock to 16MHz using DCO?
My second question is, if I add the offset based on the current calibrated values in the firmware, will this be same for all the products / devices that contain MSP430G2553? or the calibration tends to change from product to product.
Again, how close does it need to be? For most of my purposes, 15.8 *is* 16, or at least close enough.
Hi Vikram,
There is no guarantee that other devices will match the calibration values you find/set on your current device, in fact you can be almost sure they won't.
Calibrating every DCO to be as close as possible to 16MHz would need to be done device-by-device.
Best Regards,
Brandon
**Attention** This is a public forum