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.

Configuration of the ADC clock on 28069?

Other Parts Discussed in Thread: TMS320F28069, CONTROLSUITE

Hello,

I am using a TMS320F28069 and I have a question about the clock definition of the ADC and the other peripherals.

I am using the example F2806x ADC Start-Of-Conversion (SOC) Example Program

From the code it seams to be using the internal oscillator to run at 80MHz.

And the configuration of the ADC clock, its with the next code, is it correct?

SysCtrlRegs.LOSPCP.all = 0x0002;

SysCtrlRegs.XCLK.bit.XCLKOUTDIV=2;

Will this make the ADC clock run at 40MHz?

 

Cheers,

Filipe Teixeira

  • Hello Filipe.

    SysCtrlRegs.LOSPCP.all = 0x0002; set the clock of SPI(A/B) and SCI(A/B) to run at 80MHz/4 = 20MHz.

    SysCtrlRegs.XCLK.bit.XCLKOUTDIV=2; set the clock of ADC to 80MHz/2 = 40MHz.

    The maximum adc clock is 40MHz. The adc requires 13 clock cycles to convert = 325ns.

    See SPRS698A–NOVEMBER 2010–REVISED JANUARY 2011 page 46/48.

     

  • Hello Mauro,

    Thanks for your reply, but to configure the ADC, the registers are not the one you said.

    In the F28069 you have registers:

     

    EALLOW;

        AdcRegs.ADCCTL2.bit.CLKDIV2EN = 1;

        AdcRegs.ADCCTL2.bit.CLKDIV4EN = 1;

    EDIS;

    If you look in the file SPRS698A–NOVEMBER 2010–REVISED JANUARY 2011 page 46/48, you can see that the divider you mention is not used in the ADC module. The ADC module is supplied with the SYSCLKOUT.

     

    Best regards,

    Filipe Teixeira

  • Filipe,

    register LOSPCP is not related to the ADC.  To setup the ADC of the 28069 to run at 40 MHz, all you have to do is to set AdcRegs.ADCCTRL2.bit.CLKDIV2EN = 1. This command will half the frequency of SYSCLKOUT. Please inspect function "InitAdc()" in file "F2806x_ADC.c", which can be found in Controlsuite / device_support.

     

     

  • Thanks for the reply.

    You can see from my previous post, that I already use that register. There is also the register CLKDIV4EN that allows to divide the clock by 4.

    In the example "InitAdc()" you said, I think there is an error. The register CLKDI2EN is EALLOW protected, and in the example the access is not using the EALLOW macro, so it will not configure the clock correctly (the ADC will be using the 80MHz clock)...

     

    Best Regards,

    Filipe Teixeira

  • Filipe-

        As you have determined there is a bug in the example file which will be fixed in the next release.

    Thank you,

    Joe