Part Number: ADS1248
I am using ADS1248 for temperature measurement using an RTD. I am receiving data from ADS1248 successfully. But always my very first conversion result is showing a wrong value. I connected a fixed resistance of 100 ohm instead of RTD for debugging. As a result I am observing a value like '6467667' or '6568120' as my first result. Later on I am getting values like '6217041' or '62170248' as conversion results from ADS1248. After the first result, the result is stable at a value within range of '6200000' which is more correct. That is when converted back to resistance, values in this range is more close to 100 ohm. I am always getting first result in the range of '6400000' and later on the values will be in the range of '62000000'. I am attaching the code below. Can you please tell me what is happening here. Since if this happens for every first reading after an input channel change then it will be a large problem for my code.
I suspect that the input signal has not finished settling after the multiplexor changes. Please see section 22.214.171.124 Settling Time for Channel Multiplexing and table 14 for additional details on the length of delay that should be incorporated into the code before taking valid data.
Alex SmithApplications Engineer | Precision Delta-Sigma Converters
Check out our helpful resources: BIO-FAQ: Common Questions for TI's ADS129x Family of Bio-Potential ADCs
TI Precision Data Converters | TI Precision Labs - ADCs | Analog Engineer's Calculator | Data Converters Learning Center | Selection Guide
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Alexander Smith:
As always thank you very much for your speedy response.
Alexander SmithPlease see section 126.96.36.199 Settling Time for Channel Multiplexing and table 14 for additional details on the length of delay that should be incorporated into the code before taking valid data.
I have actually considered this and consulted table 14 prior to writing the code. My data rate is set at 80 SPS. So from table 14 the delay time for first conversion result after a configuration register write is 12.719 milli seconds.
my code is as follows,
// Register configuration of ADS1248
SpiaRegs.SPITXBUF = 0x1643; // Send the SDATAC command and WREG Command 1st byte
SpiaRegs.SPITXBUF = 0x0044; // WREG Command 2nd byte and SYS0 register value
SpiaRegs.SPITXBUF = 0x4101; // WREG Command 1st byte and 2nd byte
SpiaRegs.SPITXBUF = 0x0020; // VBIAS register value and MUX1 register value
SpiaRegs.SPITXBUF = 0x4A01; // WREG Command 1st byte and 2nd byte
SpiaRegs.SPITXBUF = 0x0503; // IDAC0 and IDAC1 value
SpiaRegs.SPITXBUF = 0x4000; // WREG Command 1st byte and 2nd byte
SpiaRegs.SPITXBUF = 0x0A04; // MUX0 value and and SYNC command
while(SpiaRegs.SPIFFRX.bit.RXFFST < 9 );
GpioDataRegs.GPASET.bit.GPIO14 = 1; // Clear CS/ pin to high
GpioDataRegs.GPACLEAR.bit.GPIO14 = 1; // Clear CS/ pin to low
SpiaRegs.SPIFFRX.bit.RXFIFORESET = 0;
SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1;
// Receive conversion result from ADS1248
SpiaRegs.SPITXBUF = 0xFF12; // NOP and RDATA
SpiaRegs.SPITXBUF = 0xFFFF; // NOP commands
SpiaRegs.SPITXBUF = 0xFF04; // NOP commands
while(SpiaRegs.SPIFFRX.bit.RXFFST < 3);
r1 = SpiaRegs.SPIRXBUF;
r1 = SpiaRegs.SPIRXBUF;
r1 = r1<<8;
r2 = SpiaRegs.SPIRXBUF;
r1 = r1|r2>>8;
In this code after writing to configuration registers I have given SYNC command immediately. After 13 milli seconds (line 15 in code snippet) I am starting to read data considering the time for conversion is 12.719 milli seconds. Since 13 milli seconds is sufficiently higher that what being asked 12.719 I should get data, this was my thought. But what I observed is that if am giving a delay of 25.5 milli seconds or greater that is approximately twice as that of 12.719 milli seconds I am getting my first data correctly. What will be the reason for extra 12.719 milli seconds ?
I apologize I didn't get this correctly. I didn't understand what is meant by 'split the communication into two separate communications'. I am writing to MUX0 and SYS0 in different words is that enough for separate communication. Or should I write to SYS0 first and after other commands write to MUX0 as seen in the code snippet above. My data rate is fixed at a single setting all the time likely to be at 80, so if am not changing SYS0 value in between will this overload problem occur though I am changing MUX0 value frequently?
And I have another question, is there is any other method to poll for DRDY/ pin rather than using interrupt to observe it's status for data ready.
In reply to Vineeth N:
This is referring to changing the gain of the PGA and the MUX.
For example, say we have a reference voltage of 2V, and two channels to measure, CH1 = 0.25V, CH2 = 0.5V.
In order to maximize our input range, when measuring CH1, our PGA will gain the signal by 8. When measuring CH2, our PGA will gain the signal by 4.
CHx -> PGA -> Modulator
CH1 (0.25V) -> PGA (8) -> Modulator
>>Communication to change MUX to CH2 and PGA to 4 // For a brief moment, the device may see:
CH2 (0.5V) -> PGA (8) -> Modulator
// before changing to:
CH2 (0.5V) -> PGA (4) -> Modulator
If we write the MUX and PGA gain change in the same communication, it's possible that the MUX will change before the PGA, leading to an over-voltage on our modulator, and the chopper losing stability.
I think writing in different words is sufficient and I don't think this is the problem since SYS0 value is not changing, only the MUX0 value.
What is the clock frequency that you are using? Notice the (1) note under table 14 specifying 4MHz.
Using the interrupt or writing the read data command (non-continuous) is the best way to read back data from the device.
Thank you for the info.
Alexander SmithWhat is the clock frequency that you are using? Notice the (1) note under table 14 specifying 4MHz.
My system clock frequency is 100 MHz and SPI clock frequency is 1 MHz.
Alexander SmithUsing the interrupt or writing the read data command (non-continuous) is the best way to read back data from the device.
I think you got me wrong here, I will rephrase. What I was asking is that other than using the interrupt is there is any other way to check the status of data ready pin to understand that the conversion is complete. My idea was to pulse the START pin and observe DRDY pin.Since I thought DRDY will stay at HIGH state after pulsing START pin and will only go to a LOW state after conversion is complete. But it didn't work as expected. Or will the DRDY stay at HIGH state till conversion completion after START pulse?
I am curious in one thing specifically. Suppose if I given only one START pulse for obtaining a single conversion. After the conversion result is ready, how much time will the ADC retain this data without fail.
Do you mean your MCU clock is 100MHz? 100MHz is well out of range for the ADS1248, which is specified to be between 1 - 4.5MHz.
What is the clock frequency being used for the ADS1248? Are you using internal clock?
9.4.4 Conversion Control in the datasheet gets into this form of polling for data. After pulsing START, DRDY will stay high until the conversion is complete. If you are pulsing START too often, the device may not have enough time to complete the conversion before starting a new one.
The ADC should retain the data as long as necessary until START is pulsed again, signaling to start a new conversion.
Sorry for the delay.
Alexander SmithDo you mean your MCU clock is 100MHz?
Yes, My 280049 micro is working at 100 MHz.
Alexander SmithWhat is the clock frequency being used for the ADS1248? Are you using internal clock?
ADS1248 is working at 4.096 MHz internal clock. SPI clock frequency is at 1 MHz.
I see, that should be fine then. Is it possible that the MUX switching is causing a reflection and the analog inputs themselves have not settled before resuming data collection?
Alexander Smith it possible that the MUX switching is causing a reflection
Sorry, I didn't get this part.
Alexander Smiththe analog inputs themselves have not settled before resuming data collection?
If you are asking whether my analog inputs keep on changing, yes it is. I am trying to measure temperature using this setup. As of now I have only conducted experiments using a single channel of ADS1248. I have a strong doubt that will this problem arise every time when I try to switch channels of ADS1248.
The input MUX of the device switching may send a transient to the input load cells, impacting the next voltage measurement. This is known as a reflection. Depending on the impedance, distance, etc. will change the magnitude of this affect and the time it will take for the analog inputs to settle after the MUX switches. Verifying whether or not this happens on all channels or only one channel would be a good data point to have as well.
Alexander SmithVerifying whether or not this happens on all channels or only one channel would be a good data point to have as well.
I will look into this and get back to you with results ASAP.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.