Searching \ for '[PIC] Floating Point on 16x' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Floating Point on 16x'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Floating Point on 16x'
2005\05\25@214429 by Mark Bellamy

picon face
My main questions are about AppNote 575: IEEE 754 Compliant Floating
Point Routines.

It seems very difficult to caculate the binary represention of a
number.  For instance, how you represent .5 in the "24 bit reduced
format"?  Can someone walk me through the conversion process.  I see
there is appendix A there is an algroithm to do it. But wow, it would
take about 30 minutes to manually do it.  I'm hoping I'm missing
somthing.

After seeing the diffuculty in using floating point on PIC using
appnote 575. I'm wondering if there is a better solution?  I
considered C but Microchip's own C compiler don't work on the 16x
series.  The HITECH-C is too expensive unless you are in a commercial
situation.

What is the point in ADC if you can't use floating point?  The 16F88
has ADC but even Microchip's C compiler will not work for it.  I don't
see how ADC can be usful without a multiply and divide instrution to
calcuate the actual voltage value from the 10 bit representation.

I guess I'm hoping there is something that makes floating point easier
for the 16 series.  It sure would be nice to have a convienent way to
represent a floating point number.  I guess I got spoiled on C where
you can put the floating point values in your code without manually
converting to binary.

Thanks!
-
Mark Bellamy

2005\05\25@220057 by Jon Nall

picon face
On 5/25/05, Mark Bellamy <spam_OUTmbellamyTakeThisOuTspamgmail.com> wrote:
> I guess I'm hoping there is something that makes floating point easier
> for the 16 series.

here's a library in which you might be interested.
http://picfloat.sourceforge.net/

nall.

2005\05\25@234435 by Kenneth Lumia

picon face
Mark,

Floating point is generally a very intensive routine, both in code
space and runtime. Fixed point arithmetic is much cleaner and
faster.  To be honest, I can't recall when I absolutely needed a
float while programming any microcontroller algorithm.  It is really
a matter of how accurate (number of digits)  you need the
answer to be.  As long as you know the maximum size of the
numbers going into the fixed point multiply, you can guarantee
that there won't be an overflow.

> What is the point in ADC if you can't use floating point?  The 16F88
> has ADC but even Microchip's C compiler will not work for it.  I don't
> see how ADC can be useful without a multiply and divide instruction to
> calculate the actual voltage value from the 10 bit representation.
> Thanks!

Multiply and divide op codes means that there is a hardware
multipler in the chip.  Many chips don't have one so the multiply
is done in software.  Many sources of 8x8, 16x16 even 32x32 multiply
routines are available, and are relatively small and fast. Floating
point routines are also available, but are not small or fast.

As far as the ADC values go, fixed point arithmetic works fine.  
Just take the value and load it into 2 bytes, then multiply by the
fraction of a volt each adc step represents (expressed in fixed point).  
I guess an example or two would be good at this point.  First off,
assume that we will use 2 bytes to represent the multiplier, with the
decimal point intrinsically placed between the two bytes. Let's say
that each step of the ADC is 0.25 volts.  The .25v would be
expressed as 0x0040;  the 00 is the integer portion, the 40 is the
fraction. The fractional bits are calculated as follows:  the msb
0x80 is closest to the decimal point and has a binary value of
2^(-1) = .5,  the 0x40 would have a value of 2^(-2) = .25, 0xC0
would have a value of .75 (the addition of .5+.25), etc.  

Let's say the ADC returned a value of 0x002 (signifying a value
of .5V).  If you multiply  2 * 0x0040, you would get 0x0080.  
Remember that the decimal point is between the two bytes,
so the integer part is 0 and the fractional part is 2^-1 = .5V

If the ADC returned a value of 4 (1V), the resulting multiply
0x0004 * 0x0040 would return 0x0100 which contains an
integer of 1 and the decimal portion of 0, (1.0 v).

>
> I guess I'm hoping there is something that makes floating point easier
> for the 16 series.  It sure would be nice to have a convenient way to
> represent a floating point number.  I guess I got spoiled on C where
> you can put the floating point values in your code without manually
> converting to binary.
>
Although programming in C is easier and faster (no flames please)
you will still pay a huge premium in code space and runtime
if you decide to use floating point over fixed point.  The compiler
simply hides the complexity from you.

Finally, before deciding on the requirement for floating point,
look at the numbers and see if you really need the
dynamic range that floating point gives you.  

