Jump to content
43oh

any way to restore DCO calibration values w/o a crystal hooked up?


Recommended Posts

There's an example in the codevault on restoring the DCO calibration data, but it seems to require that the external crystal be hooked up.

 

I have a semi-bricked surface mount MSP430...the calibration values are apparently 0xff, so it goes into the fault routine immediately on startup...

 

Link to post
Share on other sites

Most code examples use a start block including disabling the WDT and then loading the DCO values. However, without DCO values, your clock should go to a base value (RSEL=7, DCO=3). This base value is very inaccurate, but enables you to load code and reconfigure the DCO calibartion values. To actually calibrate, you must use a reference. The external crystal is a much used reference. Since you overwritten the DCO calibration values, you cannot restore them, you can only recalibrate.

Link to post
Share on other sites

 

That's a nice way to calibrate without needing external components (other than a PC, which you kind of need anyway :))

 

I was going to suggest a rather more hands-on approach.

 

1) Write a program to toggle the red LED every second and the green one every minute (assuming a DCO frequency of 1MHz)

2) Start the program, and compare the blink rate with a stopwatch

3) Tweak the DCO settings up or down as appropriate to get the green LED flash frequency to match the minutes on the stopwatch.

4) Write down the DCO settings that produce the desired frequency

5) Repeat for 8, 12 and 16MHz

6) Write another program to flash the various calibration values to the information memory

 

Simple! ;)

Link to post
Share on other sites

Thanks.  Decided to just desolder the part and swap a new one in.

 

I think it got corrupted when I tried to program it w/ the standard 2.2nf capacitor...got an error about not being able to write block zero, but I think it did in some corrupted way that took out the DCO calibration values.  I swapped the cap w/ a 1nf one and it downloads code cleanly now but the DCO is broken :-P

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...