s32k144 PDB ad ping-pong sampling

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

s32k144 PDB ad ping-pong sampling

3,200 Views
jiangbolwj
Contributor II

i used pdb to ty ad ping-pong sampling but not ok, someone use PE to test Ad ping-pong ok ? can you give me a example used PE,i

Labels (1)
0 Kudos
Reply
6 Replies

2,128 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

Hi, the S32 SDK contains examples including PDB triggering of adc. One such example is under examples\S32K144\driver_examples\analog\adc_hwtrigger

0 Kudos
Reply

2,128 Views
jiangbolwj
Contributor II
i use this example but only can sample one AD channel ,i did not know where is wrong could you help me looking 
thank you 
job
0 Kudos
Reply

2,128 Views
ovidiualexandru
NXP TechSupport
NXP TechSupport

Seems that are a few issues with PDB configuration in the application:

 - for the first PDB pretrigger (channel 0, pretrigger 0) should not have Back to Back enabled (preTriggerBackToBackEnable should be false in pdly1_AdcTrigInitConfig0).

 - there is only one PDB pretrigger configured. There should be as many PDB pretriggers configures as ADC control channels (in this case, 2)

 - configuring PDB modulus and pretrigger delay is not necessary for Back to Back operation.

I will follow up with an updated application if needed.

0 Kudos
Reply

2,128 Views
jiangbolwj
Contributor II

ok,could you give me a updated application, first using pdb,i not very clear at this ,thank you

0 Kudos
Reply

2,128 Views
dragos-ionutgal
NXP Employee
NXP Employee

Hi,

I have updated your code a bit.

You had ADC set to continuous conversion and pdb channel 0 set to back to back.

Please tell me if this fixes your problem.

Regards,

Dragos.

0 Kudos
Reply

2,128 Views
gumpforrest
Contributor I

Hi !

I haved tried this Demo, I do change some codes as follow :

In Adc Initiation: (uncommon codes)

ADC_DRV_ConfigChan(ADC_INSTANCE, 0UL, &adConv1_ChnConfig0);

ADC_DRV_ConfigChan(ADC_INSTANCE, 1UL, &adConv1_ChnConfig0);

ADC_DRV_ConfigChan(ADC_INSTANCE, 2UL, &adConv1_ChnConfig0);

ADC_DRV_ConfigChan(ADC_INSTANCE, 3UL, &adConv1_ChnConfig0);

In PDB Initiation:

PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0, &pdly1_AdcTrigInitConfig0);

PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0, &pdly1_AdcTrigInitConfig1);

PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0, &pdly1_AdcTrigInitConfig2);

PDB_DRV_ConfigAdcPreTrigger(PDB_INSTANCE, 0, &pdly1_AdcTrigInitConfig3);

In ADC_IRQHandler:

ADC_DRV_GetChanResult(ADC_INSTANCE, 0U, (uint16_t *)&adcRawValue);

ADC_DRV_GetChanResult(ADC_INSTANCE, 1U, (uint16_t *)&adcRawValue1);

ADC_DRV_GetChanResult(ADC_INSTANCE, 2U, (uint16_t *)&adcRawValue2);

ADC_DRV_GetChanResult(ADC_INSTANCE, 3U, (uint16_t *)&adcRawValue3);

I am confised why adcRawValue is less than other convertion results like adcRawValue1/adcRawValue2/adcRawValue3  ?

Above all.

I do want a demo which uses ADC0, PDB0, ADC1, PDB1 to build a ring

so that in my applications, except understanding the principle of this ring,

I do only configure Channals. 

捕获.PNG

0 Kudos
Reply