Ken
.....klumiaKILLspamspam@spam@adelphia.net


2005\05\26@035224 by Mike Harrison

flavicon
face

>What is the point in ADC if you can't use floating point?  The 16F88
>has ADC but even Microchip's C compiler will not work for it.  I don't
>see how ADC can be usful without a multiply and divide instrution to
>calcuate the actual voltage value from the 10 bit representation.

You don't need FP to do multiply and divide....

Looks like you don't really understand when to use floating point...

FP gives you RANGE, not Precision. For a given size of variable, fixed-point will always be more
accurate, faster and use less code than FP.

Embedded systems rarely encounter real-world values that need the range that FP offers.
Unless you are getting into complex maths, Fixed-point/integer values of suitable widths are almost
always much more efficient in a resource-limited environment like a PIC.

e.g. to display an ADC value from 0..1023 as a  voltage from 0..9.999V, multiply it up to give a
value from  0 to 9999 and just insert a DP in the appropriate place when you display the result.

The factor needed above is 9.774, so you need to represent this as a fixed-point binary value.
e.g. multiply it by 2^12 to give a constant value of 40034 (2^12 chosen so it fits in 16 bits)
You then  do a 16x16=>32 bit multiply of the ADC result by this constant, and shift the result right
by 12 bits to get the result in millivolts.

A slightly more efficient way might be to shift the ADC result up so the number of shifts of the
original value plus the shifts of the constant is a multiple of 8, then you just use the appropriate
bytes of the result.
You can add a small 'fudge factor' to the constant to correct for rounding errors caused by
truncating the result.
The other thing you can do is to use the constant as a cailbration factor to fine-adjust the
scaling.

The only thing you need to take care over is where to put the fixed point so you don't overflow - in
some cases the ideal fixed-point position may vary in different parts of the code, but as long as
you keep track of things this is not a problem.

These techniques are equally applicable to assembler and C. Although C has the advantage that it's
easier to deal with larger numbers, but can be less efficient as you need to go to a 4-byte long if
you need more than 16 bits, whearas in assembler you can do a 'medium' data type of 3 bytes.

2005\05\26@040501 by Alan B. Pearce

face picon face
> What is the point in ADC if you can't use floating point?  The 16F88
> has ADC but even Microchip's C compiler will not work for it.  I don't
> see how ADC can be useful without a multiply and divide instruction to
> calculate the actual voltage value from the 10 bit representation.
> Thanks!

Perhaps you should give us some figures for what a step on your ADC
represents. As others have pointed out, fixed point arithmetic should be
more than adequate. However the other item I do wonder is what value of
reference voltage you are using. It does help to use a reference that makes
the calculation easy.

2005\05\26@071943 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Mike Harrison" <mikespamKILLspamwhitewing.co.uk>
Subject: Re: [PIC] Floating Point on 16x


> FP gives you RANGE, not Precision.

Mike hit on something very important here.  I think a lot of people are
confused on this issue.

The PIC is a microCONTROLLER.  That means it is usually connected to some
sort of real world device.  In the physical world, rarely do things change
over an order of magnitude or two, so in almost all cases 10 or 12 bits is
adequate.

Now, if you have to do some calculations, then it takes considerable thought
on how to scale the intermediate values, but the situation where you can't
do that scaling is extremely rare.  Indeed, when doing control, going
through that scaling exercise is important, because it helps cement in your
mind the significance of various factors.  You not only gain by avoiding
big, cumbersome, floating point routines, but you gain by paying attention
to the important variables and not getting hung up on insignificant
variables.

All that being said, floating point is available, and it isn't rocket
science, either.  Like most thing in the PIC, (or any embedded system for
that matter), it pays to really understand what is happening, though.  There
are a number of floating point packages out there, each with very
significant issues.  I would suggest that one should roll one's own FP
routines the first time out, in order to be able to make an informed
judgement of the merits of the various alternatives.  I'm a big fan of
re-use, but unless that re-use is done in an informed manner, the results
can be pretty unpleasant.

So yes, if you need to solve a system of differential equations or something
on that order, then go out and understand the floating point options.  But
if your application is remotely normal, why on earth would you subject
yourself to the size, performance and grief of floating point?

--McD

2005\05\26@075137 by olin_piclist

face picon face
part 1 1552 bytes content-type:text/plain; (decoded 7bit)

