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.

TM4C1294NCPDT: Tiva, external clock -> ADC usage?

Part Number: TM4C1294NCPDT


Hi,

I am currently using a TM4C1294NCPDT with the TI RTOS with an external clock of 40 MHz. According to TivaWare™ Peripheral Driver Library the parameters for the ADCClock has to be configured as:

Regardless of the source, the final frequency for TM4C123x devices must
be 16 MHz and for TM4C129x parts after dividing must be between 16 and 32 MHz.

As the data type of the dividing part in

ADCClockConfigSet(ADC0_BASE, ADC_CLOCK_SRC_ALTCLK | ADC_CLOCK_RATE_EIGHTH, 2.5); // 2.5 wont work as it has to be whole-numbered

is a whole-numbered one, how can I achieve getting the ADC conversion to run?

  • Appendix: i forgot to mention, that I tried to use tie PIOSC as ADC clock source. Following the documentation of the processor, it mentions in 15.3.2.7 (ADC -> Functional Description -> Module Control -> Module Clocking):

    > To use the PIOSC to clock the ADC, first power up the PLL and then enable the PIOSC in the CS bit field in the ADCCC register, then disable the PLL.

    As I bypass the PLL due to my external clock, I cannot activate the PLL.
  • Narf.

    I overread that you can enable the PLL a for the PIOSC:

    > The PLL can be driven by two sources only    Precision Internal Oscillator (PIOSC) / Main Oscillator (MOSC)

    This line solves it:

        SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480, 16000000);

    Thanks ;-)

  • Hello Volker

    In which case you need to update the ADCClockConfigSet API to use System Clock Source and also the API does not take fractional values like "2.5"
  • Hi,

    I am aware of the fact that the clock does not take any fractional values as its datatype is a unsigned int. My question was about the needed 16 MHz for the adc convertion which can easily be achieved with the Piosc. When putting the question here I misread that possibility, as my mosc is a 40MHz external clock.

  • Hello Volker

    The crystal max frequency is 25MHz for the TM4C devices. So why would you be providing a 40MHz MOSC clock?