background image

Implementation

Configure the GPT12 Module

Configuration of the GPT12 is done once in the function 

initGpt12PWM()

by the 

following steps:

Enable GPT12 module by calling the iLLD function 

IfxGpt12_enableModule()

Set GPT1 prescaler with the iLLD function 

IfxGpt12_setGpt1BlockPrescaler()

Configure the mode of timer T3 by using the iLLD function 

IfxGpt12_T3_setMode()

Set the counting direction of the timer T3 by calling the iLLD function 

IfxGpt12_T3_setTimerDirection()

Set the prescaler of timer T3 by calling the iLLD function 

IfxGpt12_T3_setTimerPrescaler()

Set the timer value with the iLLD function 

IfxGpt12_T3_setTimerValue()

and use 

an 

uint16

number as parameter

The configuration functions above are provided by the iLLD header 

IfxGpt12.h

.

6

2020-06-05

Copyright © Infineon Technologies AG 2020. All rights reserved.

Summary of Contents for GPT12 Timer Concatenation 1

Page 1: ...AURIX TC2xx Microcontroller Training V1 0 0 GPT12_PWM_Generation_1 for KIT_AURIX_TC297_TFT Generation of PWM via GPT12 Please read the Important Notice and Warnings at the end of this document...

Page 2: ...ts count direction configured to down counting On underflow of timer T3 the Output Toggle Latch T3OTL is toggled and the value of timer T2 or T4 is transferred into timer T3 depending on T3OTL value T...

Page 3: ...ure which incorporates several 16 bit timers Block GPT1 contains three timers the core timer T3 and two auxiliary timers T2 and T4 All three timers of block GPT1 can run in one of four modes Timer Mod...

Page 4: ...rdware setup This code example has been developed for the board KIT_AURIX_TC297_TFT_BC Step LED D107 1 is used for this example 1 4 2020 06 05 Copyright Infineon Technologies AG 2020 All rights reserv...

Page 5: ...BPS1 of the divider Configure the frequency for the timer T3 by setting the prescaler value T3I of the divider Configure the timer T3 mode direction and starting value Configure the two auxiliary tim...

Page 6: ...mer T3 by using the iLLD function IfxGpt12_T3_setMode Set the counting direction of the timer T3 by calling the iLLD function IfxGpt12_T3_setTimerDirection Set the prescaler of timer T3 by calling the...

Page 7: ...ng the iLLD function IfxGpt12_getModuleFrequency Calculate the timer frequency with the following formula The GPT1 block prescaler is set to IfxGpt12_Gpt1BlockPrescaler_32 is divided by 32 The timer p...

Page 8: ...g the iLLD functions IfxGpt12_T2_setReloadInputMode and IfxGpt12_T4_setReloadInputMode Set timer T2 value with the iLLD function IfxGpt12_T2_setTimerValue and dutyDownTime as parameter Set timer T4 va...

Page 9: ...h a pointer to the address of the timer T3 service request the interrupt provider and the interrupt priority number as parameters Enable GPT12 interrupt with the iLLD function IfxSrc_enable and the po...

Page 10: ...R The ISR implemented in this example calls the iLLD function IfxPort_togglePin to toggle the LED s state The interrupt is triggered every time the timer T3 generates an underflow On underflow of time...

Page 11: ...n and Test After code compilation and flashing the device observe the LED D107 1 which should be blinking 2 times in a second 1 11 2020 06 05 Copyright Infineon Technologies AG 2020 All rights reserve...

Page 12: ...www infineon com aurix expert training AURIX Development Studio is available online https www infineon com aurixdevelopmentstudio Use the Import function to get access to more code examples For questi...

Page 13: ...uct for the intended application and the completeness of the product information given in this document with respect to such application For further information on the product technology delivery term...

Reviews: