Hello,
I have several FTM modules with various channels and operation modes setup in my project. I use the FTM modules to generate periodic interrupts, read and generate PWM signals. So far, I only supplied the modules with SOSCDIV1_CLK (SOSC = 8MHz, DIV1 = 8MHz).
My current working setup of the FMT:
- PCC_FTM2 = 0xC1000000 (PCS = 1 (SOSCDIV1_CLK), CGC = 1 (clock enabled)).
- FTM2->CLKS = 3 (External clock)
- FTM2->PS = 7 (divide by 128).
But now I need to generate PWM signals with very high frequency, so I need to connect SPLLDIV1_CLK instead of SOSCDIV1_CLK (SPLL_CLK = 100MHz, DIV1 = 50MHz). I setup the FTM in the following way:
- PCC_FTM2 = 0xC6000000 (PCS = 6 (SPLLDIV1_CLK), CGC = 1 (clock enabled)).
- FTM2->CLKS = 3 (External clock)
- FTM2->PS = 7 (divide by 128).
But after configuring the clock this way, the FTM counter won't even start counting.
SPLL is also configured as system clock source. This is the SPLL configuration in SCG:
- SPLLCSR = 0x03000001
- SPLLDIV = 0x00000302
- SPLLCFG = 0x00090000
Thanks for advice!
Tomas