AnsweredAssumed Answered

AD7367 did the conversion, but, the converted digital data does not make sense?

Question asked by Peter109 on Sep 28, 2017
Latest reply on Oct 1, 2017 by jcolao

Dear Friends:

I used AD7367 to convert, and pic18f4553 to control and read. the schematic circuit diagram is attached. and the conversion result is also attached. the analog input is a linear scan in potential from 0.2 to 1.2.. as you can see the data does not make sense. what are the possible problems?

 

the following is the PIC18f4553 code is as follows:

CNVST=0; //conversion start
CNVST=1; //

 

data16A=0; // these are two 16 bits variable
data16B=0;// these are two 16 bits variable


CS=1;
SCLK=1;
while (Busy==1){
}

CS=0;
coun=0;


while (coun!=14){                        // the following is for pic18f4553 to read the 14 bits converted data
SCLK=0;
if (DoutA==1){                           //determine whether the Dout A pin is 1 or 0
data16A=data16A|0x01;          //set the reading into data16A
}else{
data16A=data16A&0xFE;
} //dataLx, dataHx, dataLy, dataHy,
data16A=data16A<<1;            //left shift 


if (DoutB==1){                           //similar to Dout A, the following is to read DoutB
data16B=data16B|0x01;
}else{
data16B=data16B&0xFE;
}
data16B=data16B<<1;


SCLK=1;
coun=coun+1;
}                                                                                 //reading complete

dataLx=data16A;                                                      // the following is to split 16 bits data16A and data16B into two 8 bits
dataLx=dataLx&0b01111111;
dataHx=data16A>>7;
dataHx=dataHx&0b01111111;

dataLy=data16B;
dataLy=dataLy&0b01111111;
dataHy=data16B>>7;
dataHy=dataHy&0b01111111;

 

<pic18f4553 send via rs232>                              // this part has no problem

Outcomes