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
Hi, the S32 SDK contains examples including PDB triggering of adc. One such example is under examples\S32K144\driver_examples\analog\adc_hwtrigger
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.
ok,could you give me a updated application, first using pdb,i not very clear at this ,thank you
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.