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.

MSPM0G3507: Timer Clock Setup

Part Number: MSPM0G3507
Other Parts Discussed in Thread: , SYSCONFIG

Tool/software:

I always have a devil of a time getting my clock setup to use a crystal...

I have the LP-MSPM0G3507 launchpad with a 40 MHz crystal.

Anyway, while using the sysctl_hfxt_run_LP_MSPM0G3507_nortos_ticlang example, there is a timer that toggles the LED at 0.5s.

In the sysconfig timer clock configuration it says:

Timer Clock Source: BUSCLK

Timer Clock Divider: 4

Calculated TImer Clock Source: 5 MHz.

This implies a BUSCLK of 20 MHz.

Yet I am getting the 10 MHz from CLKOUT that implies that it is getting the 40MHz / 4.

Where is the 20 MHz coming from?

  • Hi Keith,

    Can you elaborate on which timer you are using, and what clock settings you are using?

    Looking at the default example with no changes, the BUSCLK for the timer is ULPCLK. According to the clock tree for the example, ULPCLK is derived from:

    HFCLK, divided by MDIV (which is set to 1), and then further divided by UDIV (which is set to 2). So with HFCLK coming from a 40MHz crystal, this would lead to a 20MHz ULPCLK and in turn a 20MHz BUSCLK for the default timer used in the example.

  • I am using the default TIMG0 in the example.

    Is their a way to force BUSCLK to use MCLK?

    Weirdly, I set up a PWM timer with TIMERA0 with the same source, BUSCLK, and it is using MCLK, since the "Calculated Timer clock source" is 40 MHz.

    I hate setting up the clock system in the MSPM0's! I always get twisted in my shorts!

  • Ah okay I see.

    So the BUSCLK source for a given peripheral is determined by its power domain. The structure of the power domains is shown in figure 4-1 of the datasheet. You can see in the figure that power domain 1 / PD1 peripherals utilize MCLK as their BUSCLK, while PD0 peripherals utilize ULPCLK as their BUSCLK. This is not something you can change for a specific instance of a peripheral.

    This would also explain why you saw that behavior in the PWM timer with TIMA0, it is located on PD1 so it gets MCLK as BUSCLK. 

    Have you had the opportunity to use the clock tree graphical tool in Sysconfig? Our clock system certainly can get complicated but personally I've found that the clock tree tool helps a lot. Maybe we could use some better documentation for how the clock system works in our devices though. Thanks for the feedback!

  • Yeah, I have used the clock tree, and it helps, but like LabView, it is hard to grok it all at once. If you have the whole thing on the screen it is too small to read, and if you zoom in, you lose context. It also seems like If I try to use the crystal, I have to change a bunch of things to get it used everywhere.

    Figure 4-1 helps, thanks.