MCUXpresso_MKS22FN256xxx12/boards/mapsks22/driver_examples/tpm/pwm_twochannel
2022-06-18 14:53:46 +08:00
..
armgcc Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
board.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
board.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
clock_config.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
clock_config.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
pin_mux.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
pin_mux.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
readme.txt Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
tpm_pwm_twochannel.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
tpm_pwm_twochannel.xml Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00

Overview
========
The TPM project is a simple demonstration program of the SDK TPM driver. It sets up the TPM
hardware block to output PWM signals on two TPM channels. The PWM dutycycle on both channels
is manually updated. On boards that have an LED connected to the TPM pins, the user will see
a change in LED brightness if user enter different values.

Toolchain supported
===================
- Keil MDK 5.24a
- IAR embedded Workbench 8.22.2
- GCC ARM Embedded 7-2017-q4-major
- MCUXpresso10.2.0

Hardware requirements
=====================
- Mini/micro USB cable
- MAPS-KS22F256 board & MAPS-DOCK board
- Personal Computer

Board settings
==============
The tpm example is configured to use UART1 with PTE0 and PTE1 pins. To make JLink serial
device work, the jumpers on MAPS-DOCK board should be set as following:
- JP7 on MAPS-Dock: UART0 related jumpers connected

To observe the example result, please connect Pin-53 to Pin-56 on MAPS-KS22F256 board to see LED brightness chang.

Prepare the Demo
================
1. Connect a mini USB cable between the PC host and the USB port (CN14) on MAPS-DOCK board.
2. Open a serial terminal on PC for JLink serial device 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 demo.

Running the demo
================
When the example runs successfully, please connect Pin-53 to Pin-56 on MAPS-KS22F256 board to see LED brightness change.
You can see information from the terminal as below.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TPM example to output PWM on 2 channels

If an LED is connected to the TPM pin, you will see a change in LED brightness if you enter different values
If no LED is connected to the TPM pin, then probe the signal using an oscilloscope
Please enter a value to update the Duty cycle:
Note: The range of value is 0 to 9.
For example: If enter '5', the duty cycle will be set to 50 percent.
Value:5
The duty cycle was successfully updated!

Please enter a value to update the Duty cycle:
Note: The range of value is 0 to 9.
For example: If enter '5', the duty cycle will be set to 50 percent.
Value:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Customization options
=====================