Hi Jingjing Zhou,
Thank you very much for your reply,
1.Code size : I created hex file and I see the value is about 35Kbyte. Do you know how to check code size of some line code ? please teach me.
2. Temp Sensor.
I was wrong in choosing Temp Sensor Slope. I check The Temp Sensor Slope is 1.62 mV/C typical values and VTemp25 716. I refer to this doc KL05P48M48SF1, Data Sheet: Technical Data, Rev 4 03/2014.
Thank you for this point , I understand the Temp Sensor Slope.
[code]/PMC_REGSC |= PMC_REGSC_BGBE_MASK;// Enable bandgap.
(void) ADC0_MeasureChan(1,0);// Measure
ADC0_GetChanValue(0,&ADC_BG);// Get value ADC from BANDGAP
calcVDD=4095*1*10/ADC_BG;// 4095=2^12 bit ADC.
ADC_temp25=4095*0.716*10/calcVDD;// Vtemp25=0.716 V, f ADC=2MHZ;
while(1){
(void) ADC0_MeasureChan(1,1);
ADC0_GetChanValue(1,&ADCR_temp);
ADC_m=(4095*0.00162*10*100)/calcVDD;
Temp=(25-(ADCR_temp-ADC_temp25)*100/ADC_m);
}
[code]
I modified and the result is same the old one, i think.
and another thing , I also want to send this value by UART to terminate (PC), the value is 16bit, but UART just only send max 10 bit. Please give me some advise on this situation , if you have sample code is great. :smileywink:
Minh.