LTC5587IDD cannot work as expected

Hello,

I purchased one LTC5587IDD eval board and tried to play with arduino via SPI interface, but i find out the value i read out is around 450 Bits even i connected nothing. can anyone help me on it.

my code is as simple as below.  can anyone point out where am i wrong?

//send a convert signal
void SampleRF(){
  digitalWrite(CONV,HIGH);
  delay(1);
  digitalWrite(CONV,LOW);
  delay(1);
}
//read out out the 12bit value from 2x8bit data buffer 
int16_t readRF(void){
  int16_t temp = 0;
  SampleRF();
  temp = SPI.transfer(0xff);
  temp<<=8;
  temp|=SPI.transfer(0xff);
  temp>>=4;
  return temp;
}
void loop(){
  int16_t value = readRF();
  Serial.print(value);
  Serial.print("-");
  Serial.println(value*0.014);
  delay(1000);
}

Parents Reply
  • 0
    •  Analog Employees 
    on Apr 30, 2020 1:48 AM in reply to ericyuan

    hi,

    depends on how you transfer the data from buffer.

    if you transfer 8 bits at a time from the buffer, shift the first byte, B11-B4 to <<4. and transfer second byte, and shift to the >>4, then add the values of the two byte together.

    if you transfer 2 byte, 16bits at the same time, then shift>>4. 

    (adc count/4096)*1.8V=vout. that should be equal to the analog vout on the ltc5587 eval board.

    andy

Children