43oh

## Recommended Posts

Hi sir,

Have you guys look into the TI workshop for MSP430? I've just finished the workshop on the ADC in Lab4 and I have a few question to ask.

Is it the ADC for MSP430 is for measure temperature only?

In step 8, why is it that we use INCH_10 to select the temperature sensor? Is it INCH_10 for temperature sensor only?

As for the measurement value it produce (tempraw), what is 734 means? How do we convert it to a standard temperature value like 26 degree Celcius for room temperature?

##### Share on other sites

Is it the ADC for MSP430 is for measure temperature only?

In step 8, why is it that we use INCH_10 to select the temperature sensor? Is it INCH_10 for temperature sensor only?

As for the measurement value it produce (tempraw), what is 734 means? How do we convert it to a standard temperature value like 26 degree Celcius for room temperature?

The ADC10 supports multiple external input channels and has various internal ones as well (where channel 10 is the internal temperature sensor). So, INCH_10 specifically selects the internal temperature sensor.

The raw value as generated from the ADC10 can be converted into a voltage using the formula provided in the section 22.2.1 of the MSP430x2xx Family User's Guide (assuming that the ADC10 is configured for straight binary format):

```tempraw = 1023 * (Vin - Vr-) / (Vr+ - Vr-)
```

SREF_1 is set and the reference is 1.5V, Vr+ is 1.5V and Vr- is Vss (0V), the formula ends up being:

```tempraw = 1023 * Vin / 1.5 =>
Vin = tempraw*1.5 / 1023
```

From the voltage the temperature can be calculated by using the formula in section 22.2.8 of the User's Guide:

```V=0.00355(TEMPC)+0.986 =>
TEMPC = (V-0.986)/0.00355
```

A tempraw value of 734 corresponds to 1.08V, which in turn corresponds to 25.4 degrees celcius.

##### Share on other sites

What xpg said. One thing to be aware of is that the offset (error) for a particular part can be as much as as 20 degrees in either direction, making calibration pretty important. In fact, in higher-end parts, the measured ADC values at at 30 Cel and 85 Cel for each reference voltage are stored in the TLV section , and measurement is done by linear interpolation between those values rather than assuming a fixed delta per degree. Strong recommendation to at least do a single-point calibration.

INCH_11 is also interesting as it measures V_MID (V_CC/2.0), letting you know what voltage is being provided to the chip. This can give you an indication that battery levels are dropping enough to affect the performance of other components on the board, and help ensure comparability for measurements over time or between devices that might be influenced by available power (such as a radio).

Other ADC applications include soil moisture sensors, ambient light intensity measurement via a photo diode or resistor, etc.

##### Share on other sites

Is it the ADC for MSP430 is for measure temperature only?

In step 8, why is it that we use INCH_10 to select the temperature sensor? Is it INCH_10 for temperature sensor only?

As for the measurement value it produce (tempraw), what is 734 means? How do we convert it to a standard temperature value like 26 degree Celcius for room temperature?

The ADC10 supports multiple external input channels and has various internal ones as well (where channel 10 is the internal temperature sensor). So, INCH_10 specifically selects the internal temperature sensor.

The raw value as generated from the ADC10 can be converted into a voltage using the formula provided in the section 22.2.1 of the MSP430x2xx Family User's Guide (assuming that the ADC10 is configured for straight binary format):

```tempraw = 1023 * (Vin - Vr-) / (Vr+ - Vr-)
```

SREF_1 is set and the reference is 1.5V, Vr+ is 1.5V and Vr- is Vss (0V), the formula ends up being:

```tempraw = 1023 * Vin / 1.5 =>
Vin = tempraw*1.5 / 1023
```

From the voltage the temperature can be calculated by using the formula in section 22.2.8 of the User's Guide:

```V=0.00355(TEMPC)+0.986 =>
TEMPC = (V-0.986)/0.00355
```

A tempraw value of 734 corresponds to 1.08V, which in turn corresponds to 25.4 degrees celcius.

Thanks for the calculation. It is really useful!

What is the reference voltage 1.5V or 2.5V for? Hoe do we know which to choose?

If I use the other channel of the ADC to measure other values other than the temperature, do I need to calculate like that too?

##### Share on other sites
What xpg said. One thing to be aware of is that the offset (error) for a particular part can be as much as as 20 degrees in either direction, making calibration pretty important. In fact, in higher-end parts, the measured ADC values at at 30 Cel and 85 Cel for each reference voltage are stored in the TLV section , and measurement is done by linear interpolation between those values rather than assuming a fixed delta per degree. Strong recommendation to at least do a single-point calibration.

INCH_11 is also interesting as it measures V_MID (V_CC/2.0), letting you know what voltage is being provided to the chip. This can give you an indication that battery levels are dropping enough to affect the performance of other components on the board, and help ensure comparability for measurements over time or between devices that might be influenced by available power (such as a radio).

Other ADC applications include soil moisture sensors, ambient light intensity measurement via a photo diode or resistor, etc.

I'm currently using MSP430G2231 which is from the MSP430 LaunchPad Development Tool. From the data sheet, it is a ADC10 which is a 10 bit ADC and 8 channel. Does 8 channel means we can have 8 inputs connected to the I/O pins (measuring 8 items)?

From the header file (MSP430G2231.h), why is it there is INCH_0 to INCH_15 which is Channel 0 to Channel 15? I thought MSP430G2231 only has 8 channel?

And you mentioned INCH_11 as a V_MID measurement. Is it that from Channel 0 to Channel 7 is for external measurement? And Channel 8 to Channel 15 is for internal measurement?

##### Share on other sites
I'm currently using MSP430G2231 which is from the MSP430 LaunchPad Development Tool. From the data sheet, it is a ADC10 which is a 10 bit ADC and 8 channel. Does 8 channel means we can have 8 inputs connected to the I/O pins (measuring 8 items)?

No, you can have six inputs connected to the pins that have A0 through A5 as functional selections. The other two channels go to temperature and V_MID.

From the header file (MSP430G2231.h), why is it there is INCH_0 to INCH_15 which is Channel 0 to Channel 15? I thought MSP430G2231 only has 8 channel?

That specific MCU does, but the header uses the same definitions for all MCUs in the product family. The ADC10 can have up to 12 channels in some MCUs, so TI probably just reserved a 4-bit channel number and gave value labels to cover the space.

And you mentioned INCH_11 as a V_MID measurement. Is it that from Channel 0 to Channel 7 is for external measurement? And Channel 8 to Channel 15 is for internal measurement?

No, the external measurement channels will be mapped to processor pins. They will probably start with A0 (=INCH_0). I believe 10 and 11 are consistently used for those specific internal measurements; other special-purpose chips may provide additional internal measurements on other channels.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
• Blog

• #### Activity

×
• Create New...