MCUXpresso SDK Documentation

lpit_pwm

lpit_pwm#

Overview#

This demo show how to use SDK drivers to implement the PWM feature by LPIT IP module in dual 16-bit Periodic counter mode,and clone by TRGMUX to output this PWM to TRGMUX_OUTx pin. By default,the pwm duty is 50%, user can input from terminal to change the period and duty cycle,use oscilloscope can measure this output PWM signal.

Supported Boards#

MIMXRT1180-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT1180-EVK board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J44-6 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
FRDM-KE15Z
Hardware requirements
  • Mini/Micro USB cable

  • FRDM-KE15Z board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J4-4 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
FRDM-KE16Z
Hardware requirements
  • Mini/Micro USB cable

  • FRDM-KE16Z board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J4-10 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
FRDM-KE17Z
Hardware requirements
  • Mini/Micro USB cable

  • FRDM-KE17Z board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J1-5 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
FRDM-KE17Z512
Hardware requirements
  • Mini/Micro USB cable

  • FRDM-KE17Z512 board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J1-5 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the MCU-LINK USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
FRDM-MCXE247
Hardware requirements
  • USB-C cable

  • FRDM-MCXE247 board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J4-12 pin of board, you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the MCU-LINK USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

 lpit pwm demo start.
Set default PWM output
Frequency: 1000Hz
Duty Cycle: 50%

 Please input PWM frequency and duty like: 1464 50
The valid PWM frequency is 732Hz to 24000000Hz
FRDM-IMXRT1186
Hardware requirements
  • Micro USB cable

  • FRDM-IMXRT1186 board

  • Personal Computer

Board settings

Change Jumper J35 from 1-2 to 2-3. Use oscilloscope to measure output the 1000Hz PWM signal pin at J51-10 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty:
IMX943-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT1180-EVK board

  • Personal Computer

Board settings

No special is needed. Use oscilloscope to measure output the 1000Hz PWM signal pin at J48-10 pin of board,you can also change pwm frequency and duty via terminal.

Prepare the Demo
  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.

  2. Open a serial terminal with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Running the demo

When the example runs successfully, you can see the PWM signal wave on oscilloscope and similar information from the terminal as below.

lpit pwm demo start.

Please input pwm frequency and duty: