decimal calculations for temperature controller

Status
Not open for further replies.

neels

New Member
hi frndz,
m new to microcontrollers.me want to build a temperature controller using 89c51 and LM35 as a sensor. i need to show temperature with accuracy of 0.1 degree C. whats the method for making decimal calculations with 89c51.m using assembly language.
thankyou.
 
You can use Fixed Point Notation. This just uses the same method you use to make decimal numbers fractional.

35.6 in decimal = 3*10^1 + 5*10^0 + 6*10^-1

10.11 in binary = 1*2^1 + 0 *2^0 + 1*2^-1 + 1*2^-2 = 2.75 in decimal

All the integer operations are the same you just have to remember where the decimal point is when you convert to decimal. The algorithim to convert to decimal is the same too you just need to put a decimal point in the right place when you display the number.
 
Thanx for replyng. can you provide me a bit of code for this purpose as i'm very new to microcontrollers.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…