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.

TM4C123GH6PM: Changing system clock and ADC clock source to external crystal source, MOSC

Part Number: TM4C123GH6PM

I read with interest this post as I have been trying to change clock frequencies in order to save power. Firstly it appears that errata ADC #08 says that MOSC can not be used for both the ADC and system clock. However, we have been successfully using this configuration for years. The errata ADC#08 also mentions a third workaround of using the PLL power down bit, however, it suggests using HWREG(0x400fe060)!=0x00000200. This appears to be using a exclamation mark instead of a |. This is clearly wrong. I assume it was intended that the PWNDN bit of the RCC register was going to be set to 1, but the wrong bit is being set, so I think it should be HWREG(0x400fe060)|=0x00002000.

I have a program that can start with both the ADC and system clock working off the MOSC. I can then change the the clock source for the ADC and system clock to be from the PLL and the ADC still works. However, when I try to change back to using the MOSC for the ADC and system clock the ADC does stop functioning. Do you think there is a way around this, what could I be missing?

  • Thank you for pointing this out. I agree that HWREG(0x400fe060)!=0x00000200 is definitely wrong. The "!" needs to be "|". I also suspect you are correct about it setting the wrong bit. However, I think it should be setting the bypass bit as that it the bit that will disable the PLL.

     

       HWREG(0x400fe060)|=0x00000800

    Let me check this with my colleagues.

  • One bit of information I left out was that although I am using the MOSC for both the system clock and ADC the ADC is only sampling at 500KSPS. We have found that trying higher sampling frequencies causes sampling to not work correctly. Could this be related to the ADC sequencer problem?

  • It could very well be related to advisory AADC#08. However, at lower sampling rates the problem may still occur, but much less often.