This demo application demonstrates how to use FTM external trigger to start ADC conversion via PDB.
Overview
This application demonstrates how to use the FTM external trigger to start the ADC conversion using the PDB. The FTM0 is configured as a complementary combined mode. Each channel output frequency is 16 KHz. The complementary channel dead time is 1 µs. The PDB pre-trigger works in back-to-back mode. The ADC0 and ADC1 work in single-end mode. The ADC0 uses channel 1 and channel 5. ADC1 uses channel 1 and channel 7.
Supported Platforms
This Tower System module is supported by the KSDK FTM PDB ADC demo.
System Requirement
Hardware requirements
- J-Link ARM
- P&E Micro Multi-link universal
- Mini/micro USB cable
- USB A to micro AB cable
- Hardware (tower/base board, ...) for specific device
- Personal Computer
Toolchain requirements
- IAR embedded Workbench version 7.30.4
- ARM GCC 4.8.3 2014q3
- Keil MDK 5.13
- Kinetis Design Studio IDE v.2.5.0
- Atollic TrueSTUDIO for ARM win32 v5.2.1
Software requirements
- The project files are in: <SDK_Install>/examples/<board>/demo_apps/ftm_pdb_adc/<toolchain>.
- Library dependencies: ksdk_platform_lib
Getting Started
Hardware Settings
Use default jumper settings on TWR-KV10Z32. Ensure that the J21(2~3 is short), J22(2~3 is short), J11(1~2 is short, 3~4 is short),J12(1~2 is short, 3~4 is short).
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 the board or launch the debugger in the IDE to begin running the demo.
For detailed instructions, see the appropriate board User's Guide.
Run the demo
- Download and run the ftm_pdb_adc code on the board.
- Terminal prints this message: "Run PDB trig ADC with FlexTimer demo." and "Input any character to start demo."
- Input a character to the serial terminal, which has 256 lines of information for the ADC conversion result.
- Input any character to the serial terminal. The process repeats again.