ADC_Pal2, HW triggered Group conversion for 2 different groups having different channels

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

ADC_Pal2, HW triggered Group conversion for 2 different groups having different channels

1,665 次查看
shubhendu_shukl
Contributor II

Hi,

I am using adc_pal2 for the HW triggered group conversion there are 2 different groups having 2-2 ADC channels,

As per the use case these groups should be triggered at different time time intervals.

For triggering the ADC Conversion for these groups I am using trigmux, LPIT channel0 at 250uSec and LPIT channel 1 at 1000uSec.

But I am facing issue that only one group gives the data but the other group never gives the data, Please help to under stand why is it happening.

  • I am having doubt,that  In trigmux configuration how we use Adc1AdhwtTla0, Adc1AdhwtTla2 if there are 2 groups

I am adding the basic process which i am following at the time of Initialization ,

CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

/* Initialize pins
* - See PinSettings component for more info
*/
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);

ADC_Init(&adc_pal2_instance, &adc_pal2_InitConfig0);

LPIT_DRV_Init(INST_LPIT1, &lpit1_InitConfig); //HWTRIG
/* Initialize LPIT channel 0 and 1,configure it as a periodic counter
* which is used to generate an interrupt.
*/
LPIT_DRV_InitChannel(INST_LPIT1, 0, &lpit1_ChnConfig0); //HWTRIG
LPIT_DRV_InitChannel(INST_LPIT1, 1, &lpit1_ChnConfig1); //HWTRIG

/* Install LPIT_ISR as LPIT interrupt handler */
INT_SYS_InstallHandler(LPIT0_Ch0_IRQn, &LPIT_ISR, (isr_t *)0); //HWTRIG
/* Install LPIT_ISR as LPIT interrupt handler */
INT_SYS_InstallHandler(LPIT0_Ch1_IRQn, &LPIT_ISR_1, (isr_t *)0); //HWTRIG

TRGMUX_DRV_Init(INST_TRGMUX1, &trgmux1_InitConfig0);

ADC_EnableHardwareTrigger(&adc_pal2_instance, 0U); //HW
ADC_EnableHardwareTrigger(&adc_pal2_instance, 1U);

After init, i am trying to read the value in the result buffer but only group 1 is showing the ADC value,

what more changes do I need to do to get the values in both buffers.

0 项奖励
回复
3 回复数

1,585 次查看
shubhendu_shukl
Contributor II

Hi danielmartynek

Thanks for the reply 

I am attaching the project.

In this project :

adc_pal,Lpit and trigmux is being used.

As per our use case we need 25usec Hw trigger for group 1 and 1000usec HW for group 2.  

0 项奖励
回复

1,584 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi shubhendu.shukla@exicom.in,

Thanks for the project.

Please move one group from ADC1 to ADC0.

You need another adc_pal component in the project.

With this current setup, both groups are triggered at the same time which cannot work.

BR, Daniel

0 项奖励
回复

1,584 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hishubhendu.shukla@exicom.in,

It seems like you have only one adc_pal component in the project and both channel groups are on one ADCn instance.

If so, both groups are triggered at the same time, can you move one group to the other ADC module?

Could you perhaps share the whole project so that I can test it?

Regards,

Daniel

0 项奖励
回复