AnsweredAssumed Answered

ADC Scan Control Register problem on MC56F84789

Question asked by Marco Aversa on Jan 13, 2016
Latest reply on Apr 13, 2016 by John Winters

Hello,

I already wrote the question in the Codewarrior for MCU section ( ADC Scan Control Register problem on MC56F84789 ) but to now no one could help me!

If is it possible i rewrite here the problem.

 

We're using ADC12 in independet parallel triggerd mode.

We want to acquire 6 samples on ADCB triggered via PDB1 (4 sync) syncing with ADC12_SCTRL in one PWM 8Khz cycle. At the end of ADC scan we want to have ADC ISR

The configuration of PWM, PDB1, AOI are correct. We have checked disabling the ADC12_SCTRL register and we monitoring the event end of ACD scan with a oscciloscope (4 event)

 

ADC12_Setup.jpg

 

According to PE configurations,  the samples  8~11 are got from ANB0.

Sample 8 -> ANB0 

Sample 9 -> ANB0

Sample 10 -> ANB0

Sample 11 -> ANB0

Sample 12 -> ANB2

Sample 13 -> ANB6

 

The PWM period is 125us

 

The PDB1 sync is set at 1us, 20us, 40us and 80us

 

Our intention is like below:

      PDB1 at 1us   ==> Sample 8 -> ANB0    ==> Halt

      PDB1 at 20us  ==> Sample 9 -> ANB0   ==>Halt

      PDB1 at 40us   ==>Sample 10 -> ANB0    ==>Halt

      PDB1 at 80us   ==> Sample 11 -> ANB0 / Sample 12 -> ANB2 / Sample 13 -> ANB6 ==> End (Intterrupt end of ADC scan)

 

We set the ADC work in independent triggered parallel mode. In source code, we configured ADC12_SCTRL as 0x00F0,  the ADCB should work as below:

      SC4  = 1 :  Sample 8  ==> Halt

      SC5 = 1 : Sample 9 ==> Halt

      SC6 =1 :  Sample 10 ==> Halt

      SC7 =1 :  Sample 11 ==> Halt

      SC12 = 0 : Sample 12 ==> Continue

      SC13 = 0 : Sample 13 ==> Continue

      SC14 = 0 : Sample 14 ==> Continue

      SC15 = 0 : Sample 15 ==> Continue

 

Unfortunately does not work!!!

The event end of ACD scan triggered every six synchronization hits of module PDB1 (monitored with oscilloscope). Then, the samples 11, 12, 13 are not acquired together as desired close to the last PDB1 synconization pulse.

 

We use the AN4608 and the AN4583 as reference. The difference in the application note AN4608  is that it 's used the scan control but in simultaneous parallel triggred mode.

 

UPDATE:

We try some change and we discover that if we change from independent mode to simultaneous mode all it works correctly!!!

As we desired the last three samples are acquired together at the last sync of PDB1 and than the event end of ACD scan triggered!!!

We believe that the problem is present only if the independent mode is set!!!

 

We think we are doing something wrong or there may be an error at microcontroller level!

 

Thanx for any help!

Marco

Outcomes