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.

MSP432E401Y: How to Configure ADC Clock to 32 MHZ

Part Number: MSP432E401Y
Other Parts Discussed in Thread: MSP-EXP432E401Y, SYSBIOS

SUMMARY OF THE ISSUE

I need to perform as many analog to digital conversions per second as possible.  My understanding is that there are 2 ADC modules and each is capable of collecting 2 MSPS by setting the ADCCLK to 32 MHz.  The default configuration appears to run the PLL at 240 MHz, SYSCLK at 120 MHz, and the ADCLK off the PIOSC at 16 MHz.  With the PLL at 240 MHz, there is no ADC_CC<CLKDIV> setting to achieve 32 MHz in support of the 2 MSPS per module maximum collection rate (CLKDIV 8 achieves 30 MHz and CLKDIV 7 is about 34 MHz which exceeds the 32 MHz limit).

I want to set the PLL to 480 MHz, divide it down by 4 to get the 120 MHz SYSCLK and divide it down by 15 to get the 32 MHz ADCCLK.  However, the Boot_sysCtlClockFreqSetI function in Boot_sysctl.c appears to have an error. The values are off by a factor of two.  Investigation revealed that there was a Silicon Errata SYSCTL#22 for a similar product, TM4C129x (SPMZ850G-October 2013 - Revised March 2017).  The errata documents a problem with the RSCLKCFG<PSYSDIV> hardware and fudging these values in the software was part of the workaround (Appendix 3).  There is no such errata in the MSP43E errata document (SLAZ709-October 2017).

Finally, the Technical Reference says several times that PSYSDIV must always be set to 0x1 (resulting in a divide by two).  I need to set it to 0x3 resulting in a divide by 4.

QUESTIONS

Does the MSP432Y have the same silicon defect in its RSCLKCFG<PSYSDIV> hardware?

Should the workaround for the TM4C129x defect be removed from the MSP432Y TIRTOS?

Can I use N=0x4, Q=0x0, and PSYSDIV=0x3 to get 480 MHz PLL and 120 MHz SYSCLK?

ADDITIONAL INFORMATION

I am developing on the MSP-EXP432E401Y Launch Pad prototyping board.  My IDE is Code Composer Studio Version: 9.0.1.00004.  I use TIRTOS 3_20_00_10.

I have a 25 MHz crystal connected to the OSC0 OSC1 pins.

Examining registers in a debugger run, I see:

PLLFREQ0<PWR>=0x1

PLLFREQ0<MFRAC>=0x0

PLLFREQ0<MINT>=0x60  (96 decimal)

PLLFREQ1<Q>=0x1

PLLFREQ1<N>=0x4

PLLSTAT<LOCK>=0x1

RSCLKCFG<USEPLL>=0X1

RSCLKCFG<PLLSRC>=0x3 (MOSC)

RSCLKCFG<PSYSDIV>=0x1

According to the equations in section 4.1.5.5.1, PLL Configuration, of the Technical Reference Manual, this results in a PLL VCO frequency of 240 MHz and SYSCLK frequency of 120 MHz.  By default the ADCCLK appears to be running off the PIOSC at 16 MHz.

I then modified Boot_sysctl.c to jam set PLLFREQ1<Q>=0x0 and RSCLKCFG<PSYSDIV>=0x3 just before powering on the PLL hoping this will result in a PLL VCO frequency of 480 MHz and SYSCLK frequency of 120 MHz.  I have also set ADC_CC<CS>=0x0 (PLL VCO) and ADC_CC<CLKDIV>=0xE (14 decimal) to hopefully achieve an ADCCLK frequency of 32 MHz.

I have three sysctl.c files in my installation.  The driverlib and sysbios files use 240000000 for the 480 MHz frequency.   I assume driverlib is for the application to use and modify - I do not use it.  When I run, the system is using the sysbios file.

C:\ti\simplelink_msp432e4_sdk_3_20_00_10\source\ti\devices\msp432e4\driverlib\sysctl.c

C:\ti\simplelink_msp432e4_sdk_3_20_00_10\kernel\tirtos\packages\ti\sysbios\family\arm\msp432e4\init\Boot_sysctl.c

//*****************************************************************************
//
// Look up of the possible VCO frequencies.
//
//*****************************************************************************
static const uint32_t g_pui32VCOFrequencies[MAX_VCO_ENTRIES] =
{
    160000000,                              // VCO 320
    240000000,                              // VCO 480
};

The catalog file uses 480000000 for the 480 MHz frequency.  I have no idea what a catalog is.  I don't think this is being used by TIRTOS or my application.

C:\ti\simplelink_msp432e4_sdk_3_20_00_10\kernel\tirtos\packages\ti\catalog\arm\cortexm4\tiva\ce\Boot_sysctl.c

//*****************************************************************************
//
// Look up of the possible VCO frequencies.
//
//*****************************************************************************
static const uint32_t g_pui32VCOFrequencies[MAX_VCO_ENTRIES] =
{
    320000000,                              // VCO 320
    480000000,                              // VCO 480
};

  • Hi 

    Please follow the instructions below

  • As I indicated, I have set ADCCC<CS> to 0x0 and ADCCC<CLKDIV>=0xE (14 decimal).  I have done further runs since my initial post and have seen that the SYSCLK is responding to various settings of PSYSDIV.  As PSYSDIV increases, the run time increases proportionally. So I have convinced myself that I can use PSYSDIV values other than 0x1.  However, my original questions remain unanswered:

    Does the MSP432Y have the same silicon defect in its RSCLKCFG<PSYSDIV> hardware?

    Should the workaround for the TM4C129x defect be removed from the MSP432Y TIRTOS?

    Can I use N=0x4, Q=0x0, and PSYSDIV=0x3 to get 480 MHz PLL and 120 MHz SYSCLK?

  • I think you can configure the PLL VCO to 320MHz and use CLKDIV to be 10 that you can get 32MHz for ADC.

  • Probably, but then I won't be able to divide the PLL VCO to get a 120 MHz SYSCLOCK.

    Anyway, that is not my question.  Unless anyone can provide better information, I am going to answer my own questions...

    Does the MSP432Y have the same silicon defect in its RSCLKCFG<PSYSDIV> hardware? 

    The MSP432 does not seem to have the same hardware issue.  I can alter PSYSDIV and it affects the CPU throughput.

    Should the workaround for the TM4C129x defect be removed from the MSP432Y TIRTOS?

    Probably, but I wrote some application layer software to set the registers the way I need them after they are setup incorrectly by the RTOS.

    Can I use N=0x4, Q=0x0, and PSYSDIV=0x3 to get 480 MHz PLL and 120 MHz SYSCLK?

    I was able to set these values in the application layer and am fairly certain I have the ADC clock at 32 MHz and a SYSCLOCK at 120 Mhz.

  • What's the clock source do you use? External crystal? And what's frequency it is?

  • I have a 25 MHz crystal connected to the OSC0 OSC1 pins and selected it with RSCLKCFG<PLLSRC>=0x3 (MOSC).

  • Have you try this configuration set MINT = 0x40 N=4 and PSYSDIV=0xa?

  • Assuming you mean with Q=0, the PLL VCO would be 320 MHz, but the SYCLK would only be 32 MHz.  I am trying to get the ADCCLOCK to 32 MHz without slowing the CPU down.