S32K144 ADC hardware

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

S32K144 ADC hardware

跳至解决方案
1,955 次查看
Alex19
Contributor II

Hello NXP Community,

I try to read the 2 ADC values from internal potentiometer and external, but i can't read the values, i attached my file, can you show me, where i miss something? Thank you 

 

Alex19_0-1643804604533.png

 

0 项奖励
1 解答
1,940 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as just first 2 channels in ADC is used then only PDB ch0 should be configured. It could be

PDB_DRV_Enable(PDB_INSTANCE);
PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0UL, &pdly1_AdcTrigInitConfig0);
PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0UL, &pdly1_AdcTrigInitConfig1);
PDB_DRV_SetTimerModulusValue(PDB_INSTANCE, (uint32_t) delayValue);
PDB_DRV_SetAdcPreTriggerDelayValue(PDB_INSTANCE, 0UL, 0UL,(uint32_t) (delayValue/2));
PDB_DRV_LoadValuesCmd(PDB_INSTANCE);

 BR, Petr

在原帖中查看解决方案

标记 (1)
0 项奖励
2 回复数
1,941 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as just first 2 channels in ADC is used then only PDB ch0 should be configured. It could be

PDB_DRV_Enable(PDB_INSTANCE);
PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0UL, &pdly1_AdcTrigInitConfig0);
PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0UL, &pdly1_AdcTrigInitConfig1);
PDB_DRV_SetTimerModulusValue(PDB_INSTANCE, (uint32_t) delayValue);
PDB_DRV_SetAdcPreTriggerDelayValue(PDB_INSTANCE, 0UL, 0UL,(uint32_t) (delayValue/2));
PDB_DRV_LoadValuesCmd(PDB_INSTANCE);

 BR, Petr

标记 (1)
0 项奖励
1,927 次查看
Alex19
Contributor II

Hello, 

Yes it works, thank you very much for you support

0 项奖励