Mark Bellamy wrote:
> It seems very difficult to caculate the binary represention of a
> number.  For instance, how you represent .5 in the "24 bit reduced
> format"?  Can someone walk me through the conversion process.  I see
> there is appendix A there is an algroithm to do it. But wow, it would
> take about 30 minutes to manually do it.

If the Microchip format is the same as my 24 bit floating point format, you
can use my conversion utilities FPH and HFP.  These are part of the PIC
development environment at http://www.embedinc.com/pic.  I've attached a
description of my 24 bit floating point format.

> What is the point in ADC if you can't use floating point?

Huh?  You seriously can't think of ways of using the unsigned integer value
from the A/D directly?

> I don't
> see how ADC can be usful without a multiply and divide instrution to
> calcuate the actual voltage value from the 10 bit representation.

Why are units of volts special?  Why can't you use the measured EMF in the
units the A/D gives you?  About the only reason I can see for the PIC
converting to volts is if it has to handle direct interaction with a human
where units of volts are used explicitly.  Even then, floating point is most
likely unnecesary.  If the PIC is driving a 4 digit display showing volts
with 3 decimal places, then integer millivolts would be more useful.

Chances are good you don't really need floating point to manipulate your A/D
readings.  What is your application?


part 2 2469 bytes content-type:text/plain;
(decoded quoted-printable)

;   24 bit floating point format:
;
;     24 bits are used to describe a floating point value using 1 sign bit
;     7 exponent bits, and 16 mantissa bits as follows:
;
;     |         byte 2        |         byte 1        |         byte 0        |
;     |           |           |           |           |           |           |
;      23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
;     ------------------------------------------------------------------------
;     |  |                    |                                               |
;     | S|      EXP           |                   MANT                        |
;     |  |                    |                                               |
;     ------------------------------------------------------------------------
;
;     S  -  Sign bit.  0 for positive or zero value, 1 for negative value.
;
;     EXP  -  Exponent.  The overall floating point value is the mantissa
;       value times 2 ** (EXP - 64) when EXP is in the range from 1 to 127.
;       The special EXP value of 0 is only used when the overall floating
;       point value is 0.0.
;
;     MANT  -  Mantissa.  Except for the special case when the overall
;       floating point value is 0, the mantissa represents a fixed point
;       value such that 1 <= mantissa < 2.  This means the integer part of
;       the mantissa is always 1.  Since this integer part is always the
;       same, it is not stored.  The MANT field contains the 16 most
;       significant fraction bits of the mantissa value.  Therefore
;       MANT = (mantissa - 1) * 65536.  An overall floating point value of
;       0.0 is indicated by EXP = 0.  In that case MANT is reserved, and
;       should be 0.
;
;    Consider the following examples:
;
;      0.0 --> 000000h
;
;        S = 0  (positive or zero)
;        EXP = 0  (special case for 0.0)
;        MANT = 0  (special case for 0.0)
;
;      1.0 --> 400000h
;
;        S = 0  (positive or zero)
;        exponent = 0, EXP = 64 --> 40h
;        mantissa = 1.0, MANT = 0
;
;      -3.141593 --> C19220h
;
;        S = 1  (negative)
;        exponent = 1, EXP = 65 --> 41h
;        mantissa = 1.570797, MANT = 37,408 --> 9220h
;
;   Unless otherwise specified, overflow and underflow values are silently
;   clipped to the maximum magnitude (7FFFFF for positive, FFFFFF for negative)
;   and zero, respectively.


part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

2005\05\26@082720 by Jan-Erik Soderholm

face picon face
Mark Bellamy wrote :

> I don't see how ADC can be usful without a multiply and divide
> instrution to calcuate the actual voltage value...

Why do you need the actual voltage value ? The ony reason I
can think of is to put it on an LCD. If you're transfering the
values to (e.g.) an PC, it might be easier to do the ADC to
actual voltage conversion on the PC instead.

Note that you can use a volt.ref such as the ADC readings
are in millivolt directly. Or you can put a voltage devider (and
an opamp) before the ADC to make the scaling on the "A"
side of the ADC. Then it's also pretty easy to implement
multi-range measuring.

Jan-Erik.



2005\05\26@094423 by Spehro Pefhany

picon face
At 09:44 PM 5/25/2005 -0400, you wrote:


