S32k146 SDK dual-edge input capture

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

S32k146 SDK dual-edge input capture

Jump to solution
1,601 Views
Chandler_L
Contributor II

Hi  NXP:

I am using the S32K146 for the first time and would like to set up a demo for dual-edge input detection. According to the manual, dual-edge detection requires configuring two channels. However, I would like to know if it's possible to detect the frequency and duty cycle of the input signal using just one channel. Could you please provide an SDK-driven demo for dual-edge detection and how to measure the input signal's frequency and duty cycle?

Thank you.

LaiBighead_0-1737180365035.png

 

Tags (2)
0 Kudos
Reply
1 Solution
1,553 Views
Senlent
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
5 Replies
1,554 Views
Senlent
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
1,514 Views
Chandler_L
Contributor II
双边沿检测功能已实现,但很奇怪,会一致卡住FTM4_CH2_Input_Detect函数里面,捕获通道频率设置为375Khz,给通道输入250Khz的PWM波;
0 Kudos
Reply
1,505 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@LaiBighead

双边沿输入捕获250KHz,一秒钟相当于中断差不多500K次,你说你这样用考虑过S32K146的性能吗?

通常电机控制中也就个10K或者20K,你这么高的速率它能处理的了吗。

0 Kudos
Reply
1,485 Views
Chandler_L
Contributor II
谢谢,问题已解决,祝您生活愉快
0 Kudos
Reply
1,528 Views
Chandler_L
Contributor II
I'm glad to receive your reply. I have made some attempts with this case, and it was somewhat enlightening. However, when trying the dual-edge detection, I’m unsure when to obtain the Cnv values of CHn and CHn+1.
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2030057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32k146%20SDK%20dual-edge%20input%20capture%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2030057%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%20NXP%EF%BC%9A%3C%2FP%3E%3CP%3EI%20am%20using%20the%20S32K146%20for%20the%20first%20time%20and%20would%20like%20to%20set%20up%20a%20demo%20for%20dual-edge%20input%20detection.%20According%20to%20the%20manual%2C%20dual-edge%20detection%20requires%20configuring%20two%20channels.%20However%2C%20I%20would%20like%20to%20know%20if%20it's%20possible%20to%20detect%20the%20frequency%20and%20duty%20cycle%20of%20the%20input%20signal%20using%20just%20one%20channel.%20Could%20you%20please%20provide%20an%20SDK-driven%20demo%20for%20dual-edge%20detection%20and%20how%20to%20measure%20the%20input%20signal's%20frequency%20and%20duty%20cycle%3F%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22LaiBighead_0-1737180365035.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F320165i44BAB9DCD8128318%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22LaiBighead_0-1737180365035.png%22%20alt%3D%22LaiBighead_0-1737180365035.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2030214%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32k146%20SDK%20dual-edge%20input%20capture%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2030214%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22mailto%3AHi%40LaiBighead%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EHi%40LaiBighead%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThis%20is%20a%20demo%20I%20post%20before%2C%20you%20can%20take%20a%20look%20at%20this.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K1-Calculate-the-motor-speed-based-on-the-FTM%2Fta-p%2F1515933%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K1-Calculate-the-motor-speed-based-on-the-FTM%2Fta-p%2F1515933%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2030940%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32k146%20SDK%20dual-edge%20input%20capture%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2030940%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EI'm%20glad%20to%20receive%20your%20reply.%20I%20have%20made%20some%20attempts%20with%20this%20case%2C%20and%20it%20was%20somewhat%20enlightening.%20However%2C%20when%20trying%20the%20dual-edge%20detection%2C%20I%E2%80%99m%20unsure%20when%20to%20obtain%20the%20Cnv%20values%20of%20CHn%20and%20CHn%2B1.%3C%2FLINGO-BODY%3E