MPC5744P ADC operate

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

MPC5744P ADC operate

605 Views
大大许
Contributor III

i using ADC mpc5744p example project to change,i want using adc to measure voltage in on shot mode by open MCR.NSTART to finish a convertion,but my code will create am error once operate adc regist. i don't how to modify this .

 SIUL2.MSCR[PE2].B.APC = 1; //Configure ADC0_AN5 to analog pad control function. Analog is default function so SSS says 0

  //ADC_0.NCMR0.B.CH2 = 1; //Enable channel 6 for normal conversion on ADC1

  if( ADC_0.MCR.B.PWDN == 0){     //this operate will making my project  run error
   ADC_0.MCR.B.PWDN = 1;
  }
  ADC_0.MCR.B.OWREN = 1;
  ADC_0.MCR.B.WLSIDE = 0;
  ADC_0.MCR.B.MODE = 0;
  ADC_0.MCR.B.ADCLKSEL = 1;

  ADC_0.NCMR0.B.CH2 = 1;
  ADC_0.MCR.B.PWDN = 0;

  

for()

{

     ADC_0.MCR.B.NSTART = 1;  //will auto clear
     while(ADC_0.ISR.B.ECH ==0);  
    volt = (ADC_0.CDR[2].B.CDATA);

}

Labels (1)
1 Reply

357 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, if you see our example list, there is several examples for MPC5744P's ADC:

https://community.nxp.com/docs/DOC-329623 

It could possibly help. What is your issue indeed?