Hi Thuy,
I been out on travel, so sorry I haven't been able to respond sooner. You have asked a lot of questions, and some of them relate to code and code examples. Unfortunately I have already given you the code I have and also unfortunately it was written for CCS and not IAR. It is up to you to understand how the compilers differ and interpret the errors you see. As to Grace, this is a configuration tool within CCS to setup the MSP430G2553.
Regarding how to read sequentially through the mux, you just set the appropriate mux channels to be read and then read the conversion results when DRDY transitions from high to low. Once you have read the results, you change the mux channel to the next set of inputs you wish to convert and then when DRDY transitions from high to low you read the results. You just keep repeating that sequence of events. If you are switching from a single ended measurement (4-20mA) and a PGA of 1, to the RTD with potentially a higher PGA, you will need to change the PGA setting to the appropriate value as well. So in this case, change the PGA, change the mux, then read the results. You would then repeat this process over and over. If you wish to use internal reference for the single ended measurements, and the Rbias/IDAC generated reference for the RTD, then you would add that register change as well to your mux change loop. As you can see, there are many combinations of change. I would suggest you write pseudo code of the process you wish to do and then just write the register values with respect to your process.
The rest of your questions are really engineering questions that pertain to your system. I can try to help you understand the functionality of the ADS1248 and the basic knowledge for what you are trying to do, but in the end you will need to engineer your project.
Let's start with a review of what happens with the ADS1248. This ADC converts some input voltage to a digital representation of the input voltage based on the reference voltage. The full-scale measurement range of the ADS1248 is based on the reference voltage and any gain that is applied. In other words, you can measure an analog input voltage as long as the input voltage is within the common mode input range which we talked about in an earlier post. If the reference is the internal reference, which is 2.048V, then the full-scale range is +/-2.048V at a gain of 1, and is represented by 2^24 codes. If we apply higher gain, then the full-scale range reduces. The value of one code (LSB) also changes. If the reference voltage changes, the full-scale range changes and this also affects the value of one code (LSB).
When determing temperature from an RTD, remember the output code is a voltage representation. As the RTD is a resistive device, you must excite it in some way to determine the value of resistance of the RTD as it changes over temperature. The best way to do this is excite the RTD with current. There will be a voltage drop across the RTD that can be measured by the ADS1248. From the code result, which is just a number, you need to determine the voltage value. Once you know the voltage you can find the resistance by Ohm's Law. Once you have the resistance you can either calculate the value or use a lookup table to determine the temperature. This is a very intensive set of calculations.
The last question was about Rbias. It serves two purposes. The first is to establish the RTD measurement to within the correct common mode for the ADS1248. The best value to set for common mode is 1/2 of AVDD supply. If you use 5V for AVDD, then 2.5V would be appropriate. Why do I use mid-supply? This is to keep the RTD within the correct common mode range for any PGA gain setting you might use. You could use a lower common mode voltage as long as you maintain the correct input range for the PGA setting you wish to use.
The second purpose of Rbias is to establish a ratiometric measurement to lower the overall noise of the measurement. The actual value you use for this resistor is dependent on the common mode voltage (which changes if you change AVDD) and the amount of current you decide to use to excite the RTD. The value of 2k will place the Rbias just under mid-supply of AVDD when exciting with 500uA of current and using a 3-wire PT100. If you wish to change the Rbias so the common mode voltage is closer to mid-supply then you would just use Ohm's Law to figure out the value. 2.49k will bring you closer, but also remember that the reference value also establishes the full-scale range and the LSB size. This also relates to the PGA setting as well. To decide which PGA value is best will be determined by the temperature range you wish to measure, and the dynamic range for maximum effect. You will need to decide by calculating various combinations of reference voltage/PGA combinations to see what works best for your system.
Best regards,
Bob B