Abstract
This document describes how to use the FlexTimer Module on S32M24x and S32K14x series. It introduces several operational modes, including the corresponding implementation to provide reference for different applications.
Introduction
S32M24x builds on the broad family of S32K14x MCUs, their tools and software by taking select MCUs from that portfolio and co-packaging them with an analog die that supports 12V power management, communications at the physical layer (CAN FD, LIN or CXPI) and the MOSFET gate drivers (6 channels).
Based on the above, the FlexTimer Module (FTM) Usage on S32M24x and S32K1xx series can be addressed in same context. Therefore SW and configuration will be quite similar (if not the same) for both devices. However text will be focus on S32M24x implementation.
Talking now about the FlexTimer module (FTM), it is built upon a timer with a 16-bit counter. It contains an extended set of features that meet the demands of motor control, including the signed up-counter, dead time insertion hardware, fault control inputs, enhanced triggering functionality, and initialization and polarity control.
Software implementation
To simplify and accelerate an application development, embedded part of the FTM examples have been created using S32 Design studio, RTD drivers (low level part) and S32K14x/S32M24x is configured using S32 Configuration Tools, see the following figure:
Figure 1: S32 Configuration Tools
Regarding Peripherals Tool, it allows to configure FTM functionalities though different drivers as follows:
Figure 2: FTM Drivers
Once you have selected a driver, you could refer for more details to its respective User Manual in the top corner of the FTM Driver Tab:
Figure 3: User Manuals for S32K1_S32M24X FTM Drivers
Project structure
Project structure using S32 Design Studio and RTD for S32K14x and S32M24x version 2.0.0 contains the following components:
Figure 4: Project structure
Implementation differences between S32M244 and S32K144 devices
Clocking
S32M24x and S32K1xx have some spec differences regarding clocking. Additionally, S32M24xEVB-C064 is supplied externally by 16 MHz crystal, meanwhile S32K144EVK is supplied externally by 8 MHz crystal.
In Clocks Tool of FTM examples both devices will be configured in Run mode and using PLL as system clock source, the same frequencies will be used for simplicity purposes as follows: - System and Core clock -> 80MHz - Bus clock -> 40MHz - Flash Clock -> 20MHz
Figure 5: Clocking in S32M24x devices
Figure 6: Clocking in S32K1xx devices
Pinout
S32K144EVK contains a S32K144HFT0VLLT MCU with LQFP 100 package and all its FTM channels are routable to at least to an external pin.
Meanwhile S32M24xEVB-C064 contains a S32M244CCABWKHST MCU with LQFP 64 package and not all its FTM channels are routable to an external pin. Such is the case of the following signals:
- ftm1_ch1 - ftm1_ch5
Particularly, ftm1_ch1 configuration is required to perform PWM Modulation on FTM0, but even though such channel is not routed to an external pin, such feature on FTM0 can be archived (Please refer to S32M24x/S32K14x-> PWM Modulation Implementation example).
FTM examples
The FTM examples provided for S32M24x and S32K14x are listed below:
• S32M24x/S32K14x -> FTM: Edge-align PWM (EPWM) mode • S32M24x/S32K14x -> FTM: Center-align PWM (CPWM) mode • S32M24x/S32K14x -> FTM: Complementary mode and dead-time insertion • S32M24x/S32K14x -> FTM: Modified Combine PWM Mode for Phase Shift • S32M24x/S32K14x -> FTM: Input capture (In progress) • S32M24x/S32K14x -> FTM: PWM Modulation Implementation • S32M24x/S32K14x -> FTM: Global time base • S32M24x/S32K14x -> FTM: Output compare (In progress)
Conclusion
This document, together with the linked FTM examples, shows the simplicity and efficiency in using the S32K1xx and S32M24x MCUs for different timing applications. It allows a better understanding of the implementation of FTM functionalities, making it easy, friendly and intuitive for users as well as to properly use this module in their projects.
References
S32 Design Studio for S32 Platform Real-Time Drivers (RTD) S32M2xx Data Sheet S32M24x Reference Manual S32M24XEVB S32K1xx MCU Family - Data Sheet S32K1xx MCU Family - Reference Manual S32K144EVB AN5303: Features and Operation Modes of FlexTimer Module on S32K
View full article