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);
}
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?