About Signal Measurement Mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

About Signal Measurement Mode

跳至解决方案
1,780 次查看
sanbrother
Contributor I

Hi, Dear

I need some help about Signal Measurement Mode, a lot of thanks in advance.

I have a 3-wire fan, so far as I know, I should be able to read speed signal from the 3rd line.

And, the FTM input capture seems just meet my need, and I manged to get stable speed by running example project named 'ftm_signal_measurement_s32k144'.

But, when I choose another channel, some error hint pops up, just as marked in the image below. (It says, only even channels can be configured in Signal Measurement Mode)

According to circuit diagram design, I must use PIN29 (PTC_15)

So

1. Did I choose a wrong approach? (Should't I choose input capture?)

2. How can I solve this problem?

3. And, why there is such restriction?

A lot lot lot thanks

Catch(01-15-09-08-08).jpg

标签 (1)
0 项奖励
回复
1 解答
1,541 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi David,

If you select Measure input signal, the FTM is then configured for Dual Edge Capture Mode.

pastedImage_1.png

And as can see below, this mode allows to capture two edges on the (n) input using the (n) and (n+1) registers but the (n+1) input is inactive.

pastedImage_2.png

If you select Detect edge signal, you can use odd channels.

pastedImage_3.png

Regards,

Daniel

在原帖中查看解决方案

3 回复数
1,542 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi David,

If you select Measure input signal, the FTM is then configured for Dual Edge Capture Mode.

pastedImage_1.png

And as can see below, this mode allows to capture two edges on the (n) input using the (n) and (n+1) registers but the (n+1) input is inactive.

pastedImage_2.png

If you select Detect edge signal, you can use odd channels.

pastedImage_3.png

Regards,

Daniel

1,541 次查看
sanbrother
Contributor I

Thanks a million for fast reply and detailed explanation. I'm totally clear why there is such a 'restriction', now. Great !!!

But for my specific application, PIN29 (FTM1_CH3, odd channel) has been chosen for fan speed feedback input, I can't change circuit diagram design. For me, 'Measure input signal' mode is the most convenient way, which outputs stable frequency.

If changed to 'Detect edge signal', the output has dramatic change. I don't know why.

So, I did another try, I add a callback to keep feedback signal count, and I can get stable frequency.

static volatile uint32_t s_tachSignalCounter = 0;

void fanSpeedFeedback(void *userData)
{
        ++s_tachSignalCounter;
}

Questions:

1. Is this an orthodox approach to use 'Detect edge signal' mode?

2. Is there any simpler examples using 'Detect edge signal' mode? 

Capture_0002.jpg

0 项奖励
回复
1,541 次查看
razva_tilimpea
NXP Employee
NXP Employee

Hi David,

I'm not sure if I understand this  "If changed to 'Detect edge signal', the output has dramatic change. I don't know why.". Could you provide some details about the behavior of your application?

I suppose that when you switch to edge detection mode you don't get the exact period of the signal. This is normal because in edge detect mode you just get the timestamp of the moment when edge was detected. To covert this into period measurement you have to subtract in callback previous timestamp from current timestamp (don't miss the case when FTM counter overflows).

We don't have other examples than the examples provided in SDK.

Best regards,

Razvan

0 项奖励
回复