Download Print this page
Infineon PWM Buzzer 1 Manual

Infineon PWM Buzzer 1 Manual

Pwm controlled melody on buzzer, aurix tc2xx microcontroller training

Advertisement

Quick Links

PWM_Buzzer_1
PWM controlled melody on Buzzer
AURIX™ TC2xx Microcontroller Training
V1.0.0
Please read the Important Notice and Warnings at the end of this document

Advertisement

loading

Summary of Contents for Infineon PWM Buzzer 1

  • Page 1 PWM_Buzzer_1 PWM controlled melody on Buzzer AURIX™ TC2xx Microcontroller Training V1.0.0 Please read the Important Notice and Warnings at the end of this document...
  • Page 2: Scope Of Work

    The generated PWM (Pulse-Width Modulation) signal is controlled by timer TOM1 of the GTM block. The signal drives the piezo buzzer via the pin 0 of the port 33. 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 3 The Clock Management Unit (CMU) is responsible for clock generation of the GTM. The Fixed Clock Generation (FXU), subunit of the CMU, provides five predefined non-configurable clocks for the TOM submodules. 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 4: Hardware Setup

    Hardware setup This code example has been developed for the board KIT_AURIX_TC297_TFT_BC-Step. The piezo buzzer (1) is used for this example. 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 5 Enable the GTM TOM channel 4 by calling the iLLD function IfxGtm_Tom_Tgc_enableChannelsUpdate() All the functions used for the configuration of the PWM Buzzer are provided by the iLLD header IfxGtm_Tom_Pwm.h. 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 6 Set port and pin for PWM output timerCfg.triggerOut = &IfxGtm_TOM1_4_TOUT22_P33_0_OUT › Enable TOM channel timerCfg.base.trigger.enabled = TRUE › Enable TOM channel output timerCfg.base.trigger.outputEnabled = TRUE › Starting PWM with rising edge timerCfg.base.trigger.risingEdgeAtPeriod = TRUE 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 7 Wait until the end of the note through the service function waitTime() Stop the timer with the iLLD function IfxGtm_Tom_Timer_stop() PWM signal Period of PWM Duty cycle of the PWM Sound duration 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 8 Run and Test After code compilation and flashing the device, listen to the Buzzer (1) which should play the sound from the game Super Mario. 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 9 More code examples can be found on the GIT repository: › https://github.com/Infineon/AURIX_code_examples › For additional trainings, visit our webpage: › https://www.infineon.com/aurix-expert-training › For questions and support, use the AURIX™ Forum: › https://www.infineonforums.com/forums/13-Aurix-Forum 2019-10-17 Copyright © Infineon Technologies AG 2019. All rights reserved.
  • Page 10 Infineon Technologies in in personal injury. customer’s applications. The data contained in this document is exclusively intended for technically trained staff.