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