MPC5744P Synchronize simultaneous ADC channels with sine wave trigger

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

MPC5744P Synchronize simultaneous ADC channels with sine wave trigger

921 Views
zcampbell
Contributor I

I am trying to syncrhonize taking ADC measurements of two ADC channels with the same point on a sine wave generator.  I am not seeing that the ADC command interrupt is being processed, and I am wondering why.  The model I am using is attached.  My MATLAB version is 2019B and MBDT 3.2.0.

0 Kudos
3 Replies

874 Views
zcampbell
Contributor I

Thank you for the response @mariuslucianand it illustrates for sure the need to use the second ADC config block.  Can you explain a little more the figure you provided in your initial response?  The CTU blockset, in the ADC commands tab refers to 'channel for ADC port A' and 'channel for ADC port B'.  What is meant by port A and port B?  Maybe the figure and these port A/B concepts are linked?

0 Kudos

850 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @zcampbell 

Glad you've asked!

mariuslucianand_0-1611252481128.png

As you can see in the previous image, the CTU0 can only send commands to ADC0 and ADC1 while the CTU1 can only send commands to ADC2 and ADC3. 

mariuslucianand_1-1611253526488.png

So, if you select dual conversion, the PDB can send two triggers for ADC conversions and get two conversions at the same time. But, the catch here is that you can not get these conversions on the same ADC instance. So the PDB will send the start conversion command to Port A on channel 6 and to port B on channel 1. In our case, the PDB0 will send commands to ADC0 channel 6 and ADC1 channel 1. If were the PDB1, then the triggers would have been sent to ADC2 channel 6 and ADC4 channel 1.

 

Hope this helps you,

Marius

0 Kudos

892 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @zcampbell ,

I had a look at your model and the reason for which the ADC interrupt is not triggered, is because no conversion actually is triggered. And here is why:

mariuslucianand_0-1610446522668.png

You have selected the CTU to trigger a dual conversion, which means that you are expecting to perform two ADC conversions simultaneously. But both of them on the ADC1 which is impossible. Each ADC instance has only one Hardware ADC converter. There are different channels that can be used as input for the converter but not at the same time. 

However, the CTU is capable to trigger such dual conversion but on different instances. So what I've done is I've added the ADC0 instance, Where Port A is the ADC0 Channel 6 and the Port B is the ADC1 Channel 1.

mariuslucianand_1-1610446947558.png

This diagram here explains how the ADC instances are connected to the CTU instances.

mariuslucianand_2-1610447097830.png

 

Hope this helps,

Marius

 

 

0 Kudos