| View previous topic :: View next topic |
| Author |
Message |
yylee
Joined: 30 May 2006 Posts: 15 Location: Miri
|
Posted: Tue Jul 11, 2006 11:34 am Post subject: Calculation in PIC |
|
|
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 |
|
BrunoG Site Admin
Joined: 22 Nov 2005 Posts: 636
|
Posted: Tue Jul 11, 2006 2:14 pm Post subject: |
|
|
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 |
|
yylee
Joined: 30 May 2006 Posts: 15 Location: Miri
|
Posted: Thu Jul 13, 2006 5:05 pm Post subject: |
|
|
Many thanks!  _________________ Look ever forward |
|
| Back to top |
|
|