Blog Peripheral Drivers(Autosar)

What is PWM Driver?

PWM Driver is the library for generating PWM signals via Automotive MCU’s. This Driver is part of Autosar MCAL layer and it is global level RTD standard that is followed by all semiconductor companies to generate the PWM signals using their microcontrollers for automotive applications.

This specification describes the API for generating and handling different PWM signals via automotive MCU’s. This software module includes GUI interface for initialization, configuration of PWM channels and peripheral instances. It supports the framework for using advance to basic features which are their with PWM peripherals of different MCU’s through which PWM signals are generated.. Also PWM Driver handles the variation of PWM parameters like  Frequency, Duty Cycle, Timer Period and etc.

PWM Driver can handles all the advance features like fault control, synchronization points, hardware trigger, softare control values, complementary PWM signals, DMA/Interrupts for PWM signals. . PWM Driver is built over the peripheral IP layer of the Microcontroller and driving functionalities. Main objectives of this monolithic SPI Handler/Driver are to take the best of each microcontroller features and to allow implementation optimization depending on static configuration to fit as much as possible to ECU needs. Hence, this specification defines selectable levels of functionalities and configurable features to allow the design of a high scalable module that exploits the peculiarities of the microcontroller.

What are PWM Signals and how are they generated?

  • Types of PWM Signals:
  • Parameters of PWM Signals:

To generate the PWM signals via Automotive MCU’s using Autosar MCAL Layer API’s:

  • At first to configure the MCU pins in PWM peripheral mode via PORT Driver: We can generate the PWM Signals from Microcontroller through different peripherals like Timer Peripheral of the MCU or FlexIO peripheral. So at first selection of MCU pin has to be done from which PWM signal has to be genarted and then configuring that MCU pin in corresponding peripheral mode.
  • After that comes the clock selection and configuration via MCU Driver: MCU Driver is responsible for clock configurations and clock settings of Microcontroller. Setting of systems clock, peripehral clocks all these settings are done by MCU Driver. And for generating the PWM Signals, what clock frequency has been input to it is very crucuial so as to calculate its parameters.
  • After this MCL Driver selection is also important: We can generate PWM signals from Microcontroller via different peripherals. Either Timer based peripheral or FlexIO peripheral. By tradation Timer peripheral is recommended and widely used. But as PWM Driver has been designed with global level coverage, it is also dependent on FlexIO peripheral, so FlexIO peripheral concentric files are generated via MCL Driver. So we will just select the MCL Driver, so that dependent files are included in project. In this course, we will focus on PWM signal generation via Timer peripheral. In our case we will be using NXP S32K144 MCU which has FlexTIMER Peripheral.
  • After all above three will be coming our PWM Driver configuration and selection. That is what is the main moto of the course module. We will understand what all configurations are their in PWM Driver. How PWM Driver works and important API;s of it for generating the PWM Signals.
  • Their would also be use of Platform Module, that is responsible for interrupt settings and configuration. We are going to use Interrupts with PWM Signals to detect the rising and failing edges of PWM signals and do some application specific tasks on those edges.

Functional concepts of PWM Driver:

Now PWM Driver has general/global functional concepts which are applicable to all automotive MCU’s, which are important to understand and know so as to configure the PWM Driver.

  • Selection of PWM hardware channel:
  • Selection of PWM Channel polarity
  • Selection of PWM IDLE Mode
  • Selection of PWM feature enablement:
  • PWM Signal modes:

Apart from the above general functional concepts, the PWM peripheral level concepts of the corresponding Micrcocontroller is also important to understand. These peripheral level functional concepts are different from one MCU to another. As their are different peripherals for generating PWM signals in different MCU’s. But the usage of these concepts is used only at the time of PWM GUI configuration. At the time of writing the embedded application, same set of API’s, chronology and parameters is used.

In our case we have ElecronicsV3 Board, which has S32K144 MCU and we are using FlexTIMER peripheral of this MCU.

Concepts description with respect to 

 

Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog