temperature sensor and two-stage amplifiler

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

temperature sensor and two-stage amplifiler

3,459 Views
emugine
Contributor I
I want to use the temperature sensor in the MC68HC908SR12.In data sheet
24.14.1 table 24-12,it said temperature slope:VDD=5V±10%,GAINA=2,GAINB=6
MIN 1.275 ADCsteps/C,Typ 1.338ADCsteps/C,Max 1.372ADCsteps/C,
I set

 AMGCR=81;//GAINA=2,GAINB=6
 AMSCR=34;
 AMCR=240;

as the expert told me,now I get ADC value 693 or 724,I want to know what
is the MC68HC908SR12 real temperature?any help will be appreciated.
 
Labels (1)
0 Kudos
2 Replies

420 Views
emugine
Contributor I

(724/(2*6))/1.338=45.09,

real temperature=45.09-20=25.09

am i right?

but the data keep from 695~724 even after a few hours or when I use the iron head  approach the cpu,did i set anything wrong?

help me.

0 Kudos

420 Views
emugine
Contributor I
I set
 
word  AD_word;
AMGCR=81;//GAINA=2,GAINB=6
AMSCR=34;//00100010
         //AMCDIV[1:0]=00 Analog Module Clock Divider Control Bits,
                  // Set AMCDIV1 and AMCDIV0 bits to
                  //zero for optimum analog module performance.
         //OPIFR =1 Amplifier Ready Interrupt Flag Reset,
                  //1 = Clear OPIF bit
         //OPIF=0 Amplifier Ready Interrupt Flag
                 // 1 = Two-stage amplifier output is ready
         //0
         //DOF=0  DC Offset Flag, This is a reserved bit.
         //CDIFR=1  Current Detect Interrupt Flag Reset,
                    //Writing a logic 1 to this write-only
                    //bit clears the CDIF bit.
         //CDIF=0 Current Detect Interrupt Flag,
                   //1 = Current detect interrupt has occurred
 AMCR=240;//11110000       Analog Module Control Register (AMCR)
 //PWR1 PWR0=1 1 CurrentDetectModule=On
                    //TemperatureSensor=On Two-StageAmplifier=On
 //OPCH1 OPCH0 1 1   Internal temperature sensor
 //AMIEN =0 Analog module CPU interrupt requests disabled
 //DO[2:0]=000 DC Offset Control Bits 
                //Set these bits to zero for optimum analog module performance.
 while(!AMSCR_OPIF);//wait for Amplifier Ready
 ADICLK=0x54;//01010100
            //010 ADIV2 ADIV1 ADIV0 ADC INPUT CLOCK/4
            //1   ADICLK  select internal clock
            //01 MODE1 MODE0 Right justified mode
 ADSCR=0x00|13;//select OPOUT
 while(!ADSCR_COCO);
 AD_word= (ADR0H&0x03)*256+ ADR0L;
 
thank you for your help again!
 
0 Kudos