www.micro-examples.com
Microcontroller circuits and source code examples
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 

Calculation in PIC

 
Post new topic   Reply to topic    www.micro-examples.com Forum Index -> General Discussion About PIC Microcontrollers
View previous topic :: View next topic  
Author Message
yylee



Joined: 30 May 2006
Posts: 15
Location: Miri

PostPosted: Tue Jul 11, 2006 11:34 am    Post subject: Calculation in PIC Reply with quote

Hi there,

I am using PIC16F767 and I would like to do the calculation using the PIC. It is simple to do the addition and subtraction. But how about divide? How to do the division?

Appreciate the help. Thanks.

YY
_________________
Look ever forward
Back to top
View user's profile Send private message
BrunoG
Site Admin


Joined: 22 Nov 2005
Posts: 636

PostPosted: Tue Jul 11, 2006 2:14 pm    Post subject: Reply with quote

Hi,

PIC16 MCU family have neither a multiply nor a divide built-in instruction.
You will have to use a library to perform char, int, long and float calculations.

If you use a high-level language compiler like mikroC, mikroPascal or mikroBasic, these libraries are ready to use.
You can download the mikroE compilers for free (with a 2k demo limit) from here :
http://www.mikroe.com/en/compilers/

If you use assembly language, here is an application note AN526 from Microchip about math utility routines for PIC16 family :
http://ww1.microchip.com/downloads/en/AppNotes/00526e.pdf
_________________
BrunoG, Administrator
Back to top
View user's profile Send private message Send e-mail
yylee



Joined: 30 May 2006
Posts: 15
Location: Miri

PostPosted: Thu Jul 13, 2006 5:05 pm    Post subject: Reply with quote

Many thanks! Very Happy
_________________
Look ever forward
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.micro-examples.com Forum Index -> General Discussion About PIC Microcontrollers All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group