Author Topic: Problems with internal temperature sensor - MCP3561  (Read 666 times)

0 Members and 1 Guest are viewing this topic.

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Problems with internal temperature sensor - MCP3561
« on: April 26, 2021, 10:17:09 am »
Hi.

I'm using a Microchip ADC (their forum is having problems, as I can't even register), MCP3561.
The problem should occur in the entire MCP346x and MCP356x family.

I need to read the internal temperature sensor. I know that the precision is nothing special, but it is just to get an idea.

Current status:
At this point I can write correctly and read all the registers.
I can get internal readings of "normal" and "inverted" Vref (via MUX) with saturation of the ADC FS as expected.
As recommended in the datasheet I have MUX[7:0] = 0xDE.
The OSR is high, so that the conversion frequency is low, OSR = 40960.
My Vref+ is a 2.5V reference and the Vref- is the AGND.

My circuit:


Problem:
When I read the ADCDATA register, the value changes a lot practically on all new readings (~ 146000 <-> ~150000), like some king of "step/jump".
Anyway, even if the value was stable, using the temperature conversion equation for a Vref of 2.5V, the value is wrong, as it would be around -119ºC (indoor temp ~25ºC).



temp[ºC] = 0.0013 * (2.5/3.3) * ADCDATA - 267.146 => 0.0013 * (2.5/3.3) * 150000 - 267.146 = -119.4ºC

Some help?
Is it normal the ADC value, with MUX=0xDE, fluctuating so much?
Is the temperature conversion equation really correct?


Thanks!
« Last Edit: April 26, 2021, 12:03:35 pm by Dave_PT »
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #1 on: April 26, 2021, 07:37:35 pm »
As expected, if I use the MUX to connect Vin+ and Vin- to the same point (for example the "Temp diode P"), the ADC converts the value to 0 (zero).

So far so good ... but I still have no explanation for the strange effect with Temp Diodes.


[EDIT]
If I invert the diode connections, the ADC conversion is approximately equal, but negative as expected.

So the conversion to IC Temperature continues to fail completely ....
« Last Edit: April 26, 2021, 07:54:25 pm by Dave_PT »
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #2 on: April 26, 2021, 10:55:43 pm »
 Setup:    confg_reg: 6 :    1101 1110       (0xDE)
 Readings:
 
   0000 0000    0000 0101    0111 1110    1000 0001       (0x00057E81)
   0000 0000    0000 0101    0111 1110    1000 1001       (0x00057E89)
   0000 0000    0000 0101    0111 1110    1000 1011       (0x00057E8B)
   0000 0000    0000 0101    0111 1110    1000 1011       (0x00057E8B)
   0000 0000    0000 0101    0111 1110    1000 1000       (0x00057E88)
   0000 0000    0000 0101    0111 1110    1000 1001       (0x00057E89)
   0000 0000    0000 0101    0111 1110    0111 1010       (0x00057E7A)
   0000 0000    0000 0101    0111 1110    1001 0000       (0x00057E90)
   0000 0000    0000 0101    0111 1110    1000 0101       (0x00057E85)
   0000 0000    0000 0101    0111 1110    1000 1001       (0x00057E89)

 Formula math:
 TEMP (C) = 0.00133 * ADCDATA (LSb) – 267.146   
 TEMP (C) = 0.00133 * 360073 * (2.048/3.3) - 267.146   = 30.06 <- seems wrong.

 But if I use second formula from DS:   
 V(in.mV) = 0.2964 * TEMP (C) + 79.32
 rearranging:
 TEMP (C) = (V(in.mV) -79.32) / 0.2964 = (86.616 - 79.32) /0.2964 = 24.6
 I have correct value.
 
 What is going on, is that when I calculate V(IN.mV) I use slope & offset correction factors,

          double        off_mVolt       = -0.000242;
          double        slp_mVolt       =  0.981872;
         
 First formula uses  raw hex data w/o correction, and result is off.
 Ones more:
           
 ADCDATA-correct = ((360073 *0.981872) --0.000242);
           
 TEMP (C) = 0.00133 *ADCDATA * (2.048/3.3) - 267.146   = 24.67
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #3 on: April 27, 2021, 08:45:19 am »
Thanks for the answer.

The big difference between my setup and yours, basically is Vref. I use a 2.5V Vref and you use a 2.048V.

However my reading is practically half of yours in mV ...

Your setup:

raw_adc = 360073

mv = (360073*2.048)/2^23 = ~87.9mV

My setup:

raw_adc = 150000

mv = (150000*2.5)/2^23 = ~44.7mV

It's too perfect to be just a coincidence ...
You are using the gain at x1, right?

Thank you again!
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #4 on: April 27, 2021, 12:18:49 pm »
 Here is confg_reg = 3;
    reg_bits = 0b10001011;

 boost = 10;  gain = 001, az-mux= 0
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #5 on: April 27, 2021, 01:43:41 pm »
So... you have all in default like me.

Very strange indeed.

