Post Go back to editing

LTC2983 Still returning -999, using Arduino Due and Demo board 2210A

Hello,

I'm trying to make my Arduino Due work with the Demo board 2210A, but it's look like I can't!

The communication seems to be ok, since if I remove it, I have an error, and if I remove the 2210A from the 2209A I have another type of error.

For now the 2209A is connected to the 2210A, I have a 1K connected between ch1 and ch2 as Rsense. I have 1k connecteed on pine 3 and 4, and a PT1000 between CH2 and Ch3

The CH 2 is connected to CH 4 either.

This is the code I'm using:

  Sensor_1_9.begin();
  retStatus = Sensor_1_9.setupSenseResistor( SENSE_RESISTOR_CH, RREF_PT1000 );
  retStatus = Sensor_1_9.setupRTD( ECS_IN_CH3, LTC298X_TYPE_PT_1000, SENSE_RESISTOR_CH, 2, LTC298X_MODE_SR, RTD_CURRENT_50uA, RTD_CURVE_EUROPEAN );
  retStatus = Sensor_1_9.setupRTD( ECS_OUT_CH5, LTC298X_TYPE_PT_1000, SENSE_RESISTOR_CH, 2, LTC298X_MODE_SR, RTD_CURRENT_50uA, RTD_CURVE_EUROPEAN );

  Sensor_1_9.reject6050Hz();
  Sensor_1_9.reportCelsius();

To read i'm using this:

  Sensor_1_9.selectConversionChannels( channel );
  Sensor_1_9.beginConversion( channel );
  do {
    isDone = Sensor_1_9.isDone();
  }
  while( isDone == 0 ); // wait until conversion is finished

  temperature = Sensor_1_9.readTemperature( channel );

And the library:

void LTC298X::reportCelsius(void) {
	uint8_t tmp = read8(LTC298X_ADDR_CONFIG_GLOB); //preserve old rejection settings
	this->write8(LTC298X_ADDR_CONFIG_GLOB, tmp & ~0x04); //unset B[2]
}
/*
 * Reject 60 and/or 50 Hz AC noises (75dB @ 1 ms MUX). Select single rejection for 120dB rejection.
 */
void LTC298X::reject6050Hz(void) {
	uint8_t tmp = read8(LTC298X_ADDR_CONFIG_GLOB) & ~0x03; //clear rejection bits and preserve reporting unit
	this->write8(LTC298X_ADDR_CONFIG_GLOB, tmp | LTC298X_REJECT_6050HZ); //set new rejection setting B[1:0]
}
*
 * Start sampling of ADCs. INTERRUPT will go LOW while conversion. If done, it toggles HIGH.
 */
void LTC298X::beginConversion(uint8_t ch) {
	if (ch > 20 || ch == 0) return;
	this->write8(LTC298X_ADDR_CMD, LTC298X_CMD_BEGIN | ch);
}
void LTC298X::beginMultipleConversion(void) {
	this->write8(LTC298X_ADDR_CMD, LTC298X_CMD_BEGIN); //B[4:0] = 0
}

/*
 * Setup a RTD on a given channel.
 * Params:
 * ch          | Channel (2-20) to use. CH - 1 is always used. CH - 2 is used on 3-wire and 4-wire RTDs. CH + 1 is used on 4-wire RTDs.
 * type        | Any from LTC298X_TYPE_PT_10 to LTC298X_TYPE_NI_120
 * sr_ch       | Channel (2-20) of sense resistor
 * wires       | Number of wires (2-5), while 5 equals to 4-wire and Kelvin Rsense
 * cs_rotation | Current source rotation (only available for > 2 wires)
 * sr_sharing  | Sense resistor sharing, internal grounding
 * current     | Current used for open circuit detection. Any from RTD_CURRENT_5uA to RTD_CURRENT_1mA
 * curve       | Can be any of RTD_CURVE_EUROPEAN, RTD_CURVE_AMERICAN, RTD_CURVE_JAPANESE, RTD_CURVE_ITS_90
 */
bool LTC298X::setupRTD(uint8_t ch, uint8_t type, uint8_t sr_ch, uint8_t wires, uint8_t mode, uint8_t current, uint8_t curve) {
	if (ch < (2 + (wires > 2)) ||
	    (ch + (wires >= 4)) > 20 ||
	    sr_ch < 2 ||
	    sr_ch > 20 ||
	    wires < 2 ||
	    wires > 5 ||
	    (wires < 4 && mode == LTC298X_MODE_CS_SR) ||
	    mode > LTC298X_MODE_CS_SR ||
	    type < LTC298X_TYPE_PT_10 ||
	    type > LTC298X_TYPE_NI_120
	) return false; //invalid
	//remove unnecessary casts
	uint32_t transmit = type;                //B[31:27]
	transmit <<= 5; transmit |= sr_ch;       //B[26:22]
	transmit <<= 2; transmit |= wires - 2;   //B[21:20]
	transmit <<= 2; transmit |= mode;        //B[19:18]
	transmit <<= 4; transmit |= current;     //B[17:14]
	transmit <<= 2; transmit |= curve;       //B[13:12]
	transmit <<= 12;                         //B[11:00] unused for predefined RTD
	this->write32(LTC298X_ADDR_CONFIG_CH1 + (ch - 1) * 4, transmit); // 0x200 + ch-1*4

	return true;
}

