CPU Clock Speed

Hi,

How do i chage the clock speed for the CPU?

I assume the default setting is 16Mhz?

I am looking to set it to 2Mhz

Any ideas?

I have the MPS430 - F2013

Xplosiv

The default clock rate is 0.8 to 1.5 MHz. If you want to change that, you should change the settings of BCSCTL1 and DCOCTL registers.

The default value of BCSCTL1 is 0x87. The least significant 4 bits (called RSELx) are the coarse adjustment. The smaller the RSELx, the lower the frequency. The default value of DCOCTL is 0x60. All 8 bits are the fine adjustment. The smaller the DCOCTL, the lower the frequency.

Inside the InfoA Flash, TI provided 4 sets of proper settings for BCSCTL1 and DCOCTL for 4 different frequencies: 1, 6, 8, and 16 MHz. They are called Calibration Values and are applicable to that chip only. (Since they are in Flash, they can be erased or altered. I advise you to inspect them and copy them down so that in case you erased or altered them, you can restore them.) If you want to use one of those frequencies, your code can copy them into BCSCTL1 and DCOCTL registers.