>What is the point in ADC if you can't use floating point?  The 16F88
>has ADC but even Microchip's C compiler will not work for it.  I don't
>see how ADC can be usful without a multiply and divide instrution to
>calcuate the actual voltage value from the 10 bit representation.

You don't need FP for that (if you indeed need to do that).
Fractional fixed point math is sufficient. Suppose you have the number
1023 and you want that to read 5.15V (because you're using Vdd for the
reference and it's not exactly 5.00V). Let's further say that you
will represent 5.15V as 515. So you want to multiply by 515/1023 =
0.5034213098729227761485826001955. If you use 32 bit fixed-point math, you
could multiply by 0x40701C07 and retain the most significant 33 bits of
the 64-bit result. If you use 16 bit fixed point math you could use 0x4070
and keep the ms 17 bits of the 32-bit result.

Eg. 0x3FF * 0x4070 = 0x1017F90, keep ms 17 bits, round up to 0x203)
which is 515.

The dsPIC has a 17 x 17 bit hardware multiplier that will do something
like this extremely fast, but it's easy enough to do in software on any MCU.


>I guess I'm hoping there is something that makes floating point easier
>for the 16 series.  It sure would be nice to have a convienent way to
>represent a floating point number.  I guess I got spoiled on C where
>you can put the floating point values in your code without manually
>converting to binary.

You can get yourself a utility program that converts floating point
binary values to human-readable form. Also, the watch window in MPLAB can
interpret certain types of standard floats.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff


2005\05\26@134505 by Vic Fraenckel

flavicon
face
If you really, really, really need to do floating point have a look at the
Floating Point Coprocessor at:

http://www.micromegacorp.com

HTH

Vic
________________________________________________________

Victor Fraenckel - The Windman
victorf ATSIGN windreader DOTcom
KC2GUI


2005\05\26@233658 by Mark Bellamy

picon face
Everyone's input on this has been very helpful.  I think fixed point
will work just fine for me.  I'm only dealing with daily temperature,
so no big dynamic range requirements.

I want to display the temperature on an LCD.  I'm using a LM34CZ.  It
outputs 10mv per degree F.  On the LCD, I only expect one place after
the decimal.  (I am probably lucky if I get accuracy to the nearest
degree, but it's still nice to have that decimal place to see which
way the temperature is trending.)  To make it simple for now, I decide
to place limits of 0-100 degrees F.

Will this design work?:

Vcc is 5v.
The PIC ADC is configured to use Vcc as the upper ref voltage.
Take the 10bit ADC value, multiply it by .00488 (5/1024).
That will result in the actual voltage.
Multiply that value by 100 to get degrees. (or instead of of using
.00488 in the previous step, just use .488)

How do I determine what fixed point format will work?   The ADC result
is 10 bits so I will need at least two bytes.  How do you determine
how many bits are required for the fractional part after the decimal?

On figuring out how many bits I need before the decimal point:
Assuming a max temperature of 100 deg F, that results in 1V into the
ADC (100 x 10mv).  1V in the ADC would correspond to 204 ( 1/.00488).
That 204, I believe will be the largest number, so 8 bits should work.
Is this correct logic?

Since I need to represent .488, I will need enough bits to hold 488.
That ends up requiring 9 bits (2^9=512).  Is this the correct way to
tell how many bits you need for the fractional part?  Maybe for
simplicity I should use the 16x16 fixed point format?  Or maybe it can
be determined that .49 will be accurate enough?  Although I don't know
how to calculate how accurate that will be.  .488 itself is a rounded
result of 5/1024*100.  Maybe .5 would be accurate enough?

On a slightly different topic, since I'm going to hard code the
voltage per bit of the ADC, I need a stable and accurate voltage
reference.  For simplicity's sake, I was going to use Vcc which is 5v.
What are some strategies to help guarantee a stable and accurate
reference voltage for an ADC?

Thanks for all of your input.
-

Mark Bellamy

2005\05\27@041923 by Jan-Erik Soderholm

face picon face
Mark Bellamy wrote :

> I want to display the temperature on an LCD.  I'm using a LM34CZ.  It
> outputs 10mv per degree F.

If you use an external ADC reference of 1.024 V (there are a lot of
those available) you will get an ADC reading with a resolution
of 0.1 F directly. No need to mul or div, just convert the 10-bit
ADC value to BCD and display. You can more or less forget
about the rest of your post...

1.024 V / 1024 ADC-steps = 1mV per ADC-step = 0.1 F.

B.t.w, have you thought about some of the temp sensors that
directly outputs a binary (digital) value ? Then you don't need
the ADC at all.

Best Regards,
Jan-Erik.

{Quote hidden}

> --

2005\05\27@064419 by Alan B. Pearce

face picon face
>> I want to display the temperature on an LCD.  I'm using a LM34CZ.  It
>> outputs 10mv per degree F.
>
>If you use an external ADC reference of 1.024 V (there are a lot of

However do remember that a PIC needs a ref of around 2.5V to work correctly.
So a reference of 2.048 would give 0.2F per bit, so 2.560V reference would
give 0.25F as your LSB. You should be able to set up a reference using a low
power LM317 and a couple of resistors to this voltage, if a suitable off the
shelf one is not available.

2005\05\27@081213 by Jan-Erik Soderholm

face picon face
Alan B. Pearce wrote :

> >> I want to display the temperature on an LCD.  I'm
> >> using a LM34CZ.  It outputs 10mv per degree F.
> >
> >If you use an external ADC reference of 1.024 V (there are a lot of
>
> However do remember that a PIC needs a ref of around 2.5V to
> work correctly.

Good point!

The point *I* was trying to make, was that by carefully
selecting the volt.ref (and maybe conditioning the analog
signal with an opamp), you can *greatly* simplify the
firmware in the PIC. With the "right" input level and volt.ref
you can get the "real world" values directly from the ADC.
(in binary, but anyway...)

This is also clear from the data sheet for the LM34 where
they show a couple of applications where the LM34 is
connected to a standalone ADC and they use what could
be looked at as "odd" ref voltages, but that gives "correct"
values directly from the ADC.

Best Regards,
Jan-Erik.



2005\05\27@103335 by Kenneth Lumia

picon face
Mark,

You will need to do a 16x16 multiply.  I didn't check your
assumtions, however, if you state that the largest input is
204, and the multiplier is .488, you would set the multiplier
up as follows:

The fixed point location is between the two bytes.  The input
value from the adc (maximum of 204 = 0x00cc) is loaded into
the appropriate variable (16 bits), and the fractional part is
calculated as .488*2^8 = 124.92, round to 125.  Converting 125
to hex is 0x007d.  Do the multiply, and the integer portion is
available in the high byte and the fraction is in the low byte.

For example, at 100F, the calculation is:
0x00cc * 0x007d = 0x639c.  The 0x63 is the integer portion,
(99F) and the 0x9C is fraction (.609375F) or about 99.6F.
Notice the roundoff error (should have been 100).  I guess
either the 204 or the .488 is either incorrect, or rounded off,
i.e.,  204*.488= 99.552F.  

Also notice that my rounding off of
124.92 to 125 caused my result to be slightly high by
.609375-.552= .057F, probably ok for this design.

If you need higher resoulution, you will need to use more of
the ADC. Instead of 5V for reference, you could use
either a resistor divider or a reference device, depending
on the accuracy needed.  Just make sure that when you
multiply the ADC input value with the new multiplier, you
don't overflow the 16 bits.

Oh, and if you do use 5V reference, make sure you account
for errors if the reference is not exactly 5V, i.e., 4.75V - 5.25V
or whatever your tolerances are on the regulator.  Do the
math before you build it, you probably won't like it and will
eventually choose a reference device in the 2.5 to 3V range.

Ken

EraseMEklumiaspam_OUTspamTakeThisOuTadelphia.net
{Original Message removed}

2005\05\27@120524 by Bob Blick

face picon face
Jan-Erik Soderholm writes:

> If you use an external ADC reference of 1.024 V

Not if you are using a PIC for your ADC!

The limit for ADC reference voltage is nowhere near that low, on any PIC
available.

-Bob



2005\05\27@121022 by Andrew Kieran

picon face

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


---- On Thu, 26 May 2005, Mark Bellamy (mbellamyspamspam_OUTgmail.com)
wrote:
> I want to display the temperature on an LCD.  I'm using a
LM34CZ.  It
> outputs 10mv per degree F.  On the LCD, I only expect one
place after
> the decimal.


Mark,
I have built the same thing, using the same sensor.  I used the
5V output of the power supply as a reference.  There are plenty
of cheap precision voltages references out there, but I stuck
with Vdd since I didn't need high precision.

The key was to scale the values and then use a 16 X 16 multiply
routine.

i.e.
5000mv / 1024 ADC steps / 10 mv per degree = .488 degrees per
ADC unit

Since we can't represent .488 as a fixed point, multiply it by
65536 (hex 0x10000) to get 32000 or in hex, 0x7d00.  This will
be a constant for every conversion.  Your program needs to
multiply the ADC reading by  0x7d00, producing a 32 bit result.
Divide this by 65536 by ignoring the lowest 16 bits and you have
your answer in degrees.

e.g. ADC reading = 0xc0
Degrees = 0xc0 * 0x7d00 / 0x10000
= 0x5DC000 / 0x10000
= 0x5d
= 93 degrees

Compare this to the floating point alternative:
Degrees = ADC reading * 5000mv / 1024 ADC steps / 10 mv per
degree
= ADC reading * .48828125
= 0xc0 * .48828125
= 192 * .48828125
= 93.75

That's close enough for my application, but maybe not yours.  In
that case, use a 4.096 or other value precision voltage
regulator.


Andrew

2005\05\27@122629 by Jan-Erik Soderholm

face picon face
Bob Blick wrote :

> Jan-Erik Soderholm writes:
>
> > If you use an external ADC reference of 1.024 V
>
> Not if you are using a PIC for your ADC!
>
> The limit for ADC reference voltage is nowhere near that low,
> on any PIC available.

OK, yes, fine...

My point was that by carefully selecting the ref.voltage
(and maybe the pre-processing of the analog signal),
you can simplify the processing needed after the ADC...

Jan-Erik.



2005\05\27@125649 by Spehro Pefhany

picon face
At 12:10 PM 5/27/2005 -0400, you wrote:


>That's close enough for my application, but maybe not yours.  In
>that case, use a 4.096 or other value precision voltage
>regulator.

Or, if you have control over the power supply, consider using a better
regulator for Vdd, especially if there is not much else running off it.
1% and 0.5% tolerance regulators are easily available, and provide an
intermediate unadjusted accuracy option between a typical 5% supply and
a pricey +/-0.1% reference.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff



2005\05\27@131726 by Mark Jordan

flavicon
face
On 27 May 2005 at 12:10, Andrew Kieran wrote:

>
> i.e.
> 5000mv / 1024 ADC steps / 10 mv per degree = .488 degrees per
> ADC unit
>

       Use 5120mV as reference and no complex math is needed.
       
       Mark Jordan


2005\05\27@144059 by Andrew Kieran

picon face

A 4.096V 1% precision voltage reference is under a buck at:

http://www.voti.nl/shop/catalog.html




________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag


---- On Fri, 27 May 2005, Spehro Pefhany (KILLspamspeffKILLspamspaminterlog.com)
wrote:
>
> Or, if you have control over the power supply, consider using
a better
> regulator for Vdd, especially if there is not much else
running off it.
> 1% and 0.5% tolerance regulators are easily available, and
provide an
> intermediate unadjusted accuracy option between a typical 5%
supply and
{Quote hidden}

In
> >that case, use a 4.096 or other value precision voltage
> >regulator.

2005\05\28@123019 by Mark Bellamy

picon face
> However do remember that a PIC needs a ref of around 2.5V to work correctly.
> So a reference of 2.048 would give 0.2F per bit, so 2.560V reference would
> give 0.25F as your LSB. You should be able to set up a reference using a low
> power LM317 and a couple of resistors to this voltage, if a suitable off the
> shelf one is not available.


Thanks again for everyone's input.  I am ordering a 2.5v reference
voltage generator from Microchip.

You all help me realize that by using a 5V reference while the max
signal was 1v, I was only getting 1/5 of the possible resolution,
which is really bad.

As Alan pointed out, I can get .2F per bit using 2.5v as the
reference.  If I can make make an amplifier to multiply my 0-1V signal
by 2 thae I will get more resolution.

Mark Bellamy


'[PIC] Floating Point on 16x'
2005\06\01@065112 by Peter Onion
flavicon
face
On Thu, 2005-05-26 at 13:44 -0400, Vic Fraenckel wrote:
> If you really, really, really need to do floating point have a look at the
> Floating Point Coprocessor at:
>
> http://www.micromegacorp.com

Vic,

Do you have any experience with these devices ?  I've just ordered a
couple to play with as they look neat !

Peter



More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...