S32K118 ADC fail

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

S32K118 ADC fail

1,359 次查看
종찬박
Contributor II

Hi I'm trying to configure ADC driver using SDK RTM v4.0.1

and I'm using ADC, PDB Driver.

 

1. ADC is OK

 - 1ms_Loop Operation : 

   ADC_DRV_GetChanResult(INST_ADC_CONFIG_1, 0U, (uint16_t *)&adcRawValue0);

   PDB_DRV_SoftTriggerCmd(INST_PDB_0);

 

2. ADC is fail

 - 1ms_Loop Operation :

   PDB_DRV_SoftTriggerCmd(INST_PDB_0);

- 5ms_Loop Operation :

   ADC_DRV_GetChanResult(INST_ADC_CONFIG_1, 0U, (uint16_t *)&adcRawValue0);

 

I can't understand why one is OK but Another is not.

 

0 项奖励
回复
4 回复数

1,320 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Jongchan,

Sorry for the delay, I'm out of office and I will be back on Jan, 4th.

Have you tried using a higher ADC interrupt priority?

Is the ADC interrupt pending? You can see it in the NVIC registers.

 

Thanks,

BR, Daniel

0 项奖励
回复

1,334 次查看
종찬박
Contributor II

Can I request another problem?

I resolved input capture interrupt. That's because the ftm_state_t variable declared as local variable.

I changed variable to global variable.

But, I have another problem.

Attached project doesn't work ADC peripheral.

if Input capture interrupt is ever generated, ADC Complete interrupt would not work, and API ADC_DRV_GetChanResult would not work.

I can't understand why this project ADC doesn't work.

Could you explain why? and Could I ask you to send project that works well?

Thanks,

Best regards, Jongchan

0 项奖励
回复

1,341 次查看
종찬박
Contributor II

Hi,

If you can review my project, I want you to review final project.

I wanna use peripheral ADC, TRGMUX, PDB, PWM(FTM), Input Capture(FTM), Timer, CAN, UART.

But I have a proplem at Input Capture Interrupt.

So I was looking for the reason program was not able to quit FTM1_Ch0_7_IRQHandler Interrupt loop.

first, C2SC_CHF is not clear. That is why program stay to FTM1_Ch0_7_IRQHandler Interrupt loop.

In reference manual, C2SC_CHF is clear by reading CnSC register while CHF is set.

but, variable ftmStatePtr[1].ftmMode value is 50. I think this is API or my configuraion error.

I'm attaching my project and waiting for yout reply.

Thanks.

Best regards, Jongchan

 

0 项奖励
回复

1,346 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you please share a test project with this issue so that we can test it?

Thanks,

BR, Daniel

0 项奖励
回复