Hi, I am using C8051F023 micro controller in one of the board. When I try to read the on chip temperature sensor it gives me the data as 0x170. This temperature increases linearly(170 - 179) when i remove fan from my system.
The problem here is., how do i interpret this data and have a meaningful temperature data.
Configuration: ADC0CN = 0x00; /* ADC0 off; set data right-justified */ REF0CN = 0x07; /* enable temp sensor, on-chip VREF */ ADC0CF = 0x48; /* ADC conversion clock = 2.5MHz, Gain = 1 */ EIE2 = 0x02; /* enable ADC0 end of conversion interrupt */ ADC0CN = ADC0CN | 0x80; /* start the ADC - Right Justified */
AMX0SL = 0x08; //temperature sensor.
Thanks in Advance.
Regards, Ragavan.
you read the Datasheet for the chip!
You should also look in the manufacturer's website - they may well have extra information such as examples or application notes.
But none of this has anything to do with Keil!
Section 5.1, Figure 5.2 of c8051f02x.pdf
I'll second what Andy said: READ THE DATA SHEET ! I'm sure you have spent more time scratching your head and trying to figure out what's going on than it took me to find the answer to your question. Reading and understanding the data sheets for the devices you are working with should be the first step of ANY embedded project.
ND
http://bit.ly/iC5frB