EasyManua.ls Logo

Infineon GTM TIM Capture 1 - User Manual

Infineon GTM TIM Capture 1
13 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
Loading...
AURIX™ TC2xx Microcontroller Training
V1.0.0
GTM_TIM_Capture_1
PWM input capturing via TIM
Please read the Important Notice and Warnings at the end of this document
Question and Answer IconNeed help?

Do you have a question about the Infineon GTM TIM Capture 1 and is the answer not in the manual?

Summary

AURIX TC2 xx Microcontroller Training

Scope of Work for PWM Capture

Hardware Setup for TC297

TIM Input and TOM Output Pins

Specifies connecting P02.0 for TIM input and P02.3 for TOM output.

Implementing TIM Configuration

TIM Configuration Steps

Details enabling GTM/CMU clocks and initializing TIM configuration structures.

Implementing TOM Configuration

Starting PWM Generation

PWM Generation Example and Formula

Measuring PWM Frequency and Duty Cycle

TIM Measurement Functions

Lists iLLD functions like update(), getPeriodSecond(), and getDutyPercent() for measurement.

Run and Test Procedure

Overview

The document describes a training module for the AURIX™ TC2xx Microcontroller, specifically focusing on the GTM_TIM_Capture_1 example, which involves PWM input capturing via the Timer Input Module (TIM).

Function Description:

The core function of this training module is to demonstrate how to capture an external Pulse Width Modulation (PWM) signal using the Timer Input Module (TIM) of the Generic Timer Module (GTM) on an AURIX™ TC2xx microcontroller. Once the PWM signal is captured, the system calculates its frequency and duty cycle in software. These calculated values are then stored in variables for further use or display.

The Generic Timer Module (GTM) is a versatile, modular timer unit designed to accommodate a wide range of timer applications. Within the GTM, the Timer Input Module (TIM) is specifically responsible for filtering and capturing incoming input signals. The Clock Management Unit (CMU) plays a crucial role in generating the necessary clocks for the GTM. Its Configurable Clock Generation Subunit (CFGU) provides eight distinct clock sources for various GTM submodules, including the TIM, Timer Base Unit (TBU), Monitor (MON), and Advanced Timer for Automotive Applications (ATOM).

In addition to the TIM, the GTM also incorporates an in-built Timer Output Module (TOM). The TOM is capable of offering 16 independent channels, which can be used to generate output signals, such as the PWM signal used as an input in this example. The CMU is also responsible for clock generation for the TOM. Its Fixed Clock Generation (FXU) subunit provides five predefined, non-configurable clocks for GTM modules, including the TOM.

Important Technical Specifications:

While specific technical specifications like voltage ranges or current consumption are not detailed in this document, the following operational parameters and components are highlighted:

  • Microcontroller: AURIX™ TC2xx
  • Board: KIT_AURIX_TC297_TFT_BC-Step
  • Input Module: Timer Input Module (TIM) of the GTM
  • Output Module: Timer Output Module (TOM) of the GTM
  • Clock Management: Clock Management Unit (CMU) with Configurable Clock Generation Subunit (CFGU) and Fixed Clock Generation (FXU)
  • Input Pin: P02.0 (for TIM input)
  • Output Pin: P02.3 (for TOM output)
  • FXU Clock 1 Frequency (ffxclk1): 6.250 MHz (used in the PWM generation example)
  • Calculated Period Example: 50,000 ticks, equivalent to 8 ms for a 125 Hz PWM frequency with a 6.250 MHz FXU clock.

Usage Features:

The training module outlines a clear process for configuring and using the TIM and TOM for PWM capture and generation:

  • Configuration of TIM:

    • Enable the GTM using IfxGtm_enable().
    • Enable CMU clock 0 using IfxGtm_Cmu_enableClocks().
    • Initialize the IfxGtm_Tim_In_Config structure with default parameters via IfxGtm_Tim_In_initConfig().
    • Configure TIM parameters within IfxGtm_Tim_In_Config, including:
      • filter.inputPin: Selection of the input port pin (e.g., P02.0).
      • filter.inputPinMode: Selection of the input mode (e.g., IfxPort_InputMode_pulldown).
    • Apply the user configuration using IfxGtm_Tim_In_init().
    • All TIM configuration functions are provided in IfxGtm_Tim_In.h.
  • Configuration of TOM (for PWM generation):

    • Enable FXU clocks using IfxGtm_Cmu_enableClocks().
    • Initialize the IfxGtm_Tom_Pwm_Config structure with default values via IfxGtm_Tom_Pwm_initConfig().
    • Configure TOM parameters within IfxGtm_Tom_Pwm_Config, including:
      • tom: Selection of the TOM module.
      • tomChannel: Selection of the channel driving the output port pin.
      • period: Desired period for the PWM signal.
      • dutyCycle: Desired duty cycle for the PWM signal.
      • pin.outputPin: Selection of the output port pin (e.g., P02.3).
      • synchronousUpdateEnable: Enabling synchronous update of the timer.
      • clock: Selection of the clock for PWM generation.
    • Apply the user configuration using IfxGtm_Tom_Pwm_init().
    • Start the PWM using IfxGtm_Tom_Pwm_start().
    • All TOM configuration functions are provided in IfxGtm_Tom_Pwm.h.
  • Measuring PWM Frequency and Duty Cycle:

    • Update measured PWM data using IfxGtm_Tim_In_update().
    • Get the PWM period in seconds using IfxGtm_Tim_In_getPeriodSecond().
    • Calculate frequency: frequency(Hz) = 1 / period(s).
    • Get the PWM duty cycle using IfxGtm_Tim_In_getDutyPercent().
    • These measurement functions are also in IfxGtm_Tim_In.h.
  • Testing and Debugging:

    • After compilation and flashing, users can add variables g_measuredPwmFreqHz and g_measuredDutyCycle to the debugger's Watch Expressions.
    • Suspending the program allows checking the values of these variables, with an example showing a frequency of 125 Hz and a duty cycle of 50%.

Maintenance Features:

The document does not explicitly detail maintenance features for the hardware itself. However, it provides resources for ongoing support and development:

  • AURIX™ Development Studio: Available online for development.
  • Code Examples: Accessible via the "Import..." function in the Development Studio and from a GIT repository: https://github.com/Infineon/AURIX_code_examples.
  • Additional Trainings: Available on the Infineon webpage: https://www.infineon.com/aurix-expert-training.
  • Support Forum: For questions and support, users can utilize the AURIX™ Forum: https://www.infineonforums.com/forums/13-Aurix-Forum.
  • Documentation: The document itself serves as a reference, and an email address (erratum@infineon.com) is provided for questions regarding the document.
  • Important Notice and Warnings: The document includes standard legal disclaimers regarding guarantees, intellectual property, customer compliance, and the intended use of products by technically trained staff. It also warns about the potential for dangerous substances in products and the unsuitability of Infineon products for applications where failure could result in personal injury, unless explicitly approved in writing.

Infineon GTM TIM Capture 1 Specifications

General IconGeneral
BrandInfineon
ModelGTM TIM Capture 1
CategoryControl Unit
LanguageEnglish

Related product manuals