ERROR with ADC triggering by FTM and PDB modules

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

ERROR with ADC triggering by FTM and PDB modules

跳至解决方案
2,993 次查看
1090097669
Contributor III

Hello All,

Recently, I was debugging the issue of FTM triggering ADC sampling, using FTM3 to trigger ADC1 and PDB1. The current problem is that there is an output of FTM3, but neither PDB1 nor ADC1 is triggered.

The following are my configuration items:

1090097669_0-1606718828081.png1090097669_1-1606718846385.png

And Where is the configuration problem or missing configuration items?

标记 (3)
0 项奖励
回复
1 解答
2,916 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

try to refer to simple S32DS "S32K144_Project_PDB" example. It configures PDB for continuous mode SW triggered, but you can test if ADC interrupt is correctly entered with configured period.

Or share your code, so we can test it.

 

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,985 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

you should also route FTM trigger (init_trig or ext_trig) into PDB1 input using TRGMUX. Use 

TRGMUX->TRGMUXn[TRGMUX_PDB1_INDEX] |= TRGMUX_TRGMUXn_SEL0(28); // use FTM3_INIT_TRIG as PDB1 HW trigger

FTM output trigger should be also enable within FTM External Trigger (EXTTRIG) register.

 

BR, Petr

 

0 项奖励
回复
2,978 次查看
1090097669
Contributor III

hello PetrS,

It has been able to trigger the sampling interrupt of ADC, but the period of entering the interrupt is different from what I expected, which is much smaller than the expected period

 
 
 

/* SW=3, TRGMUX initialization to route FTM Init trigger signal into PDB0 trigger input */
void TRGMUX_Init()
{
//PCC->PCCn[PCC_TRGMUX_INDEX] = PCC_PCCn_CGC_MASK; // Enable clock for TRGMUX module
TRGMUX->TRGMUXn[TRGMUX_PDB1_INDEX] = TRGMUX_TRGMUXn_SEL0(0x1D); // Set FTM3 as a trigger source for PDB0
}

0 项奖励
回复
2,970 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

what is an expected period and the one you have?
Do you read ADC Data result register within ADC interrupt so COCO flag is cleared?

 

BR, Petr

0 项奖励
回复
2,939 次查看
1090097669
Contributor III

Morning,

The interrupt cycle of my PDB is correct, which is 80kHz. Theoretically, my ADC interrupt cycle should also be 80kHZ, but according to the current test data, the ADC interrupt cycle is 400kHZ. In addition, I read the data register in the ADC interrupt

0 项奖励
回复
2,917 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

try to refer to simple S32DS "S32K144_Project_PDB" example. It configures PDB for continuous mode SW triggered, but you can test if ADC interrupt is correctly entered with configured period.

Or share your code, so we can test it.

 

BR, Petr

0 项奖励
回复