AnsweredAssumed Answered

[MPC5744P]Problem about ADC trigger mode change

Question asked by UWin F on Jul 14, 2016
Latest reply on Jul 15, 2016 by Peter Vlna

My program execution process is as follows:

 

s1: ctu0 trigger adc0&1

s2: wait for ctu0 trigger end

s3: disable adc0&1 ctu trigger mode(ADC_0(1).MCR.B.CTUEN=0), and injection start(ADC_0(1).MCR.B.JSTART=1)

s4: wait for injection conversion end

s5: enable adc0&1 ctu trigger mode(ADC_0(1).MCR.B.CTUEN=1), and goto s1

 

i find after s5, the ctu0 could not trigger adc0&1 any more. i am sure that ctu0 works well(because i can enter the ctu0 trigger out interrupt)

 

i simple the process like this:

s1: ctu0 trigger adc0&1

s2: wait for ctu0 trigger end

s3: disable adc0 or adc1 ctu trigger mode(ADC_0( or 1).MCR.B.CTUEN=0)

s4: wait for "a period of time"

s5: enable adc0&1 ctu trigger mode(ADC_0(1).MCR.B.CTUEN=1), and goto s1

i find the result depends on "a period of time":

if "a period of time" is short, e.g., for(k=0;k<100;k++); then no err will happen, the ctu will trigger adc0&1 well

if "a period of time" is long,  e.g., for(k=0;k<1000;k++); then the result will be same with the above, the ctu could not trigger adc0&1 any more

 

i wander what's the problem? Is there any rule if i want to clear and re-Set "MCR.B.CTUEN" ?

 

Thank you very much!

Outcomes