Hello Martin
How are you determining whether the TPM is being clocked in VLPS?
According to the user's manual it continues as long as you have the IREFSTEN bit set before entering STOP or VLPS, but I can confirm that it doesn't allow PWM outputs to be used in VLPS (but they do operate in STOP mode, as long as the IREFSTEN bit is set). What I don't know at the moment is whether this is the TPM that doesn't operate or whether it is the PWM output (due to the port output not changing in the mode).
I have attached a binary that shows this on the FRDM-K02Z.
1. The TPM runs from the slow IRC and the IREFSTEN bit is set in MCG_C1. The output on PTB10 (blue LED) generates 20% PWM at 100Hz.
2. On the OpenSDA virtual COM there is a shell menu at 115'200 Baud. In the administrator menu low power modes can be set (eg. "set_lp 2" sets STOP mode and "set_lp 4" sets VLPS).
It is seen that the PWM output continues in STOP mode but stops (either at '1' or at '0') in VLPS mode.
3. The MCG_C1 register can be viewed in the I/O menu with the memory display command
"md 40064000 b 1"
and shows 0x03 (with IREFSTEN set).
The IREFSTEN can be disabled by commanding
"mm 40064000 b 2"
Repeating the low power mode tests as in 2 shows that now the PWM output stops in both STOP and VLPS modes.
Notes: After loading the binary to the board the board needs to be power cycled.
In both STOP and VLPS modes the UART will continue operating but will not be able to function correctly at 115200 Baud since the wakeup time is too slow. Therefore a reset is required to restart and do the next test.
Therefore with this binary I can confirm that PWM output stops in VLPS but continues in STOP as long as IREFSTEN is set (TPM clocked from slow IRC).
If this corresponds with your experience the question is whether the PWM output stops for a different reason, whereas the TPM is in fact still running (because slow IRC continues) or whether the TPM really completely stops in VLPS (due to the slow IRC being stopped), which would be contrary to the description in the user's manual?
Note finally that it operates as expected using the fast IRC as TPM clock.
Regards
Mark
Kinetis: µTasker Kinetis support
KL02: µTasker FRDM-KL02Z support
For the complete "out-of-the-box" Kinetis experience and faster time to market