FRDM-KE06 Thermistor value never changes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM-KE06 Thermistor value never changes

968 Views
seanbeatty
Contributor III

I have set-up the A2D on a FRDM-KE06Z board to monitor the Thermistor on channels 12 and 13, and also channel 15. The voltage I read on channels 12 and 13 never changes. Even though I put the board in the freezer for a couple hours, or touch a hot soldering iron to the Thermistor, I never see any change in the voltage. Any idea what's wrong?

Following is what I get for a channels 12, 13, 15, and some internal channels 22, 23, 29, and 30

     Thermistor High Volts: 2.474

     Thermistor Low Volts: 0.823

          Thermistor Temperature is: 25.0 degrees

     ADC Channel 15 Volts: 1.105

     Internal Temp sensor Volts: 1.461

          Internal Temperature is: 22.1 degrees

     Bandgap Volts: 1.067

     VREFH Volts: 3.301

     VREFL Volts: 0.000

I'm confident my A2D set-up is correct, since I get good readings on these other channels. That said, here's the A2D initialization code:

SIM_SCGC |= SIM_SCGC_ADC_MASK;    //Enable the clock to the ADC
//Clock must always be < 8MHz; must be < 4MHz in Low Pwr mode
ADC_SelectClock(ADC_BASE_PTR, CLOCK_SOURCE_BUS_CLOCK); // Bus Clock = 20MHz
ADC_SelectClockDivide(ADC_BASE_PTR, ADC_ADIV_DIVIDE_4); //20MHz / 4 = 5 MHz

   

ADC_SetMode(ADC_BASE_PTR, ADC_MODE_12BIT);

   

//Setup the pins assoc with the following channels to ADC only - no GPIO functionality
ADC_APCTL1 = ((uint16_t)1<<ADC_CHANNEL_AD12)|((uint16_t)1<<ADC_CHANNEL_AD13)|((uint16_t)1<<ADC_CHANNEL_AD15);

   

ADC_SetLongSample(ADC_BASE_PTR); // Longer Sample time - higher accuracy!

    NVIC_EnableIRQ(INT_ADC);    //enable the ADC interrupt in NVIC.
   //Interrupt enable bit in ADC_SC1 is enabled later

Reading the ADC is simple:

    uint32_t u32temp;   

    u32temp = ADC_SC1;

    u32temp &= ~ADC_SC1_ADCH_MASK;

    ADC_SC1 = u32temp | 0xC; //This initiates the A2D conversion

  while( !ADC_IsCOCOFlag(pADC) ); //Wait for the conversion to complete

  return ADC_ReadResultReg(pADC);

Any idea why the Thermistor voltage doesn't change with temperature?

Thanks for your help!

Sean

0 Kudos
5 Replies

506 Views
seanbeatty
Contributor III

I got another FDM-KE06Z board - I get the exact same results.

When I put 3.3V on the THER_A node, the high side of the Thermistor (the junction of RT1 and R9), I read only a slight increase, equivalent to 25.6 degrees. I would have expected 33.3 degrees. When I shorted THER_B, the low side of the Thermistor (the junction of RT1 and R10) to GND, I get 33.3 degrees, just as expected. Lastly, when I short THER_A to GND, I get 0, just as expected.

Most puzzling ... could there be a design problem with the board?

0 Kudos

506 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sean Beatty,

    I take the case which you have sent.

  Please stop to test the RT1 on the FRDM-KE06 now, because just as what I have told you in your case, this on board thermistor maybe wrong soldering when out of factory. You can find a real thermistor to replace the RT1 and test again.

  Besides, if you have the FRDM-KE02, you can use the RT1 on the FRDM-KE02, that thermistor is correct.

Wish it helps you!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

506 Views
seanbeatty
Contributor III

Thanks for your response, Mark.

I checked the voltages - they don't change. The values I read are as expected for a 10K resistor, which is the value of the Thermistor at 25 degrees.

I loaded your BIN file, and got the output below. It didn't change when I put my finger on the Thermistor, nor when I held the entire board directly in front of a space heater.

Hello, world... KINETIS

ADC triggered: 0x0bff

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bfa

ADC triggered: 0x0bfa

ADC triggered: 0x0bf9

ADC triggered: 0x0bfa

ADC triggered: 0x0bf9

ADC triggered: 0x0bfa

ADC triggered: 0x0bf9

ADC triggered: 0x0bfa

ADC triggered: 0x0bf9

ADC triggered: 0x0bfa

ADC triggered: 0x0bfa

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

ADC triggered: 0x0bf9

I'm not exactly sure what you mean by "in the I/O menu on the interface you can also read the ADC registers to check the setup". I'm using CodeWarrior Dev Studio 10.6. If you're referring to the Registers tab in the Debugger, I can easily see the details for my own code (see below), but I don't know how to attach to the BIN you provided.

pastedImage_0.png

Thanks again for your response!

Sean

0 Kudos

506 Views
mjbcswitzerland
Specialist V

Sean

You can read the ADC registers directly on the debug interface (using the SW that I attached) by:

1. Hit enter to get to the command line menu

2. Type 3 and enter to move to menu 3 (I/O)

3. enter "md 4003b000 l 8"

This will print out 8 long words at this address (which is the start address of the ADC register block)

However it sounds as though the NTC on your board is bad. Use a voltage source to change the terminal voltage to be absolutely sure of the ADC measurement (0..3.3V should give the corresponding ADC binary range).

It may be that there is simpy a 10k resistor soldered in instead of a thermister.

I see that the ADC converted value is fluctuating slightly, which is to be expected, and the value read corresponds to about 2.46V and corresponds accurately with the 10k ohm case.

Since your ADC value looks to be identical I would suggest that there is no SW error but instead you have a dud hardware. Unfortunately it looks like they ran out of NTCs when building your board so just plugged a resistor in there instead...

Regards

Mark

0 Kudos

506 Views
mjbcswitzerland
Specialist V

Hi

You should be able to measure a temperature difference just by touching the NTC.

Measure the voltages at the two pins to verify that they are indeed changing (that the NTC is really one) - also check that the voltages vary as expected and that each ADC input reads a value as expected.

I have attached a binary that you can load to your board which prints out the value read on PTF4 every second so that you can check with a different SW:

- output on the virtual COM port at 115200 Baud

- in the I/O menu on the interface you can also read the ADC registers to check the setup

Regards

Mark

http://www.utasker.com/kinetis/FRDM-KE06Z.html

0 Kudos