Re: division problem 500000 / 133
Here is a snipit form a program I use and it works great:
'************************************************* *******************
CALCF_C: 'CALCULATE DEG.F and DEG.C for LM 95231 TEMPERATURE SENSOR READING
'************************************************* *******************
CALCF:
SCRATCH = TEMPREAD * 1000
TEMPF = DIV32 17777
TEMPF = TEMPF * 10
TEMPF = TEMPF + OFFSET
CALCC:
SCRATCH = TEMPREAD * 10
TEMPC = DIV32 32
RETURN
Just make sure you don't have any interrupts going on when using DIV32.
I also think your problem may be that you are using a variable after the DIV32 keyword. Try entering the constant value and see if that doesn't work.
Last edited by Dave; - 24th May 2013 at 12:01.
Dave Purola,
N8NTA
EN82fn
Bookmarks