S32K144 ADC using DMA and Interrupt meantime

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

S32K144 ADC using DMA and Interrupt meantime

Jump to solution
1,338 Views
chenyunhua
Contributor I

Hello all,

S32K144 ADC0 supports 16 channle of conversion(RA~RP), I want to configure the first 4 channel to do sampling signals while the rest 12 channel to scan a single singal to do compare function whether it's outside CV1~CV2. 

To keep trigger source PDB not reporting sequence error, I need setup the DMA to transfer the ADC result to RAM, while it's also needed to interrupt at 4th channel to enable compare function.

Actually I found that DMA transfer is well running, however the 4th channel interrupt is not enterring while the 16th channel interrup is serviced.

Does anyone have the same problem when ADC's DMA and interrupt is serviced meantime?

Best Regards.

CYH

0 Kudos
1 Solution
1,263 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @chenyunhua,

The problem is that if the compare condition on a channel is not true and there is no COCO flag set, the subsequent PDB trigger will report a sequence error.

 

Regards,

Daniel

 

 

 

View solution in original post

0 Kudos
3 Replies
1,297 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @chenyunhua,

I see a few issues in this use case as you described it.

The compare function can be enabled for the whole module not for individual channels.

Also, I understand that you need to use the back-to-back mode of the PDB module.

However, this mode requires the COCO signal to proceed, and the compare function does not set the COCO flag if the confition of the compare function is not true.

Can you maybe elaborate on how exectly you implemented it?

 

Regards,

Daniel

 

0 Kudos
1,285 Views
chenyunhua
Contributor I

Hello Daniel,

I finished debug the scenario.

1. First 4 channel triggered by PDB with Back-to-Back, data is transfered via DMA.

2. DMA interrupt disable DMA and enable compare function.

3. Rest 12 channel trigger by PDB, and generally no data need be transferred.

4. Delayed PDB interrupt(after the 16th trigger to ADC) re-enable DMA and disable compare, and unlock the PDB's lock with ADC's COCO.

I found this is a complex mechanism, I am not sure it could run well in real daily work.

Best Regard!

CYH

0 Kudos
1,264 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @chenyunhua,

The problem is that if the compare condition on a channel is not true and there is no COCO flag set, the subsequent PDB trigger will report a sequence error.

 

Regards,

Daniel

 

 

 

0 Kudos