Are you in "Continuous Conversion mode"?
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #6 on: April 27, 2021, 04:18:33 pm »
No, one conversion at a time. Here is a list of config-data I'm setting at start-up, anything else is default.
    confg_reg = 1;
    reg_bits = 0b00000010;
    reciv_16 = transreceive_16(reg_bits, 1);

    confg_reg = 2;
    reg_bits = 0b00111000;
    reciv_16 = transreceive_16(reg_bits, 1);

    confg_reg = 3;
    reg_bits = 0b10001011;
    reciv_16 = transreceive_16(reg_bits, 1);

    confg_reg = 4;
    reg_bits = 0b10100000;
    reciv_16 = transreceive_16(reg_bits, 1);

    confg_reg = 5;
    reg_bits = 0b00000010;
    reciv_16 = transreceive_16(reg_bits, 1);

    confg_reg = 6;
    reg_bits = 0b00100011; // (+)CH2 Diff
    reciv_16 = transreceive_16(reg_bits, 1);

It's about right time to ask where did you get your adc from? I had evaluation board  with fake IC (Europe located maker, ADC-9). Than I get just adc IC.  Fake unit was not able to provide specification at 10MHz+ external clock, same time good IC could operate at 25MHz+, AFAIR 
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #7 on: April 27, 2021, 04:33:22 pm »
Thank you very much.

I will try to do the same registers setup and see if I get any difference in value.

I IC was purchased directly from Digikey and mounted on a PCB designed by me, with the circuit of the previous image.

The IRQ pin is generating pulses at the correct frequency, taking into account the OSR and the 20MHz MCLK.

Everything indicates that this is an original Microchip IC.
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #8 on: April 27, 2021, 11:02:03 pm »
I don't understand your config register 6 (MUX), but I suppose it is another application.

Everything seems to be OK with the registers, but in fact the converted value remains very low. By the conclusion of the previous post, the value had to be double this.

I just checket my Vref, using my Keysight U128, and the value is 2.501V... so there is no problem with the reference.

 :wtf:
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #9 on: April 28, 2021, 12:09:14 am »
 My adc is mcp3562, reg-6 defines second diff input pair.

edit:
BTW, fake IC i find initially was UQFN packaged. Good ADC I get after that is in TSSOP-20
« Last Edit: April 28, 2021, 01:03:44 pm by MasterT »
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #10 on: May 05, 2021, 07:58:01 pm »
After a lot of debugging work, I activated the ADC's internal clock.
Everything started to work perfectly.

In other words, the original MCP3561 purchased from digikey, does not support the 20MHz clock that I was injecting.

PS: I can work with the ADC's internal prescaller and it seems to work ... keeping the external clock at 20MHz.
« Last Edit: May 05, 2021, 08:14:39 pm by Dave_PT »
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #11 on: May 29, 2021, 03:46:35 pm »
 HI, have you any progress with 20MHz ?
I get 4 more adc's from mouser last month, marked as mcp561R - according to DS legitimate markings to save space not printing full name mcp3561R.
Have same issue initially, adc stops to update converted register results after pushing clock up, than I realized to reconfigure BOOST settings. It has to be 2,
Reg-3
  bit 7-6 BOOST[1:0]: ADC Bias Current Selection
          11 = ADC channel has current x 2
          10 = ADC channel has current x 1 (default)
          01 = ADC channel has current x 0.66
          00 = ADC channel has current x 0.5
Even it's working up to 23-25 MHz, I still not satisfied with noise level and (!) linearity. Especially INL, that's about 10x times worse than mcp3550 has. Sampling rate above 1ksps doesn't make any sense to me, since noise level rising above what I can get from internal 12-bits adc stm32G4
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #12 on: May 31, 2021, 01:36:17 pm »
I have already replicated all these tests and in fact I also fell far short of expectations.

I have a "pure" input signal, resulting from several previous filters, however I can't get the desired sampling rate (10KHz) with an acceptable noise level.
Currently, with 2.5V Vref respecting all indications and good practices, I am getting variations of + -25uV, after doing avg of 60values with ~ 1.2KHz sampling (auto conversion).

I have almost no advantage in using this ADC ...
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #13 on: May 31, 2021, 01:52:58 pm »
I also tried to Lower frequency from 4.9152 MHz (default) to 1 /4 and even 1 / 8 using internal preselector. Linearity improves significantly, to +-1ppm - same as mcp3550, but since sample rate drops as well, have to lower OSR and consequently get very high noise level. Disappointed. 
 Thinking to get max11270 next month, they promised 130dB, 64kHz, and -122dB THD - well, not all this simultaneously.
Price biting, afraid to get fake again, will think over.
For today I want to play with ADS8691IPWR
 

Offline Dave_PT

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: pt
    • DavidMartinsEngineering
Re: Problems with internal temperature sensor - MCP3561
« Reply #14 on: May 31, 2021, 04:52:36 pm »
I didn't want to design and produce new PCBs  |O
This ADC is being a complete fail to my expectations ...

PS: using the ADC auto-zeroing algorithm, the result suffers little or no improvement ...
« Last Edit: May 31, 2021, 04:54:13 pm by Dave_PT »
 

Offline MasterT

  • Frequent Contributor
  • **
  • Posts: 523
  • Country: ca
Re: Problems with internal temperature sensor - MCP3561
« Reply #15 on: May 31, 2021, 05:44:00 pm »
I think microchip failed with MCP356X (& MCP3918 ).
What are you designing?
I
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf