Doing calculations involving 'big' numbers on an 8-bit Pic

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
muxer107
Posts: 8
Joined: Fri Apr 27, 2007 2:39 pm
Contact:

Doing calculations involving 'big' numbers on an 8-bit Pic

Post by muxer107 »

Hi all

Im currently doing a project involving converting a thermocouple voltage into temperature.

Im doing it in source boost, using a pic16f84a and have hit a problem.

The calculations involved are limiting greatly what I can do with it.

for instance: t = (1237035 + (28015*x))/1000000;

Now this obviously wont work as the output will be too large. Is their any way of doing maths like this in PIC?? The actual full code for linearising the thermocouple is only about 15 lines long, but it all includes large numbers for accuracy.
BTW 'x' can be as large as 9288

Any help appreciated, I really need to get somewhere with this!
Muxer

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello

Here is an example of how to use 32 bit math operations on a PIC micro using Flowcode.

http://www.matrixmultimedia.com/support ... .php?t=505

muxer107
Posts: 8
Joined: Fri Apr 27, 2007 2:39 pm
Contact:

Post by muxer107 »

Thanks! that worked perfectly :)

stephen

Post Reply