Hi
I can't help with the examples that you are using but I have configured a project for the FRDM-KL27Z running at 4MHz system clock and 1MHz bus/Flash clock (the maximum allowed for VLPR), and generated a 1kHz PWM signal (20% high) on PTC3 (J2-15).
The binary can be check at:
http://www.utasker.com/kinetis/FRDM-KL27Z.html#VLPR
If you connect to the OpenSDA VCOM at 19'200 Baud you can enter the "administrator" menu where you can switch between low power modes (including VLPR and VLPW) in order to see the effect on the PWM output and the current consumption.
The default mode is WAIT mode, as shown, when the present low power mode is requested with the "show_lp" command:
#show_lp
0 = RUN
1 = WAIT [active]
2 = STOP
3 = VLPR
4 = VLPW
5 = VLPS
6 = LLS
7 = VLLS0
8 = VLLS1
9 = VLLS3
To set a different mode use (for example for VLPR)
#set_lp 3
which will subsequently show
#show_lp
0 = RUN
1 = WAIT
2 = STOP
3 = VLPR [active]
4 = VLPW
5 = VLPS
6 = LLS
7 = VLLS0
8 = VLLS1
9 = VLLS3
You will find that you can change back and forth between various modes but the very low power ones may lose PWM output (due to clocks stopping) and some can only recover from a reset.
I don't know what the restrictions are with the code that you base your tests on but the uTasker project configuration settings are listed at the link. The only thing that should really be needed is to ensure that the TPM is clocked from the MCGIRCLK.
Should you prefer a complete solution, including (approx.) real-time simulation to accelerate testing, debugging and general product development you can get it at the link too.
Here are typical current consumptions that I have measured:
RUN 1.3mA / WAIT 1.1mA / STOP 0.1mA / VLPR 1.2mA / VLPW 0.5mA / VLPS 3uA / LLS 27uA / VLLS0 27uA / VLLS1 27 uA / VLLS2 27uA / VLLS3 2uA
Regards
Mark