MPC5777C EQADC configuration using processor expert

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

MPC5777C EQADC configuration using processor expert

跳至解决方案
2,153 次查看
LyncLin
Contributor III

I'm using S32 SDK to configure for the MPC5777C chip.

Before I have setup a FreeRTOS with 2 ms and 10 ms tasks, as well as an EMIOS_PWM output channel, to toggle three external LEDs, it works fine.

Now I try to add an EQADC input channel, then I use the same PE configuration as in the Example project adc_pal_eqadc_mpc5777c, but change the channel to ANB23 related to our hardware,  and add the initialize function into main.c as below. However, the software seems to halt during ADC_Init() function. I try to debug step by step, but can't figure it out.


status = ADC_Init(&adc_pal1_instance, &adc_pal1_InitConfig0);
DEV_ASSERT(status == STATUS_SUCCESS);

 

I need help to solve this issue. Enclosed the project files I'm using. Thanks for your reply in advance.

 

Regards,

Lync

0 项奖励
回复
1 解答
2,047 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

seems you make it finally running by increasing heap of init task, as you mentioned in https://community.nxp.com/t5/MPC5xxx/Is-there-an-example-project-to-configure-ADC-PAL-with-freertos/...

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,132 次查看
LyncLin
Contributor III

It seems inside the ADC_Init(), OSIF_TimeDelay() will be called. However, I put ADC_Init() before vTaskStartScheduler(), so there is no tick for OSIF_TimeDelay to count, which will block the software. Then I try to put ADC_Init() in 2 ms Task, however, it still doesn't work, it will stop where ADC_Init() is called. It looks like some functions inside OSIF component that ADC_Init() is using by default has a confilict with freeRTOS that added after. 

I hope someone can help on this.

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

Hi,

try to add ADC init into 10ms task, which has higher priority. Does it pass ADC init in that case?

BR, Petr 

0 项奖励
回复
2,084 次查看
LyncLin
Contributor III

No, it didn't work. I tried to creat only one task for ADC init, but not work as well.

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

Hi,

seems you make it finally running by increasing heap of init task, as you mentioned in https://community.nxp.com/t5/MPC5xxx/Is-there-an-example-project-to-configure-ADC-PAL-with-freertos/...

BR, Petr

0 项奖励
回复