Anything Popout of your head of what's not working

  • Hi,

    I’m working on your case right now. Rest assured that I will get back to you as soon as possible.

    Regards,

    Mae

  • ICool thanks.

    I can send the whole code is not that big

  • Hi   - can you confirm your wiring configuration? You mention CH1-CH2 being Rsense, CH2-CH3 is a PT1000, and a fixed 1k resistor between CH3-CH4 , but then you also mention CH2 is connected to CH4? That wire is unnecessary - the current can flow through the PT1000 from Rsense to the 1k. Additionally the wire would cause the 1k and the PT1000 to be in parallel when the PT1000 was being measured (CH3 grounded internally). 
    However, your code shows channels 3 and 5 configured - so maybe the first part was a typo? Please confirm. 

    -Logan
    P.S. the LTC2983 demo software can validate configurations as well as generate arduino compatible code for a given configuration. It may be worth taking a look at. 
    www.analog.com/.../ltc2983.html

  • First of all thnaks for the time you take to help me.

    I did use the Demo software to cread the base of the design and to look into the code, but I wasn't not able to compile it for my arduino due. Even when I follow the Going Generic paper

    Hmm some mistake on the wiring part, so here it is:

    ch1-ch2 Rsense

    ch2-ch3 PT-1000

    ch4-ch5 1k resistor (just to check a vlue)

    In shared mode the Demo tool tell me that I have to like the ch2, to ch4,ch6 and so on.

    And I look onto the demmo code, and I have to do the mesur on ch3, and ch5, that's why you are seeing it.

  • the demo software look for a util/delay.h who I can't find anywere!!

    ResolveLibrary(util/delay.h)
      -> candidates: []
    /Users/arno/Documents/Arduino/libraries/LT_I2C/LT_I2C.cpp:83:24: fatal error: util/delay.h: No such file or directory
     #include <util/delay.h>
     

    And same for LT_SPI.cpp

  • OK - that makes sense, thank you.

  • Sounds like you may not have the LTSketchbook added to your Arduino environment - see the section on How to run Example Code here: 
    github.com/.../Linduino

  • Ok ; was able to go a step further, the reset give me some trouble. connecting the reset from the LTC2983 to the reset of the Arduino Due is not working. I have to use another pin, and do the reset manually.

    So Now I can speak (I think) to the LTC, but still I'm getting this error:

    19:01:03.254 -> Begin Conversion ch: 3
    19:01:03.400 -> Voltage: -0.4878
    19:01:03.400 -> Read error: 11001011
    19:01:03.400 ->   FAULT DATA = 11001011
    19:01:03.400 ->   - SENSOR HARD FALURE
    19:01:03.400 ->   - ADC_HARD_FAILURE
    19:01:03.400 ->   - SENSOR_ABOVE
    19:01:03.400 ->   - ADC_RANGE_ERROR
    19:01:03.400 -> Temp ECS_IN: -999.00
    19:01:03.400 ->
    19:01:03.400 -> Begin Conversion ch: 5
    19:01:03.578 -> Voltage: -0.4878
    19:01:03.578 -> Read error: 11001011
    19:01:03.578 ->   FAULT DATA = 11001011
    19:01:03.578 ->   - SENSOR HARD FALURE
    19:01:03.578 ->   - ADC_HARD_FAILURE
    19:01:03.578 ->   - SENSOR_ABOVE
    19:01:03.578 ->   - ADC_RANGE_ERROR
    19:01:03.578 -> Temp ECS_OUT: -999.00
    19:01:03.578 ->
    19:01:03.578 -> Begin Conversion ch: 7
    19:01:03.722 -> Voltage: -0.4878
    19:01:03.722 -> Read error: 11001011
    19:01:03.722 ->   FAULT DATA = 11001011
    19:01:03.722 ->   - SENSOR HARD FALURE
    19:01:03.722 ->   - ADC_HARD_FAILURE
    19:01:03.722 ->   - SENSOR_ABOVE
    19:01:03.722 ->   - ADC_RANGE_ERROR
    19:01:03.722 -> Temp ECS_MIX: -999.00
    19:01:03.722 ->
    19:01:03.722 -> Begin Conversion ch: 9
    19:01:03.900 -> Voltage: -0.4878
    19:01:03.900 -> Read error: 11001011
    19:01:03.900 ->   FAULT DATA = 11001011
    19:01:03.900 ->   - SENSOR HARD FALURE
    19:01:03.900 ->   - ADC_HARD_FAILURE
    19:01:03.900 ->   - SENSOR_ABOVE
    19:01:03.900 ->   - ADC_RANGE_ERROR
    19:01:03.900 -> Temp PAC_OUT: -999.00
    1

    And I think I'm communicating, since If I remove the CS, I have a timeout when I try to read temp on CH3

    By the way is the Capacitor on each channel to the ground can be an Issue ? On the datasheet it var between 10pf, to 100pfand I have 10nf

  • 10nf is a bit much - for resistive sensors the LTC2983 generates the excitation current for each conversion - so whatever voltage is developed across the sense resistor and the sensor has to settle before an accurate reading can be made. If the time constant of the RC network is too large, you will see an error in the reading. 

    You can use the mux_delay setting to increase the settling time at the cost of slower output data rate. 

    Something still doesn't look right with the results - why are you seeing -0.48V on all channels? Are you able to check it with an oscilloscope? 

    To make sure you are communicating with the LTC2983 correctly, try to read back any of the configuration data. The configuration and result registers are SPI RAMs and can be read and written. 

    -Logan