S32K118 FlexIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K118 FlexIO

286 Views
Niuyanlin
Contributor I

 

Hello.

I would like to consult about implementing both-edge detection for motor Hall sensor signals using the FlexIO module on S32K118.

Currently, I need to capture both rising and falling edges of three Hall feedback signals from the BLDC motor. I am trying to configure FlexIO pins as input capture channels. However, I am confused about how to set FlexIO to detect both rising and falling edges simultaneously.

Could you share the proper FlexIO timer and shifter configuration workflow for dual-edge capture。Besides.I also want to know if interrupts can be triggered on every edge, and whether there are known limitations or precautions when using FlexIO for Hall signal sampling on the S32K118 platform. Thank you very much.

0 Kudos
Reply
3 Replies

240 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hello @Niuyanlin,

If application is Hall sensor in BLDC motor feedback, I suggest looking into the FTM module instead.

The following application note mentions how to configure the module for single and dual edge capture, and how to generate a capture interrupt: AN5303: Features and Operation Modes of FlexTimer Module on S32K – Application Note.

"The Hall sensors are connected to the channels of the independent FTM (FTM_CHx). The FTM can then detect both the falling and rising edges of the Hall sensor signals and generate a capture interrupt."

FlexIO, by contrast, requires constructing input capture behavior indirectly through timer-decrement modes, and it can work, but in my opinion, FTM module is better suited.

Best regards,
Julián

0 Kudos
Reply

199 Views
Niuyanlin
Contributor I
Hello, Julian,
Thank you very much for your prompt reply and valuable suggestions.
I recognize that FTM is a superior choice for feedback from BLDC motor Hall sensors. However, due to insufficient peripheral resources in the project, we had to implement input capture functionality using FlexIO.
We would greatly appreciate it if you could provide a detailed software implementation plan related to FlexIO for our reference.
Best regards,
Niu Yanlin
0 Kudos
Reply

174 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hello @Niuyanlin,

Since FlexIO does not have the dedicated input capture capability, most of the documentation is based on communication emulation. The main suggestion I can give is to refer to S32K1's reference manual chapter 54.

You can refer to the following application notes, which detail how to configure shifters and timers, along with the respective interrupts:

The FlexIO module can generate an interrupt from 3 sources: Shifter error, Shifter status flag and Timer status flag. To enable the interrupts, you need to set the bits in the SHIFTSIEN, SHIFTEIEN and TIMIEN.

However, there are no routines for input capture or BLDC motor control. I apologize for the inconveniences.

Best regards,
Julián

0 Kudos
Reply