ADC_PAL change between SW and HW Triggering

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

ADC_PAL change between SW and HW Triggering

Jump to solution
1,334 Views
EE_CW
Contributor III

Hi together

I'm using a S32K148 with S32 Design Studio.

I have a question about the ADC_PAL component from Processor expert.

Is it possible to change between HW Triggering and SW Triggering for a single Group?

pastedImage_1.png

Because I have to measure a signal which is either constant at a specific voltage, or a PWM.

So I want to change the triggering for a ADC_PAL Group depending on the signal (PWM or static). The PWM Signal is generated by the FTM5. Thats why I set FTM5 as HW trigger for the conversion in Processer expert.

I tried to call the the following component functions to enable and disable the HW Triggering:

pastedImage_2.png

So I disabled the HW Triggering first to measure the stable signal (SW Triggering). This worked once, but for a second measurement, the function ADC_StartGroupConversion() returned STATUS_BUSY.

It seems that the "active" status will not be reseted after a conversion (in ADC_S32K1xx_IrqHandler()):

pastedImage_3.png

This because the variable activeGroupCfg->hwTriggerSupport is set to true.

For the next steps I would like to Enable HW Triggering and measure the PWM signal on each period. But when the repeated measurement by SW Triggering of the stable signal does not work, I can't proceed.

I attached a sample program.

I hope you can understand my problem.

Thanks for your help.

Regards

Mario

Tags (3)
0 Kudos
1 Solution
1,194 Views
cosmindinu
NXP Employee
NXP Employee

Hi Mario,

Unfortunately the ADC_PAL does not support updating triggering (SW <-> HW) for a group, without Deinit(). 

Instead, to achieve your scenario, you would need to create another SW triggered group, configured to measure the same channel which you are measuring via HW triggered group.

Also please note that ADC_StartGroupConversion only supports calling groups configured as SW triggered

Hope it helps,

Cosmin

View solution in original post

4 Replies
1,195 Views
cosmindinu
NXP Employee
NXP Employee

Hi Mario,

Unfortunately the ADC_PAL does not support updating triggering (SW <-> HW) for a group, without Deinit(). 

Instead, to achieve your scenario, you would need to create another SW triggered group, configured to measure the same channel which you are measuring via HW triggered group.

Also please note that ADC_StartGroupConversion only supports calling groups configured as SW triggered

Hope it helps,

Cosmin

1,193 Views
EE_CW
Contributor III

Hi Cosmin

Thanks for your answer. In the meantime I found a solution that seems working for me:

- 1 ADC configuration with SW Triggering

- 1 ADC configuration with HW Triggering

--> depending on the signal (PWM or not) I deinit the ADC and init it with the other configuration.

But out of this there came up another question:

-It is not possible to have two HW Triggered groups active at the same time for one ADC. But is it possible to have a HW Triggered Group active and some SW Triggered groups for the same ADC instance (See first picture in the original question)?

This seems not working for me, but I'm not sure if I made a mistake or it is even not possible...

Regards

Mario

0 Kudos
1,193 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Mario,

Enabling another HW triggered group while other SW triggered is running will return BUSY.

Also, I would like to mention that there is an example in S32DS adc_pal_s32k148 which uses ADC PAL for a series of SW and HW triggered groups of conversions.

Best regards,

Diana

1,193 Views
EE_CW
Contributor III

Hi Diana

Thank you for your answer.

Yes I know that example. Thanks for the hint.

Regards

Mario

0 Kudos