Tool/software:
Hi all,
I apologize if this has been covered in a different question, please link it if so. I have searched to the best of my ability and cannot come up with an answer that seems to work.
Problem: Setting DCOCLK to anything other than 1MHz has proved to be impossible and I cannot figure out why.
Attempted implementation:
DCOCTL = 0; // Select lowest DCOx and MODx settings BCSCTL2 = 0; BCSCTL1 = CALBC1_8MHZ; DCOCTL = CALDCO_8MHZ; // Load 8MHz constants
For my project, I would like to use 8MHz DCO since I would like to use PWM frequencies up to 100KHz for my application.
It seems as though the above is not working as intended. When using a Timer with CCR0 set to 100, I get a frequency of 200kHz, which makes no sense. See below:
I've found some information via this forum that has alluded me to the fact that InfoA is getting erased when I do a flash via BSL (BSLDEMO.exe). I could not sort out how to fix that, so I went back to using CCS and JTAG programming.
I started off by flashing MSP430x261x_dco_flashcal.c which is found under the examples (I just searched "DCO) to reinstate the correct values that should exist in InfoA that "msp430f2617.h" references. Maybe I am understanding incorrectly but I believe that the header file pulls the information for macros such as "CALDCO_8MHZ" and "CALBC1_8MHZ" from InfoA. After reflashing my own project following the "dco_flashcal", it seems as though my issue has not been solved and I still get a 200kHz PWM frequency after using the code above.
Via another thread, I found that setting DCOTL and BCSCTL1 to 0x8d seems to get the values accurate to what they should be, if the data in InfoA was correct. I tried this and it seemed to actually work, but I do not quite understand why it does not work by default using the header file as intended.
The problem, to me, seems like the DCOCTL and/or BCSCTL1 is not being properly configured.
Does anyone have any insight into this? I'm not sure I should be manually setting these values as opposed to using the correct values intended by the header file / InfoA.
Thanks for your time.