Searching \ for 'Comparisons' 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/index.htm?key=comparisons
Search entire site for: 'Comparisons'.

Truncated match.
PICList Thread
'Comparisons'
1997\01\15@135923 by Luciano Cadaval Basso

flavicon
face
Hello people :

       I'm new with PICs and I'm searching informations of comparisons of pic
with other microcontrolers and with its onw familie. I want to chose the
best model for my projecs.
       I will de glad if someone give me some informations.
                       Thank's
                               Luciano Cadaval Basso


'Comparisons'
2000\01\19@104156 by Bradshaw, William V
flavicon
face
I am trying to compare 2 numbers to find out which one is greater and then
determine if the difference is within a certain tolerance.  I am new to the
pic so any pointers would be greatly appreciated.

Thanks in advance,
Vern

2000\01\19@141251 by jamesnewton

flavicon
face
Subtract the two values, complement if carry, then subtract the tolerance
and branch if carry.

see:
204.210.50.240/techref/default.asp?url=microchip/routines.htm
under conditionals and math

---
James Newton spam_OUTjamesnewtonTakeThisOuTspamgeocities.com 1-619-652-0593
http://techref.homepage.com The Technical Details Site.
Members can add private/public comments/pages ($0 TANSTAAFL web hosting)


-----Original Message-----
From: pic microcontroller discussion list
[.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU]On Behalf Of Bradshaw, William V
Sent: Wednesday, January 19, 2000 07:41
To: PICLISTspamKILLspamMITVMA.MIT.EDU
Subject: Comparisons


I am trying to compare 2 numbers to find out which one is greater and then
determine if the difference is within a certain tolerance.  I am new to the
pic so any pointers would be greatly appreciated.

Thanks in advance,
Vern

2000\01\19@164553 by Tony Nixon

flavicon
picon face
"Bradshaw, William V" wrote:
>
> I am trying to compare 2 numbers to find out which one is greater and then
> determine if the difference is within a certain tolerance.  I am new to the
> pic so any pointers would be greatly appreciated.
>
> Thanks in advance,
> Vern

http://www.picnpoke.com/projects/compares.txt


--
Best regards

Tony

http://www.picnpoke.com
.....salesKILLspamspam.....picnpoke.com

2000\01\19@185404 by andy howard

flavicon
face
> I am trying to compare 2 numbers to find out which one is greater and
then
> determine if the difference is within a certain tolerance.  I am new
to the
> pic so any pointers would be greatly appreciated.

Subtracting one number from another and checking the carry bit is a good
way to test for greater-than or less-than. You can check each end of a
tolerance range by doing it twice.





.

2000\01\20@035753 by Richard Fleming

flavicon
picon face
Number crunching such as you describe is basically done by
doing a calculation  and then checking the zero flags(STATUS,Z) and carry
flags
(STATUS,C)and branching on the result eg with btfsc STATUS,Z or STATUS,C.

eg
subtracted A from A the zero flag would be set

subtracted F from A the carry flag would be set thus indicating that F is
bigger than A

Hope this helps
Rich

{Quote hidden}

2000\01\21@020522 by Dr. Imre Bartfai

flavicon
face
Hi,

do not forget the PIC has the opposite behaviour with respect to carry,
i. e. it is set if the result is NOT negative after subtraction.

Regards,
Imre


On Thu, 20 Jan 2000, Richard Fleming wrote:

{Quote hidden}

> > {Original Message removed}

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