ftm_combine_pwm#
Overview#
The FTM project is a demonstration program of generating a combined PWM signal by the SDK FTM driver. It sets up the FTM hardware block to output PWM signals(24kHZ) on two TPM channels. The example also shows the complementary mode of operation and deadtime insertion, updates deadTimePrescale based on counter clock and tries to insert a dead time of about 650 nsec. This example updates the pwm duty cycle with an interrupt, meanwhile, disables the interrupt to retain the current duty cycle for a few seconds and disables the output on each channel before updating. On boards that have 2 LEDs connected to the FTM pins, the user will see a change in LED brightness. And if the board do not support LEDs to show, the outputs can be observed by oscilloscope.
Supported Boards#
FRDM-K22F
Hardware requirements
Mini/micro USB cable
FRDM_K22F board
Personal Computer
Board settings
This example project does not call for any special hardware configurations. Although not required, the recommendation is to leave the development board’s jumper settings and configurations in default state when running this example.
Prepare the Demo
Connect a USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal with these settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Red led and green led will change brightness.
FRDM-KE02Z40M
Hardware requirements
Mini/micro USB cable
FRDM-KE02Z40M board
Personal Computer
Board settings
No special settings are required. Use oscilloscope to measure output the signal pin at J10-4 pin of board. Use oscilloscope to measure output the signal pin at J10-6 pin of board.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the example.
Running the demo
These instructions are displayed/shown on the terminal window:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
FRDM-KE15Z
Hardware requirements
Micro USB cable
FRDM-KE15Z board
An oscilloscope
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Blue led and green led will change brightness.
FRDM-KE16Z
Hardware requirements
Micro USB cable
FRDM-KE16Z board
An oscilloscope
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Red led and green led will change brightness.
FRDM-KE17Z
Hardware requirements
Micro USB cable
FRDM-KE17Z board
An oscilloscope
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Blue led and green led will change brightness.
FRDM-KE17Z512
Hardware requirements
Micro USB cable
FRDM-KE17Z512 board
An oscilloscope
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Blue led and green led will change brightness.
FRDM-MCXE247
Hardware requirements
USB-C cable
FRDM-MCXE247 board
An oscilloscope
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, the following message is displayed in the terminal:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Blue led and red led will change brightness.
LPCXpresso860MAX
Hardware requirements
Micro USB cable
LPCXpresso860MAX board
An oscilloscope
Personal Computer
Board settings
The FTM pins are J1_7 and J1_5.
Prepare the Demo
Connect a micro USB cable between the PC host and the OpenSDA USB port on the board.
Open a serial terminal on PC for OpenSDA serial device with these settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
These instructions are displayed/shown on the terminal window:
FTM example to output combined complementary PWM signals on two channels
You will see a change in LED brightness if an LED is connected to the FTM pin
If no LED is connected to the FTM pin, then probe the signal using an oscilloscope
Red led and green led will change brightness.