MPC5777C EQADC configuration using processor expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5777C EQADC configuration using processor expert

Jump to solution
2,005 Views
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 Kudos
Reply
1 Solution
1,899 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,984 Views
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 Kudos
Reply
1,964 Views
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 Kudos
Reply
1,936 Views
LyncLin
Contributor III

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

0 Kudos
Reply
1,900 Views
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 Kudos
Reply