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.

setting system clock locked my launchpad

Hi

I was experimenting with the RCC register and I wanted to set system clock to 16MHz using the external clock.

here is my code

 SYSCTL->RCC &= 0xF02FF80F;
 SYSCTL->RCC |= 0x080E2D41;
 SYSCTL->RCC |= 0xFFFFFFFE;
 
 while((SYSCTL->RIS & 0x00000100) != 0x00000100)
 {
  //wait until frequency is stable
 }
 SYSCTL->MISC |= 0x00000100;

I called this function in the beginning of main and then afterwards, every single time I program my Launchpad, I get an error and it would not program. I could not figure out what I did wrong. Please help

Thanks

AJ

  • ah I think I found out my mistake.. the statement before while loop was suppose to be &=

    but is there a way I could still "unlock" my launchpad
  • Hello AJ

    It is advisable to use the SysCtlClockSet API to set the system clock. It works and its proven. Unlock sequence is as described in the following document.

    www.ti.com/.../spma075.pdf
  • Amit Ashara said:
    It is advisable to use the SysCtlClockSet API to set the system clock.

    And - it is equally (perhaps even more advisable) to AVOID use of DRM coding as it (completely lacks) the, "Tried, True, Long Tested/Proven" capabilities of the complex and extensive API.

    Using DRM most always results in user, "Crash/Burn" and almost never can such victims (justify) their use.   DRM places far higher demands upon vendor "help staff" and also upon "outsiders" who seek to help but are (quite properly) unwilling to wade thru page after page of Register Specs...

  • Thanks a lot Amit. The unlocking worked.

    Thanks for your input cb1.

    Regards,
    AJ