Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with a math equation (16f877a)

Status
Not open for further replies.

martinisonline

Member level 2
Joined
Apr 24, 2005
Messages
47
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Portugal
Activity points
1,792
Math problem??...16f877a

Hy...

I'm implementing a temperature meter based in the ds1820.
It works great, but now, i 'm trying to do the high resolution mode.

i need to do a math equation that is:

temp = temp_read - 0.25 + (count_per_C - count_remain)/count_per_C

these variables are int. The 'temp' must be float because the division, right?

Can i do a divison of 2 int and return 1 float?

viewing at hyperterminal, the variable 'temp' is always 0...

I am using CCS and 16F877A.

Greats...
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,471

martinisonline

Member level 2
Joined
Apr 24, 2005
Messages
47
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Portugal
Activity points
1,792
Re: Math problem??...16f877a

Information : while(true){ printf("Very");} usefull...:)
Tanks...

Do you want to know why I like more parsing at low level rather than C ?

it's more dificult, but more "inside the question"...:)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top