Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top